/* ============================================================
   Minoo Brow Bar — Client PWA styles
   Soft, warm, mobile-first
   ============================================================ */
:root {
  --bg:         #faf3ee;
  --surface:    #ffffff;
  --surface-2:  #f5ebe5;
  --border:     #e6d5cb;
  --ink:        #3a2e2a;
  --text:       #3a2e2a;
  --text-soft:  #6b5a5a;
  --text-mute:  #998881;
  --rose:       #b76e79;
  --rose-2:     #a85966;
  --rose-soft:  #e9c4c1;
  --gold:       #c9a87a;
  --green:      #4caf75;
  --red:        #c8455a;
  --font:       'Montserrat', system-ui, sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--rose); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select {
  font-family: inherit;
  font-size: 16px; /* prevents iOS zoom */
}

/* ---------- Auth ---------- */
body.auth-page {
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse at top, rgba(183, 110, 121, 0.10), transparent 60%),
    var(--bg);
  padding: 1rem;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  box-shadow: 0 24px 60px rgba(183, 110, 121, 0.10);
}
.auth-brand { text-align: center; margin-bottom: 1.6rem; }
.auth-brand .logo-mark {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--gold));
  display: inline-grid; place-items: center;
  font-family: var(--font-serif); font-style: italic; font-size: 38px;
  color: #fff;
  margin-bottom: 1rem;
  box-shadow: 0 8px 22px rgba(183, 110, 121, 0.30);
}
.auth-brand h1 {
  font-family: var(--font-serif);
  font-size: 1.8rem; font-weight: 500;
  margin: 0 0 0.2rem; letter-spacing: 0.02em;
}
.auth-brand .sub {
  color: var(--text-mute);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.auth-card label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 1rem 0 0.4rem;
}
.auth-card input {
  width: 100%;
  padding: 0.95rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border 0.15s, background 0.15s;
}
.auth-card input:focus {
  border-color: var(--rose);
  background: #fff;
}
.btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--rose), var(--rose-2));
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  margin-top: 1.4rem;
  box-shadow: 0 6px 18px rgba(183, 110, 121, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(183, 110, 121, 0.32); }
.btn:disabled { opacity: 0.6; transform: none; }
.btn.btn-ghost {
  background: transparent;
  color: var(--rose);
  box-shadow: none;
  border: 1px solid var(--border);
}
.btn.btn-block { width: 100%; }
.err {
  display: none;
  background: rgba(200, 69, 90, 0.10);
  color: var(--red);
  border: 1px solid rgba(200, 69, 90, 0.20);
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.86rem;
}
.err.show { display: block; }

/* ---------- App shell (mobile-first) ---------- */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
.app-header {
  background: linear-gradient(135deg, var(--rose), var(--rose-2));
  color: #fff;
  padding: calc(1.2rem + env(safe-area-inset-top)) 1.4rem 1.4rem;
  position: relative;
}
.app-header h1 {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.7rem;
  font-weight: 500;
  margin: 0;
}
.app-header .greeting { font-size: 0.78rem; opacity: 0.85; letter-spacing: 0.06em; text-transform: uppercase; }
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: 0.7rem;
}
.tier-badge .icon { font-size: 0.95rem; }

.view {
  padding: 1.4rem 1.2rem;
  flex: 1;
}
.card {
  background: var(--surface);
  border-radius: 14px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(180, 130, 130, 0.06);
}
.card h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 500;
  margin: 0 0 0.6rem 0;
  color: var(--ink);
}
.card h3 { font-size: 0.95rem; margin: 0 0 0.3rem 0; color: var(--ink); }
.muted { color: var(--text-mute); font-size: 0.85rem; }

/* Appointment cards */
.appt {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  position: relative;
}
.appt .date {
  background: linear-gradient(135deg, var(--rose-soft), var(--rose));
  color: #fff;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  text-align: center;
  min-width: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.appt .date .day  { font-size: 1.6rem; font-weight: 600; line-height: 1; }
.appt .date .mon  { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.9; }
.appt .body { flex: 1; min-width: 0; }
.appt .body .service { font-weight: 600; color: var(--ink); }
.appt .body .meta { font-size: 0.82rem; color: var(--text-soft); margin-top: 0.25rem; }
.appt .status-chip {
  font-size: 0.72rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  display: inline-block;
  margin-top: 0.35rem;
}
.appt .status-chip.upcoming { background: rgba(76,175,117,0.16); color: var(--green); }
.appt .status-chip.past     { background: rgba(154,140,135,0.20); color: var(--text-soft); }
.appt .status-chip.today    { background: rgba(201,168,122,0.20); color: var(--gold); }

.empty {
  text-align: center;
  padding: 2.5rem 1.2rem;
  color: var(--text-mute);
}
.empty .em {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--rose);
  margin-bottom: 0.5rem;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0.4rem 0 calc(0.4rem + env(safe-area-inset-bottom));
  z-index: 50;
}
.nav-item {
  background: transparent;
  border: 0;
  color: var(--text-mute);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.3rem;
  transition: color 0.15s;
}
.nav-item .ico { font-size: 1.3rem; }
.nav-item.active { color: var(--rose); }

