@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@600&display=swap');

:root {
  --bg: #f3efe8;
  --surface: rgba(255,255,255,.88);
  --ink: #191713;
  --muted: #716b63;
  --line: #ddd4c8;
  --accent: #8b6c3f;
  --accent-strong: #6d522e;
  --soft: #ece4d7;
  --danger: #9d3939;
  --shadow: 0 18px 45px rgba(45,36,24,.10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(191,166,126,.20), transparent 36%),
    linear-gradient(180deg, #f6f2ec, var(--bg));
  font-family: 'DM Sans', system-ui, sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.invisible { visibility: hidden; }

.shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 80px; }
.panel {
  background: var(--surface);
  border: 1px solid rgba(139,108,63,.16);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.auth-panel { width: min(520px, 100%); margin: 5vh auto 0; padding: 40px; }
.brand, .eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 700; }
h1, h2, h3 { margin-top: 0; }
h1 { font-family: 'Playfair Display', serif; font-size: clamp(34px, 5vw, 56px); line-height: 1.02; margin-bottom: 16px; }
h2 { font-family: 'Playfair Display', serif; font-size: 30px; margin-bottom: 6px; }
h3 { font-size: 18px; margin-bottom: 8px; }
.lead, .preference-block p { color: var(--muted); line-height: 1.6; }

.tabs, .subnav, .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { margin: 28px 0 22px; border-bottom: 1px solid var(--line); }
.tab, .nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px 6px;
  border-bottom: 2px solid transparent;
}
.tab.active, .nav-item.active { color: var(--ink); border-bottom-color: var(--accent); }
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field span { font-size: 13px; font-weight: 600; }
.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: rgba(255,255,255,.82);
  color: var(--ink);
  outline: none;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,108,63,.12); }
