/* Auth additions — reuses brand tokens defined in index.html (:root vars). */

/* Force Cormorant Garamond to render lining (modern) numerals instead of
   its default old-style figures. Without this, "1" renders as a thin
   vertical line that reads like a Roman numeral "I". Applies globally to
   any element using the brand serif. */
* { font-variant-numeric: lining-nums tabular-nums; }
@supports (font-feature-settings: "lnum") {
  * { font-feature-settings: "lnum" 1, "tnum" 1; }
}

/* iOS Safari auto-zooms when focusing any input with font-size < 16px and
   never zooms back out — that's the "logged in and now everything looks
   zoomed" symptom. Force 16px on all form fields, mobile only. Desktop
   stays at its design font-size. */
@media (max-width: 720px) {
  input, textarea, select { font-size: 16px !important; }
}

/* Logged-in nav wrap: greeting trigger + dropdown menu */
.nav-user-wrap {
  display: none;
  align-items: center;
  gap: 8px;
  position: relative;
}
.nav-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 30px;
  padding: 10px 16px;
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  color: var(--text);
  transition: border-color .2s, color .2s, background .2s;
}
.nav-user-trigger:hover { border-color: var(--sage); color: var(--sage); }
.nav-user-trigger[aria-expanded="true"] {
  border-color: var(--sage);
  background: var(--sage-light);
}
.nav-user-greet {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.nav-user-caret {
  font-size: 10px;
  color: var(--muted);
  transition: transform .2s;
}
.nav-user-trigger[aria-expanded="true"] .nav-user-caret {
  transform: rotate(180deg);
  color: var(--sage);
}

.nav-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.1);
  padding: 6px;
  display: none;
  z-index: 50;
  flex-direction: column;
}
.nav-user-menu.open { display: flex; }
.nav-user-menu-item {
  background: none;
  border: none;
  text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-user-menu-item:hover { background: var(--sage-light); color: var(--sage); }

/* Separate Account link in nav (only visible when logged in) */
.nav-account-link {
  background: none;
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  transition: border-color .2s, color .2s;
}
.nav-account-link:hover { border-color: var(--sage); color: var(--sage); }

/* Forgot-password link inside login form */
.modal-forgot-link {
  display: block;
  text-align: right;
  margin: -0.25rem 0 0.75rem;
  font-size: 12px;
  color: var(--sage);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  margin-left: auto;
  font-family: 'Jost', sans-serif;
}
.modal-forgot-link:hover { text-decoration: underline; }

.modal-field-row { display: flex; justify-content: flex-end; margin-bottom: 1rem; }

/* Toast banner */
.hiraya-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--sage);
  color: white;
  padding: 14px 24px;
  border-radius: 12px;
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 12px 36px rgba(0,0,0,0.2);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.hiraya-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.hiraya-toast[data-kind="error"] {
  background: #b04a3a;
}

/* Check-email confirmation view */
.check-email-tips {
  background: var(--sage-light);
  border: 1px solid var(--sage-mid);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font-size: 12px;
  color: var(--text);
  margin: 1.5rem 0;
  line-height: 1.6;
}
.check-email-tips ul { list-style: disc; padding-left: 1.25rem; }
.check-email-tips li { margin-bottom: 2px; }

/* Optional-field hint */
.modal-field label .modal-field-optional {
  text-transform: none;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  font-size: 10px;
  margin-left: 6px;
}

/* ── Booking review + confirmation modals ─────────────────────────────── */
.booking-modal-box {
  max-width: 520px;
}
.br-section {
  margin: 1.25rem 0;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.br-section:last-of-type { border-bottom: none; padding-bottom: 0; }
.br-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sage);
  margin-bottom: 0.75rem;
}
.br-service-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.br-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--sage-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.br-service-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text);
}
.br-date {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.br-customer {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.br-customer strong { color: var(--text); font-weight: 600; }

.br-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  padding: 4px 0;
  color: var(--text);
}
.br-line.br-muted { color: var(--muted); font-style: italic; }
.br-line.br-total {
  font-size: 17px;
  font-weight: 700;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--sage-mid);
}
.br-line.br-total span:last-child { color: var(--sage); }

.br-total-box {
  background: var(--sage-light);
  border: 1.5px solid var(--sage-mid);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}
.br-note {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin-top: 10px;
  line-height: 1.5;
}

.br-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.br-actions .modal-btn,
.br-actions .modal-btn-ghost {
  flex: 1;
  margin-top: 0;
}

.modal-btn-ghost {
  background: white;
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  transition: border-color .2s, color .2s;
}
.modal-btn-ghost:hover { border-color: var(--sage); color: var(--sage); }

.bc-email-note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 1rem;
  line-height: 1.6;
}
.bc-email-note strong { color: var(--text); }

@media (max-width: 540px) {
  .booking-modal-box { padding: 1.75rem 1.5rem; }
  .br-actions { flex-direction: column-reverse; }
  .br-service-name { font-size: 19px; }
}

