/* ============================================================
   GoToMorocco — accounts, tracking, modals, WhatsApp styles
   ============================================================ */

/* disable zellij when toggled off */
body.no-zellij .zellij-bg::before,
body.no-zellij .zellij-ribbon,
body.no-zellij .zellij-band,
body.no-zellij .zellij-frame .zc,
body.no-zellij .zellij-divider .star { display: none; }

/* ---------- Header: nav active + account ---------- */
.site-nav a.active { color: var(--accent); }
.site-nav a.active::after {
  content: ""; position: absolute; bottom: -6px; inset-inline-start: 0; right: 0;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: var(--r-md); place-items: center; color: var(--text); }

.acct-menu { position: relative; }
.acct-btn { display: inline-flex; align-items: center; gap: 9px; padding: 5px 12px 5px 6px; border-radius: 999px; border: 1px solid var(--border); transition: border-color .15s; }
.acct-btn:hover { border-color: var(--accent); }
[dir="rtl"] .acct-btn { padding: 5px 6px 5px 12px; }
.acct-av { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 0.78rem; font-weight: 800; }
.acct-name { font-size: 0.9rem; font-weight: 600; }
.acct-drop {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 200px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-2); padding: 6px; z-index: 60; display: flex; flex-direction: column; gap: 2px;
}
.acct-drop button { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 8px; font-size: 0.9rem; color: var(--muted); text-align: start; }
.acct-drop button:hover { background: var(--surface-2); color: var(--text); }

/* mobile menu */
.mobile-menu { display: none; }
.mobile-menu a, .mobile-menu button {
  display: block; width: 100%; text-align: start; padding: 14px 28px;
  border-bottom: 1px solid var(--border-soft); color: var(--muted); font-size: 1rem; font-weight: 500;
}
.mobile-menu a.active { color: var(--accent); }

/* ---------- Generic page section ---------- */
.page-section { min-height: 70vh; }
.wrap.narrow { max-width: 760px; }

/* ---------- WhatsApp widget ---------- */
.wa-widget {
  position: fixed; inset-inline-end: 24px; bottom: 24px; z-index: 120;
  width: 60px; height: 60px; border-radius: 50%;
  background: #25D366; color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 28px oklch(0 0 0 / 0.45); transition: transform .2s;
}
.wa-widget:hover { transform: scale(1.07); }
.wa-pulse { position: absolute; inset: 0; border-radius: 50%; background: #25D366; opacity: 0.5; z-index: -1; animation: waPulse 2.2s ease-out 4; }
@keyframes waPulse { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wa-pulse { animation: none; } }

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 300; background: oklch(0.12 0.01 65 / 0.72);
  backdrop-filter: blur(6px); display: grid; place-items: center; padding: 24px;
  animation: fadeUp .2s ease both;
}
@keyframes fadeUp { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 34px; box-shadow: var(--shadow-2); position: relative;
  max-height: 92vh; overflow-y: auto; overflow-x: hidden;
}
.modal-card.wide { max-width: 560px; }
.modal-close { position: absolute; top: 16px; inset-inline-end: 16px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--border); }
.modal-close:hover { color: var(--text); border-color: var(--accent); }

.auth-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-head h2 { font-size: 2rem; font-weight: 600; }
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-switch { color: var(--muted); font-size: 0.88rem; text-align: center; padding: 4px; }
.auth-switch:hover { color: var(--accent); }
.auth-demo { text-align: center; font-size: 0.78rem; color: var(--faint); background: var(--bg-2); padding: 9px; border-radius: 8px; border: 1px dashed var(--border); }

/* ---------- Signature pad ---------- */
.sig-wrap { position: relative; }
.sig-canvas {
  width: 100%; height: 200px; border-radius: var(--r-md);
  background: repeating-linear-gradient(135deg, oklch(0.2 0.012 65) 0 2px, transparent 2px 12px), var(--bg-2);
  border: 1px solid var(--border); touch-action: none; cursor: crosshair; display: block;
}
.sig-clear { position: absolute; top: 10px; inset-inline-end: 10px; font-size: 0.78rem; font-weight: 600; color: var(--muted); padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.sig-clear:hover { color: var(--text); }

/* ---------- Map picker ---------- */
.map-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.map-tg { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: var(--r-md); border: 1px solid var(--border); font-size: 0.86rem; font-weight: 600; color: var(--muted); transition: all .15s; }
.map-tg .mt-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.map-tg.dep .mt-dot { background: var(--zgreen); }
.map-tg.arr .mt-dot { background: var(--pomegranate); }
.map-tg.on { color: var(--text); border-color: var(--accent); background: var(--surface-2); }
.map-box {
  position: relative; width: 100%; aspect-ratio: 100/130; max-height: 52vh;
  background:
    radial-gradient(120% 90% at 70% 20%, oklch(0.26 0.03 250 / 0.5), transparent),
    var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; cursor: crosshair;
  margin: 0 auto;
}
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-city { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 5px; pointer-events: none; z-index: 2; }
[dir="rtl"] .map-city { transform: translate(50%, -50%); }
.mc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px oklch(0.20 0.02 60 / 0.5); flex: none; }
.mc-name { font-size: 0.66rem; color: var(--muted); white-space: nowrap; text-shadow: 0 1px 3px #000; }
.map-pin { position: absolute; transform: translate(-50%, -100%); z-index: 5; animation: pinDrop .3s cubic-bezier(.2,.8,.3,1.4) both; }
.map-pin.dep { color: var(--zgreen); }
.map-pin.arr { color: var(--pomegranate); }
.map-pin svg { filter: drop-shadow(0 3px 5px oklch(0 0 0 / 0.5)); }
@keyframes pinDrop { from { opacity: 0; transform: translate(-50%, -160%); } to { opacity: 1; transform: translate(-50%, -100%); } }
.map-hint { text-align: center; font-size: 0.8rem; color: var(--faint); margin-top: 12px; }

/* ---------- Status timeline ---------- */
.timeline { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; margin: 4px 0 22px; position: relative; }
.timeline::before { content: ""; position: absolute; top: 14px; inset-inline-start: 6%; width: 88%; height: 2px; background: var(--border); z-index: 0; }
.tl-step { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; position: relative; z-index: 1; }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--border); color: var(--faint); font-size: 0.82rem; font-weight: 700; transition: all .2s; }
.tl-step.done .tl-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tl-step.current .tl-dot { box-shadow: 0 0 0 4px oklch(0.81 0.078 80 / 0.18); }
.tl-lbl { font-size: 0.76rem; color: var(--muted); text-align: center; font-weight: 600; }
.tl-step.done .tl-lbl { color: var(--text); }
.timeline.refused { justify-content: flex-start; }
.timeline.refused::before { display: none; }