.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 0.8rem 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  outline: none;
}
.field input:focus { border-color: var(--rose); }

/* Toggle row for notification settings */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .label { flex: 1; }
.toggle-row .label strong { display: block; color: var(--ink); }
.toggle-row .label .desc { font-size: 0.82rem; color: var(--text-mute); margin-top: 0.15rem; }
.toggle {
  position: relative;
  width: 48px; height: 28px;
  border-radius: 14px;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.toggle.on { background: var(--rose); }
.toggle.on::after { transform: translateX(20px); }

/* Install prompt button */
.install-prompt {
  background: linear-gradient(135deg, var(--rose-soft), var(--rose));
  color: #fff;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.install-prompt .text {
  flex: 1;
  font-size: 0.85rem;
}
.install-prompt button {
  background: #fff;
  color: var(--rose-2);
  border: 0;
  padding: 0.55rem 0.95rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}
.stat {
  background: var(--surface);
  border-radius: 10px;
  padding: 0.9rem 0.6rem;
  text-align: center;
}
.stat .val {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--ink);
  line-height: 1.1;
}
.stat .lbl {
  font-size: 0.7rem;
  color: var(--text-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.3rem;
}

/* tier-specific colors */
.tier-vip      { background: linear-gradient(135deg, #e0a3ad, #c46a76); }
.tier-platinum { background: linear-gradient(135deg, #b8c8d6, #7f97b0); }
.tier-gold     { background: linear-gradient(135deg, #d4b889, #9c8050); }
.tier-silver   { background: linear-gradient(135deg, #c0c4cd, #878a92); }

/* ============================================================
   Client PWA responsive layer (small Android → iPad Pro)
   ============================================================ */

/* Universal: prevent iOS auto-zoom on focus; enforce min font-size */
input, textarea, select { font-size: 16px; }

/* Safe-area edges everywhere */
body, body.auth-page {
  padding-left:  env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Small phones (≤359px — iPhone SE 1st gen, older Android) */
@media (max-width: 359px) {
  .app-header h1 { font-size: 1.4rem; }
  .stats-row .val { font-size: 1.2rem; }
  .stats-row .lbl { font-size: 0.62rem; }
  .nav-item { font-size: 0.62rem; }
  .nav-item .ico { font-size: 1.15rem; }
  .appt .date { min-width: 54px; padding: 0.4rem 0.5rem; }
  .appt .date .day { font-size: 1.3rem; }
  .card { padding: 1rem; }
}

/* Big phones (414-540) — iPhone Pro Max, Pixel XL, Galaxy Ultra */
@media (min-width: 414px) and (max-width: 540px) {
  .view { padding: 1.5rem 1.4rem; }
  .stats-row { gap: 0.7rem; }
}

/* Tablets (≥720): cap content width, center the app shell */
@media (min-width: 720px) {
  .app-shell { max-width: 680px; margin: 0 auto; background: var(--surface); box-shadow: 0 0 80px rgba(183, 110, 121, 0.10); min-height: 100vh; }
  .app-header { border-radius: 0 0 16px 16px; }
  .bottom-nav {
    max-width: 680px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
  }
  .auth-card { width: 460px; }
}

/* iPad Pro / desktop: even wider */
@media (min-width: 1024px) {
  .app-shell { max-width: 780px; }
  .bottom-nav { max-width: 780px; }
  .view { padding: 1.6rem 1.6rem; }
}

/* Landscape phones — make sticky bottom nav less tall */
@media (max-height: 500px) and (orientation: landscape) {
  .app-header { padding: 0.7rem 1.4rem 0.9rem; }
  .app-header h1 { font-size: 1.3rem; margin: 0; }
  .greeting, .tier-badge { display: none; }
  .bottom-nav { padding: 0.2rem 0 calc(0.2rem + env(safe-area-inset-bottom)); }
  .nav-item span:last-child { display: none; }
  .nav-item { padding: 0.4rem 0.2rem; }
}

/* Touch targets ≥ 44×44, sharp focus rings */
.btn { min-height: 44px; }
.nav-item, .quick-reply, .toggle { min-height: 44px; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Long bios on policy cards: comfortable reading width */
.policy-card { max-width: 640px; margin: 0 auto; }

/* Allow horizontal scrolling on any wide chip strips */
.tier-badge { white-space: nowrap; }

/* Hide scrollbars on horizontally-scrolling lists */
.quick-replies::-webkit-scrollbar,
.appts::-webkit-scrollbar { display: none; }