/* ── Reset-password page layout ──────────────────────────────────────── */
.reset-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1rem 3rem;
  background: var(--cream);
}
.reset-card {
  background: white;
  border-radius: 24px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
}
.reset-card .modal-logo {
  font-family: 'Cinzel', serif;
  letter-spacing: 2px;
  font-size: 16px;
  color: var(--sage);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.reset-back {
  display: inline-block;
  margin-top: 1rem;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.reset-back:hover { color: var(--sage); }

/* Mobile spacing */
@media (max-width: 720px) {
  .nav-user-greet { font-size: 12px; }
  .nav-user-trigger { padding: 10px 22px; min-width: 110px; justify-content: center; }
  .nav-account-link { padding: 8px 14px; font-size: 12px; }
  .hiraya-toast { bottom: 16px; font-size: 13px; padding: 12px 18px; }
}

/* ── Booking form: structured address & saved-address picker ──────────── */
.form-group label .form-optional {
  text-transform: none;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  font-size: 11px;
  margin-left: 4px;
}

.form-group #f-saved-addr {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--sage-mid);
  background: var(--sage-light);
  color: var(--text);
  border-radius: 12px;
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231e4d2b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
.form-group #f-saved-addr:focus { outline: none; border-color: var(--sage); }

/* Locked state — applied when a saved address is selected so the fields
   read as informational rather than editable. */
.form-group input.locked {
  background: var(--sage-light);
  color: var(--muted);
  cursor: not-allowed;
}

.form-check-row {
  flex-direction: row !important;
  align-items: center;
}
.form-check-label {
  display: flex !important;
  align-items: center;
  gap: 10px;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--text) !important;
  cursor: pointer;
}
.form-check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--sage);
  cursor: pointer;
}

/* ── My Account modal (Bookings + Addresses tabs) ─────────────────────── */
.addresses-modal-box {
  max-width: 560px;
}

.account-tabs {
  display: flex;
  gap: 6px;
  background: var(--sage-light);
  border: 1px solid var(--sage-mid);
  border-radius: 999px;
  padding: 4px;
  margin: 1.25rem 0 1rem;
}
.account-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 9px 14px;
  border-radius: 999px;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--sage);
  cursor: pointer;
  transition: background .15s, color .15s;
  letter-spacing: 0.3px;
}
.account-tab:hover:not(.active) { background: rgba(255,255,255,0.5); }
.account-tab.active { background: var(--sage); color: white; }

/* Bookings list */
.bookings-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0 0.5rem;
}
.booking-card {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  background: white;
  transition: border-color .2s;
}
.booking-card.is-upcoming { border-color: var(--sage-mid); background: var(--sage-light); }
.booking-card.is-cancelled { opacity: 0.65; }
.booking-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.booking-card-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
.booking-card-svc {
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.35;
}
.booking-card-addons {
  font-size: 12px;
  color: var(--sage);
  margin-top: 4px;
  line-height: 1.4;
}
.booking-card-total {
  font-size: 13px;
  color: var(--text);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  line-height: 1.4;
}
.booking-card-head .booking-status {
  display: inline-block;
  margin-top: 8px;
  align-self: flex-start;
}
.booking-status {
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
  color: white;
  background: #9aa1a4;
}
.booking-status.pending_review { background: #b08c4a; }
.booking-status.awaiting_quote { background: #b08c4a; }
.booking-status.confirmed { background: var(--sage); }
.booking-status.in_progress { background: #3b82a8; }
.booking-status.completed { background: #6a7d6e; }
.booking-status.cancelled { background: var(--rose); }
.booking-status.no_show { background: var(--rose); }

.booking-card-body {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.booking-card-body > div {
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.booking-card-body > div:last-child { border-bottom: 0; }
.booking-card-body strong { color: var(--text); font-weight: 600; }
.booking-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.booking-card.is-upcoming .booking-card-actions { border-top-color: var(--sage-mid); }
.booking-card-btn {
  background: white;
  border: 1.5px solid var(--border);
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 10px;
  transition: background .15s, border-color .15s, transform .08s;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  -webkit-tap-highlight-color: rgba(30,77,43,0.1);
  touch-action: manipulation;
}
.booking-card-btn:hover { background: #f6f9f6; border-color: var(--sage-mid); }
.booking-card-btn:active { transform: scale(.96); }

/* Larger, more thumb-friendly action buttons on mobile so cleaners can
   tap them on the job without misfiring. Stacks full-width when only
   one action fits per row. */

.addr-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.25rem 0 0.5rem;
}
.addr-card {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  transition: border-color .2s, background .2s;
}
.addr-card:hover { border-color: var(--sage-mid); }
.addr-card.is-default {
  border-color: var(--sage-mid);
  background: var(--sage-light);
}
.addr-card-main { flex: 1; min-width: 0; }
.addr-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.addr-default-badge {
  background: var(--sage);
  color: white;
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 8px;
}
.addr-card-body {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.addr-card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.addr-card-btn {
  background: none;
  border: none;
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--sage);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background .15s;
}
.addr-card-btn:hover { background: var(--sage-light); }
.addr-card-btn.danger { color: var(--rose); }
.addr-card-btn.danger:hover { background: #f6e6e6; }

.addr-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 13px;
}
.addr-empty-icon {
  font-size: 40px;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

/* Two-column row inside the address form (unit + postal) */
.modal-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.modal-field-grid .modal-field { margin-bottom: 1rem; }

@media (max-width: 540px) {
  .addr-card { flex-direction: column; gap: 0.5rem; }
  .addr-card-actions { flex-direction: row; align-self: flex-start; }
  .modal-field-grid { grid-template-columns: 1fr; gap: 0; }
}

/* Cards stay info-only — the only visible action is the "View Booking →"
   detail link. All other action buttons live in the booking-detail popup
   that opens when you click the card or that link. The action buttons stay
   in the DOM so the modal can mirror them; they're just hidden on the card. */
.booking-card .booking-card-actions { display: none !important; }