/* ---------- Client request view ---------- */
.crv-card { padding: 26px; }
.crv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.crv-id { font-family: var(--font-display); color: var(--faint); letter-spacing: 0.08em; font-size: 0.95rem; }
.crv-svc { font-size: 1.7rem; font-weight: 600; color: var(--text); margin-top: 2px; }
.crv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border-soft); border: 1px solid var(--border-soft); border-radius: var(--r-md); overflow: hidden; margin-bottom: 22px; }
.crv-cell { background: var(--surface); padding: 15px 18px; }
.crv-lbl { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); display: flex; align-items: center; gap: 7px; }
.crv-val { color: var(--text); margin-top: 6px; font-size: 0.94rem; }
.crv-sec { margin-top: 22px; }
.crv-sec h4 { font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }

/* ---------- Quote box ---------- */
.qbox { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; }
.qbox.accepted { border-color: oklch(0.74 0.10 165 / 0.4); }
.qbox.awaiting { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.92rem; }
.qbox-top { display: flex; align-items: center; justify-content: space-between; }
.qbox-lbl { font-size: 0.85rem; color: var(--muted); }
.qbox-amt { font-size: 2rem; color: var(--accent); }
.qbox-accepted { margin-top: 14px; }
.quote-state-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sig-proof { display: flex; align-items: center; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.sig-proof img { width: 130px; height: 64px; object-fit: contain; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.sig-meta { font-size: 0.86rem; }
.payment-box { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.payment-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.pay-method { min-height: 44px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border); color: var(--muted); font-size: 0.82rem; font-weight: 700; background: var(--surface); }
.pay-method.on { border-color: var(--accent); color: var(--text); background: var(--surface-2); }
.payment-hint { color: var(--faint); font-size: 0.78rem; margin-top: 10px; }
.payment-proof { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; align-items: center; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: var(--r-md); background: var(--surface); color: var(--muted); font-size: 0.84rem; }
.payment-proof strong { color: var(--accent); font-family: var(--font-display); letter-spacing: 0.05em; }
.payment-proof span:last-child { grid-column: 1 / -1; color: var(--faint); }

/* ---------- Track + account ---------- */
.track-bar { display: flex; align-items: flex-end; gap: 14px; padding: 20px; }
.track-bar .btn { white-space: nowrap; }
.track-hint, .guest-note { text-align: center; color: var(--muted); font-size: 0.9rem; margin-top: 16px; }
.guest-note { font-size: 0.8rem; color: var(--faint); margin-top: 14px; }
.link-btn { color: var(--accent); font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.empty-note { text-align: center; padding: 40px; color: var(--muted); margin-top: 20px; }
.crv-card { margin-top: 22px; }

.account-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; }
.back-link { display: inline-block; margin-bottom: 16px; }
.acct-reqs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.acct-req { text-align: start; padding: 20px; transition: border-color .15s, transform .15s; }
.acct-req:hover { border-color: var(--accent); transform: translateY(-2px); }
.ar-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ar-svc { font-size: 1.25rem; font-weight: 600; }
.ar-route { color: var(--muted); font-size: 0.88rem; margin-top: 10px; display: flex; align-items: center; gap: 7px; }
.ar-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft); font-size: 0.82rem; }
.ar-id { font-family: var(--font-display); color: var(--faint); letter-spacing: 0.05em; }
.ar-quote { margin-inline-start: auto; color: var(--accent); font-weight: 700; }
.ar-quote.ok { color: var(--st-confirmed); }

.signin-prompt { text-align: center; padding: 48px 30px; margin-top: 20px; }
.signin-prompt h2 { font-size: 2rem; margin: 12px 0 8px; }

.confirm-cta { margin-top: 24px; }
.cta-line { color: var(--muted); margin-bottom: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .admin-link { display: none; }
  .site-nav { gap: 20px; }
}
@media (max-width: 1180px) {
  .site-nav, .acct-login, .admin-link, .book-btn { display: none; }
  .nav-toggle { display: grid; }
  .mobile-menu { display: block; background: var(--surface); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
  .acct-name { display: none; }
}
@media (max-width: 560px) {
  .track-bar { flex-direction: column; align-items: stretch; }
  .crv-grid { grid-template-columns: 1fr; }
  .sig-proof { flex-direction: column; align-items: flex-start; }
  .wa-widget { width: 54px; height: 54px; inset-inline-end: 16px; bottom: 16px; }
  .payment-methods { grid-template-columns: 1fr; }
}