.field input:disabled { background: #eeeae4; color: #7a746d; }
.primary, .google, .ghost, .chip, .destination-action, .choice-card {
  border-radius: 14px;
  padding: 12px 16px;
  border: 1px solid transparent;
  transition: .18s ease;
}
.primary { background: var(--ink); color: white; font-weight: 700; }
.primary:hover { transform: translateY(-1px); background: #000; }
.primary:disabled { opacity: .55; cursor: default; transform: none; }
.google { width: 100%; background: white; border-color: var(--line); font-weight: 600; }
.ghost { background: transparent; border-color: var(--line); }
.divider { display:flex; align-items:center; gap:12px; margin:22px 0; color:var(--muted); font-size:12px; }
.divider::before, .divider::after { content:""; height:1px; background:var(--line); flex:1; }
.message { min-height: 20px; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.message.error { color: var(--danger); }
.message.success { color: #356542; }

.signup-success { text-align: center; outline: none; padding-top: 48px; padding-bottom: 44px; }
.signup-success .brand { margin-bottom: 12px; }
.signup-success h1 { margin-bottom: 14px; }
.signup-success .lead { margin-bottom: 6px; }
.success-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent-strong);
  font-size: 28px;
  font-weight: 700;
}
.success-email { margin: 0 0 26px; font-weight: 700; overflow-wrap: anywhere; }
.success-note {
  display: grid;
  gap: 7px;
  text-align: left;
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8f4ee;
}
.success-note span, .success-help { color: var(--muted); line-height: 1.55; }
.success-help { font-size: 13px; margin: 0 0 24px; }
.success-action { width: 100%; }

.topbar { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:24px; }
.topbar h1 { font-size: clamp(34px, 4vw, 50px); margin-top:6px; }
.subnav { margin-bottom: 18px; }
.content-panel { padding: 30px; }
.section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:26px; }
.badge { font-size:12px; background:var(--soft); color:var(--accent-strong); padding:7px 10px; border-radius:999px; }
.grid-form { display:grid; grid-template-columns: 1fr 1fr; gap:18px; }
.grid-form .actions { grid-column:1/-1; }
.actions { display:flex; justify-content:flex-end; margin-top: 8px; }

.preference-block { padding: 24px 0; border-top: 1px solid var(--line); }
.preference-block:first-of-type { border-top: 0; padding-top:0; }
.destination-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:12px; }
.destination-card { padding:16px; background:white; border:1px solid var(--line); border-radius:16px; }
.destination-card strong { display:block; margin-bottom:12px; }
.destination-actions { display:flex; flex-wrap:wrap; gap:7px; }
.destination-action { padding:8px 10px; background:#faf8f4; border-color:var(--line); font-size:12px; }
.destination-action.active, .chip.active, .choice-card.active { background:var(--soft); border-color:var(--accent); color:var(--accent-strong); box-shadow: inset 0 0 0 1px rgba(139,108,63,.08); }
.chip { background:white; border-color:var(--line); }
.wine-picker { margin-top:18px; }
.autocomplete { margin-top:8px; border:1px solid var(--line); border-radius:14px; overflow:hidden; background:white; }
.autocomplete:empty { display:none; }
.auto-item { padding:12px 14px; border-bottom:1px solid var(--line); cursor:pointer; }
.auto-item:last-child { border-bottom:0; }
.auto-item:hover { background:#faf8f4; }
.auto-item small { display:block; color:var(--muted); margin-top:3px; }
.selected-list { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.selected-pill { background:var(--soft); border:1px solid rgba(139,108,63,.2); border-radius:999px; padding:8px 11px; font-size:12px; }
.curation-box { background:#f8f4ee; margin-top:8px; padding:18px; border-radius:16px; border-top:0; }
.switch-row { display:flex; align-items:center; gap:10px; }

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(24,21,16,.58);
  backdrop-filter: blur(8px);
}
.onboarding-card {
  width: min(840px, 100%);
  height: min(760px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 34px;
  border-radius: 28px;
  background: #fbf8f3;
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: 0 30px 80px rgba(20,16,11,.28);
}
.onboarding-topline, .onboarding-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
}
.onboarding-progress { margin-top: 5px; color: var(--muted); font-size: 13px; }
.text-button { border: 0; background: transparent; color: var(--muted); padding: 8px; }
.progress-track { flex: 0 0 auto; height: 5px; margin: 18px 0 24px; border-radius: 999px; background: #e8e0d5; overflow: hidden; }
.progress-track span { display: block; width: 20%; height: 100%; background: var(--accent); transition: width .25s ease; }
.onboarding-step:not(.hidden) { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 8px 12px 0; scrollbar-gutter: stable; }
.onboarding-step h2 { font-size: clamp(30px, 4vw, 46px); margin-bottom: 12px; }
.onboarding-step .lead { max-width: 680px; margin-bottom: 24px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice-card { min-height: 74px; text-align: left; background: white; border-color: var(--line); font-weight: 600; user-select:none; }
.choice-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.choice-card:active { transform: translateY(0); }
.choice-card small { display: block; color: var(--muted); font-weight: 400; margin-top: 4px; }
.onboarding-centered { margin-top: 22px; }
.onboarding-optin { display: block; margin-top: 24px; }
#onboardingMessage { flex: 0 0 auto; }
.onboarding-footer { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); background:#fbf8f3; }
.onboarding-footer .primary { min-width: 132px; }
body.onboarding-open { overflow: hidden; }

@media (max-width: 720px) {
  .shell { width:min(100% - 20px, 1080px); padding-top:20px; }
  .auth-panel, .content-panel { padding:22px; border-radius:18px; }
  .grid-form, .destination-grid, .choice-grid { grid-template-columns:1fr; }
  .topbar { align-items:center; }
  .section-head { align-items: center; }
  .onboarding-overlay { padding: 8px; }
  .onboarding-card { width:100%; height:calc(100dvh - 16px); max-height:calc(100dvh - 16px); padding:20px; border-radius:20px; }
  .onboarding-step h2 { font-size: clamp(28px, 10vw, 38px); }
  .progress-track { margin-bottom:18px; }
  .signup-success { padding-top: 32px; padding-bottom: 30px; }
}


/* Compact auth layout for wide notebooks with limited viewport height. */
@media (min-width: 721px) and (max-height: 900px) {
  .shell {
    padding: 22px 0 34px;
  }

  .auth-panel {
    margin-top: 1.5vh;
    padding: 30px 40px;
  }

  .auth-panel h1 {
    font-size: clamp(38px, 4.2vw, 50px);
    margin-bottom: 12px;
  }

  .auth-panel .lead {
    margin: 0;
    line-height: 1.48;
  }

  .tabs {
    margin: 20px 0 16px;
  }

  .tab {
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .stack {
    gap: 12px;
  }

  .field {
    gap: 5px;
  }

  .field input {
    padding: 11px 13px;
  }

  .primary,
  .google {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .divider {
    margin: 14px 0;
  }

  .message {
    margin-top: 10px;
  }
}

@media (min-width: 721px) and (max-height: 760px) {
  .shell {
    padding-top: 12px;
  }

  .auth-panel {
    margin-top: 0;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .auth-panel h1 {
    font-size: 42px;
  }

  .tabs {
    margin-top: 16px;
    margin-bottom: 12px;
  }
}
