/* ── WOTO Mobile Web — Native Look ── */
:root {
  --primary: #54B68C;
  --primary-dark: #3D9E76;
  --primary-light: #E8F5EE;
  --warm-bg: #F5F0E8;
  --card-bg: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-muted: #999;
  --border: #E8E3DD;
  --success: #4CAF50;
  --warning: #FFA726;
  --error: #EF5350;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--warm-bg); color: var(--text-primary); }
body { -webkit-font-smoothing: antialiased; }

#app { height: 100%; display: flex; flex-direction: column; position: relative; }

/* ── Screens ── */
.screen { display: none; position: absolute; inset: 0; background: var(--warm-bg); }
.screen.active { display: flex; }
#splash-screen { z-index: 100; justify-content: center; align-items: center; background: white; }

/* ── Splash ── */
.splash-content { text-align: center; animation: fadeIn 0.3s ease; }
.splash-icon { margin-bottom: 16px; }
.splash-title { font-size: 32px; font-weight: 700; color: var(--primary); letter-spacing: -0.5px; }
.splash-sub { color: var(--text-secondary); margin-top: 4px; font-size: 16px; }
.splash-loader { margin-top: 40px; width: 200px; margin-inline: auto; }
.loader-bar { height: 3px; background: var(--border); border-radius: 3px; overflow: hidden; position: relative; }
.loader-bar::after { content: ''; position: absolute; inset: 0; background: var(--primary); border-radius: 3px; animation: loadBar 1.5s ease infinite; width: 30%; }
@keyframes loadBar { 0% { left: -30%; } 100% { left: 100%; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Auth ── */
#auth-screen { overflow-y: auto; justify-content: center; background: white; }
.auth-container { padding: 32px 24px; max-width: 400px; margin: 0 auto; width: 100%; }
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-logo { margin-bottom: 12px; }
.auth-header h1 { font-size: 28px; color: var(--primary); font-weight: 700; }
.auth-tagline { color: var(--text-secondary); margin-top: 4px; font-size: 15px; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; background: var(--warm-bg); border-radius: var(--radius-sm); padding: 4px; }
.auth-tab { flex: 1; padding: 10px; border: none; background: transparent; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all 0.2s; }
.auth-tab.active { background: white; color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.auth-form { display: none; flex-direction: column; gap: 16px; }
.auth-form.active { display: flex; }

/* ── Forms ── */
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"] { padding: 14px 16px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: 16px; background: white; transition: border 0.2s; outline: none; }
input:focus { border-color: var(--primary); }
.role-toggle { display: flex; gap: 8px; }
.role-option { flex: 1; }
.role-option input { display: none; }
.role-option span { display: block; padding: 12px; border: 2px solid var(--border); border-radius: var(--radius-sm); text-align: center; font-size: 14px; font-weight: 500; transition: all 0.2s; cursor: pointer; }
.role-option input:checked + span { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

.btn-primary { background: var(--primary); color: white; border: none; padding: 14px 20px; border-radius: var(--radius-sm); font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-primary:active { transform: scale(0.98); background: var(--primary-dark); }
.btn-full { width: 100%; }
.btn-secondary { background: white; color: var(--primary); border: 2px solid var(--primary); padding: 12px 20px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-outline { background: transparent; border: 2px solid var(--border); padding: 12px 20px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 500; cursor: pointer; color: var(--text-secondary); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.auth-error { color: var(--error); font-size: 13px; text-align: center; min-height: 20px; }

/* ── Main Screen Layout ── */
#main-screen { flex-direction: column; }
#page-container { flex: 1; overflow: hidden; position: relative; }
.page { display: none; position: absolute; inset: 0; overflow-y: auto; background: var(--warm-bg); -webkit-overflow-scrolling: touch; }
.page.active { display: flex; flex-direction: column; animation: pageIn 0.25s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.page-header { padding: 16px 16px 0; flex-shrink: 0; }
.page-header-detached { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: white; border-bottom: 1px solid var(--border); }
.page-header-detached h3 { font-size: 17px; font-weight: 600; }
.page-body { flex: 1; padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.header-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.header-top h2 { font-size: 22px; font-weight: 700; }
.text-muted { color: var(--text-secondary); font-size: 14px; margin-top: 2px; }
.header-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }

.search-box { display: flex; align-items: center; gap: 10px; background: white; padding: 10px 16px; border-radius: var(--radius); box-shadow: var(--shadow); }
.search-box input { flex: 1; border: none; outline: none; font-size: 15px; background: transparent; }

/* ── Bottom Nav ── */
.bottom-nav { display: none; height: calc(var(--nav-height) + var(--safe-bottom)); padding-bottom: var(--safe-bottom); background: white; border-top: 1px solid var(--border); justify-content: space-around; align-items: center; flex-shrink: 0; }
.bottom-nav.visible { display: flex; }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: none; color: var(--text-muted); font-size: 10px; cursor: pointer; padding: 4px 12px; transition: color 0.2s; }
.nav-item svg { width: 24px; height: 24px; }
.nav-item.active { color: var(--primary); }
.nav-item span { font-size: 11px; font-weight: 500; }

/* ── Cards ── */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-body { padding: 16px; }

/* ── Fotografer Card ── */
.foto-card { display: flex; gap: 14px; padding: 14px; background: white; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; cursor: pointer; transition: transform 0.15s; }
.foto-card:active { transform: scale(0.98); }
.foto-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: var(--primary); flex-shrink: 0; }
.foto-info { flex: 1; min-width: 0; }
.foto-name { font-weight: 600; font-size: 16px; }
.foto-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 13px; color: var(--text-secondary); }
.foto-meta span { display: flex; align-items: center; gap: 4px; }
.foto-price { margin-top: 6px; font-weight: 600; color: var(--primary); font-size: 14px; }
.foto-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.foto-badge.online { background: #E8F5E9; color: var(--success); }
.foto-badge.offline { background: #F5F5F5; color: var(--text-muted); }

/* ── Detail Fotografer ── */
.detail-hero { text-align: center; padding: 24px 16px; background: white; border-radius: var(--radius); margin-bottom: 16px; }
.detail-hero .foto-avatar { width: 80px; height: 80px; font-size: 32px; margin: 0 auto 12px; }
.detail-hero h2 { font-size: 20px; font-weight: 700; }
.detail-hero .foto-meta { justify-content: center; margin-top: 8px; }
.detail-portfolio { margin-bottom: 16px; }
.detail-portfolio h3, .detail-packages h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.portfolio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.portfolio-item { aspect-ratio: 1; background: var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 12px; overflow: hidden; }
.portfolio-item svg { width: 32px; height: 32px; opacity: 0.4; }

.package-card { padding: 14px; border: 2px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; cursor: pointer; transition: all 0.2s; }
.package-card.selected { border-color: var(--primary); background: var(--primary-light); }
.package-card h4 { font-weight: 600; font-size: 16px; }
.package-card .price { font-size: 18px; font-weight: 700; color: var(--primary); margin-top: 4px; }
.package-card .desc { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.book-now-btn { margin-top: 16px; padding: 16px; background: var(--primary); color: white; border: none; border-radius: var(--radius-sm); font-size: 17px; font-weight: 600; width: 100%; cursor: pointer; }
.book-now-btn:active { background: var(--primary-dark); }

/* ── Booking Form ── */
.booking-form { background: white; border-radius: var(--radius); padding: 20px; }
.booking-form h3 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.form-row { display: flex; gap: 12px; }
.form-row .field-group { flex: 1; }
.booking-summary { margin-top: 16px; padding: 16px; background: var(--warm-bg); border-radius: var(--radius-sm); }
.booking-summary .row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.booking-summary .row.total { font-weight: 700; font-size: 18px; color: var(--primary); border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }

/* ── Booking Cards ── */
.booking-card { background: white; border-radius: var(--radius); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.booking-card .top { display: flex; justify-content: space-between; align-items: flex-start; }
.booking-card .fotografer-name { font-weight: 600; }
.booking-card .date { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.booking-card .price { font-weight: 600; color: var(--primary); font-size: 15px; }
.status-badge { padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; display: inline-block; }
.status-badge.pending { background: #FFF3E0; color: #E65100; }
.status-badge.confirmed { background: #E3F2FD; color: #1565C0; }
.status-badge.paid { background: #E8F5E9; color: #2E7D32; }
.status-badge.completed { background: #F3E5F5; color: #6A1B9A; }
.status-badge.cancelled { background: #FFEBEE; color: #C62828; }

/* ── Delivery ── */
.delivery-card { background: white; border-radius: var(--radius); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer; }
.delivery-card:active { transform: scale(0.98); }
.delivery-card .top { display: flex; justify-content: space-between; align-items: center; }
.delivery-card h4 { font-weight: 600; font-size: 15px; }
.delivery-card .meta { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--warm-bg); border-radius: var(--radius-sm); margin-bottom: 8px; }
.file-item .icon { width: 40px; height: 40px; border-radius: 8px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; }
.file-item .info { flex: 1; }
.file-item .name { font-weight: 500; font-size: 14px; }
.file-item .size { font-size: 12px; color: var(--text-secondary); }
.download-btn { background: none; border: none; color: var(--primary); cursor: pointer; padding: 4px; }

/* ── Profile ── */
.profile-header { text-align: center; padding: 24px; background: white; border-radius: var(--radius); margin-bottom: 16px; }
.profile-header .avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; margin: 0 auto 12px; }
.profile-header h2 { font-weight: 700; font-size: 20px; }
.profile-header .email { color: var(--text-secondary); font-size: 14px; }
.profile-menu { background: white; border-radius: var(--radius); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--warm-bg); }
.menu-item svg { width: 20px; height: 20px; color: var(--text-secondary); flex-shrink: 0; }
.menu-item span { flex: 1; font-size: 15px; }
.menu-item .chevron { color: var(--text-muted); }

/* ── Loading / Empty States ── */
.loading-state { text-align: center; padding: 48px 16px; color: var(--text-muted); }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 48px 16px; }
.empty-state svg { width: 56px; height: 56px; color: var(--border); margin-bottom: 12px; }
.empty-state p { color: var(--text-secondary); font-size: 15px; }

/* ── Toast ── */
.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px); background: #323232; color: white; padding: 12px 24px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; opacity: 0; transition: all 0.3s; z-index: 200; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Screenshots / Media Grid ── */
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.media-item { aspect-ratio: 1; background: var(--border); border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.media-item img { width: 100%; height: 100%; object-fit: cover; }

/* ── Responsive ── */
@media (min-width: 480px) {
  #auth-screen, #main-screen { max-width: 430px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,0.08); }
  body { background: #e0ddd8; }
}
@media (max-width: 380px) {
  .auth-container { padding: 24px 16px; }
  .header-top h2 { font-size: 20px; }
}

/* ── Online Toggle (Fotografer) ── */
.online-toggle { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: white; border-radius: var(--radius); margin-bottom: 16px; }
.toggle-switch { width: 48px; height: 28px; border-radius: 14px; background: #ddd; position: relative; cursor: pointer; transition: background 0.3s; flex-shrink: 0; }
.toggle-switch.active { background: var(--primary); }
.toggle-switch .knob { width: 24px; height: 24px; border-radius: 50%; background: white; position: absolute; top: 2px; left: 2px; transition: transform 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-switch.active .knob { transform: translateX(20px); }

/* ── Page-specific padding fotografer home ── */
#page-home .page-body { padding-top: 8px; }
