/* === Reset & Tokens === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --accent: #f59e0b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* === Nav === */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.logo { font-size: 1.5rem; font-weight: 700; }
.logo.clickable { cursor: pointer; }
.hl { color: var(--primary); }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { text-decoration: none; color: var(--muted); font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--primary); }
.back-btn {
  background: none; border: 1px solid var(--border); padding: .5rem 1rem;
  border-radius: 8px; cursor: pointer; font-size: .9rem; color: var(--muted); transition: all .2s;
}
.back-btn:hover { border-color: var(--primary); color: var(--primary); }

/* === Pages === */
.page { display: none; min-height: calc(100vh - 60px); }
.page.active { display: block; }

/* === Hero === */
.hero { max-width: 900px; margin: 0 auto; padding: 3rem 2rem; text-align: center; }
.hero h1 { font-size: 2.6rem; font-weight: 800; line-height: 1.15; margin-bottom: .75rem; }
.tagline { font-size: 1.15rem; color: var(--muted); margin-bottom: 2.5rem; max-width: 550px; margin-left: auto; margin-right: auto; }
.role-pick h2 { font-size: 1.2rem; color: var(--muted); margin-bottom: 1.25rem; }
.role-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; max-width: 600px; margin: 0 auto; }
.role-card {
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 2rem 1.5rem; cursor: pointer; transition: all .25s; text-align: center;
  font-family: inherit; font-size: inherit; color: inherit;
}
.role-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.role-card:focus-visible { outline: 3px solid var(--primary-light); outline-offset: 2px; }
.role-icon { font-size: 2.5rem; margin-bottom: .75rem; display: block; }
.role-card h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.role-card p { font-size: .9rem; color: var(--muted); }

/* === Shipper Browse Layout === */
.browse-layout { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 60px); }
.filter-panel {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 1.5rem; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto;
}
.filter-panel h3 { font-size: 1.1rem; margin-bottom: 1.25rem; }
.filter-group { margin-bottom: 1rem; }
.filter-group label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .3rem; color: var(--text); }
.filter-group input,
.filter-group select {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 8px;
  font-size: .9rem; font-family: inherit; transition: border-color .2s;
}
.filter-group input:focus,
.filter-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.full-w { width: 100%; }
.secondary-btn {
  background: none; border: 1px solid var(--border); padding: .65rem 1rem; border-radius: 8px;
  font-size: .9rem; cursor: pointer; color: var(--muted); margin-top: .5rem; font-family: inherit;
}
.secondary-btn:hover { border-color: var(--primary); color: var(--primary); }

.listing-area { padding: 2rem; }
.listing-area h2 { margin-bottom: .25rem; }
.listing-subtitle { color: var(--muted); margin-bottom: 1.5rem; }

/* === Mover Listing Cards === */
.mover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.listing-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s;
}
.listing-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.listing-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .75rem; }
.listing-name { font-weight: 700; font-size: 1.05rem; }
.listing-rating { color: var(--accent); font-size: .9rem; }
.listing-route { font-size: .95rem; margin-bottom: .5rem; }
.listing-route .arrow { color: var(--primary); font-weight: 600; margin: 0 .35rem; }
.listing-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.meta-tag {
  background: #f1f5f9; padding: .25rem .6rem; border-radius: 6px; font-size: .8rem; color: var(--muted);
}
.listing-types { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .85rem; }
.type-badge {
  background: #ede9fe; color: var(--primary-dark); padding: .2rem .55rem; border-radius: 5px; font-size: .78rem;
}
.listing-price {
  font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-bottom: .85rem;
}
.listing-price.free { color: var(--success); }
.book-btn {
  background: var(--primary); color: #fff; border: none; padding: .55rem 1.25rem; border-radius: 8px;
  font-size: .9rem; font-weight: 600; cursor: pointer; font-family: inherit; width: 100%; transition: background .2s;
}
.book-btn:hover { background: var(--primary-dark); }
.no-results { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.no-results .icon { font-size: 3rem; margin-bottom: .75rem; }

/* === Booking Modal === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex;
  align-items: center; justify-content: center; z-index: 200;
}
.modal {
  background: var(--surface); border-radius: var(--radius); padding: 2rem;
  max-width: 450px; width: 90%; box-shadow: var(--shadow-lg); position: relative;
}
.modal h3 { margin-bottom: 1rem; }
.modal-close {
  position: absolute; top: .75rem; right: 1rem; background: none; border: none;
  font-size: 1.5rem; cursor: pointer; color: var(--muted);
}
.modal .form-group { margin-bottom: 1rem; }
.modal .form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
.modal .form-group input {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 8px;
  font-size: .9rem; font-family: inherit;
}
.modal .form-group input:focus { outline: none; border-color: var(--primary); }

/* === Mover PNR Form === */
.form-container { max-width: 700px; margin: 0 auto; padding: 2rem; }
.form-container.narrow { max-width: 600px; }
.form-container h2 { font-size: 1.8rem; margin-bottom: .25rem; }
.form-subtitle { color: var(--muted); margin-bottom: 1.5rem; }
.pnr-section { margin-bottom: 1.5rem; }
.pnr-row { display: flex; gap: .75rem; }
.pnr-row input { flex: 1; }
.pnr-status { margin-top: .75rem; font-size: .9rem; }
.pnr-status.success { color: var(--success); }
.pnr-status.error { color: #ef4444; }

/* === Method Tabs === */
.method-tabs {
  display: flex; gap: .5rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--border); padding-bottom: 0;
}
.method-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: .75rem 1rem; font-size: .9rem; font-weight: 600; cursor: pointer;
  color: var(--muted); font-family: inherit; transition: all .2s; margin-bottom: -2px;
}
.method-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.method-tab:hover { color: var(--primary); }

.method-panel { display: none; }
.method-panel.active { display: block; }

/* === Email Forward Box === */
.email-forward-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem; text-align: center;
}
.email-forward-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.email-forward-box h3 { margin-bottom: .5rem; }
.email-forward-box > p { color: var(--muted); margin-bottom: 1rem; }

.email-address-box {
  display: inline-flex; align-items: center; gap: .5rem;
  background: #f1f5f9; border: 2px dashed var(--primary); border-radius: 8px;
  padding: .6rem 1rem; margin-bottom: .5rem;
}
.email-address-box code { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.copy-btn {
  background: var(--primary); color: #fff; border: none; padding: .35rem .75rem;
  border-radius: 6px; font-size: .8rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.copy-btn:hover { background: var(--primary-dark); }
.copy-status { font-size: .85rem; color: var(--success); min-height: 1.25rem; margin-bottom: .75rem; }

.email-steps { text-align: left; margin: 1.25rem auto; max-width: 400px; }
.email-step {
  display: flex; align-items: center; gap: .75rem; padding: .5rem 0;
  font-size: .9rem; color: var(--text);
}
.step-badge {
  width: 24px; height: 24px; background: var(--primary); color: #fff; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
}

.email-trust {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px;
  padding: .6rem 1rem; font-size: .82rem; color: #166534; margin-top: 1rem;
}

fieldset {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem;
  margin-bottom: 1.5rem; background: var(--surface);
}
legend { font-weight: 600; font-size: .95rem; padding: 0 .5rem; color: var(--primary); }
.field-hint { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.form-group { display: flex; flex-direction: column; margin-bottom: .75rem; }
.form-group label { font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
.form-group input,
.form-group select {
  padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 8px;
  font-size: .9rem; font-family: inherit; transition: border-color .2s; background: var(--surface);
}
.form-group input:focus,
.form-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.form-group input[readonly] { background: #f1f5f9; color: var(--text); cursor: default; }

.checkbox-group { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.chip-label {
  display: inline-flex; align-items: center; gap: .35rem;
  background: #f1f5f9; padding: .4rem .75rem; border-radius: 8px; font-size: .88rem; cursor: pointer;
  transition: background .2s; user-select: none;
}
.chip-label:has(input:checked) { background: #ede9fe; color: var(--primary-dark); }
.chip-label input { accent-color: var(--primary); }

.primary-btn {
  display: inline-block; background: var(--primary); color: #fff; border: none;
  padding: .75rem 1.75rem; border-radius: 8px; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: background .2s; font-family: inherit;
}
.primary-btn:hover { background: var(--primary-dark); }
.primary-btn:focus-visible { outline: 3px solid var(--primary-light); outline-offset: 2px; }

/* === Confirmation === */
.confirmation { text-align: center; padding: 3rem 2rem; max-width: 550px; margin: 0 auto; }
.confirm-icon { font-size: 3.5rem; margin-bottom: .75rem; }
.confirmation h2 { margin-bottom: .5rem; }
.confirmation p { color: var(--muted); margin-bottom: 1.5rem; }
.summary-card {
  background: #f1f5f9; border-radius: var(--radius); padding: 1.25rem; text-align: left;
  margin-bottom: 1.5rem; font-size: .9rem; line-height: 1.8;
}

/* === About === */
.about-container { max-width: 800px; margin: 0 auto; padding: 3rem 2rem; text-align: center; }
.about-container h2 { margin-bottom: 2rem; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.step-num {
  width: 36px; height: 36px; background: var(--primary); color: #fff; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: .75rem;
}
.step h3 { font-size: 1rem; margin-bottom: .5rem; }
.step p { font-size: .85rem; color: var(--muted); }

/* === Footer === */
.footer { text-align: center; padding: 1.5rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); }

/* === Responsive === */
@media (max-width: 768px) {
  .browse-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .hero h1 { font-size: 1.8rem; }
  .role-cards { grid-template-columns: 1fr; }
  .mover-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .navbar { padding: .75rem 1rem; }
  .steps { grid-template-columns: 1fr; }
}

/* === WhatsApp Box === */
.whatsapp-box {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius);
  padding: 1.5rem; text-align: center; margin-top: 1.5rem;
}
.whatsapp-box h3 { margin-bottom: .35rem; }
.whatsapp-box p { color: var(--muted); margin-bottom: 1rem; font-size: .9rem; }
.whatsapp-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: #25D366; color: #fff; padding: .7rem 1.5rem; border-radius: 8px;
  text-decoration: none; font-weight: 600; font-size: .95rem; transition: opacity .2s;
}
.whatsapp-btn:hover { opacity: .9; }
.whatsapp-btn svg { flex-shrink: 0; }

/* === OTP Section === */
.otp-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; margin-top: 1.5rem; text-align: center;
}
.otp-section h3 { margin-bottom: .35rem; }
.otp-section > p { color: var(--muted); font-size: .9rem; margin-bottom: 1.25rem; }
.otp-display {
  background: #f8fafc; border: 2px dashed var(--primary); border-radius: var(--radius);
  padding: 1.25rem; display: inline-block;
}
.otp-label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .5rem; text-transform: uppercase; letter-spacing: .05em; }
.otp-code { font-size: 2.5rem; font-weight: 800; letter-spacing: .75rem; color: var(--primary); font-family: 'Courier New', monospace; }
.otp-hint { display: block; font-size: .82rem; color: var(--muted); margin-top: .5rem; }

/* === OTP Entry (Mover side) === */
.otp-entry { margin-top: 1.5rem; text-align: center; }
.otp-inputs { display: flex; justify-content: center; gap: .75rem; margin-bottom: 1rem; }
.otp-input {
  width: 56px; height: 64px; text-align: center; font-size: 1.75rem; font-weight: 700;
  border: 2px solid var(--border); border-radius: 10px; font-family: 'Courier New', monospace;
  transition: border-color .2s; background: var(--surface);
}
.otp-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.otp-error { color: #ef4444; font-size: .9rem; min-height: 1.25rem; margin-bottom: .75rem; }

/* === Payment Summary === */
.payment-summary {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; margin-top: 1.5rem;
}
.payment-summary h3 { margin-bottom: 1rem; }
.payment-rows { margin-bottom: 1rem; }
.payment-row {
  display: flex; justify-content: space-between; padding: .5rem 0;
  font-size: .9rem; border-bottom: 1px solid var(--border);
}
.payment-row.total { font-weight: 700; font-size: 1rem; border-bottom: none; border-top: 2px solid var(--text); padding-top: .75rem; }
.payment-note { font-size: .82rem; color: var(--muted); }

/* === Modal Price Preview === */
.modal-price-preview {
  background: #f8fafc; border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem;
}
.price-line { display: flex; justify-content: space-between; font-size: .85rem; padding: .25rem 0; color: var(--muted); }
.modal-free-badge {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px;
  padding: .6rem 1rem; margin-bottom: 1rem; font-size: .9rem; color: #166534; text-align: center;
}

/* === Listing Actions (Edit/Delete) === */
.listing-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.edit-btn, .delete-btn {
  flex: 1; padding: .5rem; border-radius: 6px; font-size: .85rem; font-weight: 600;
  cursor: pointer; font-family: inherit; border: 1px solid var(--border); transition: all .2s;
}
.edit-btn { background: #f0f9ff; color: #0369a1; }
.edit-btn:hover { background: #e0f2fe; border-color: #0369a1; }
.delete-btn { background: #fef2f2; color: #dc2626; }
.delete-btn:hover { background: #fee2e2; border-color: #dc2626; }
