/* ============================================================
   Flight About Now! (FAN) — modern, BIG-font design.
   Type scale and spacing are intentionally large and airy.
   ============================================================ */
:root {
  /* Color */
  --bg: #f4f6fb;
  --bg-grad-1: #6d5efc;
  --bg-grad-2: #00b3ff;
  --surface: #ffffff;
  --surface-2: #f7f9ff;
  --ink: #15192b;
  --ink-soft: #515873;
  --ink-faint: #8b91a8;
  --line: #e6e9f2;
  --accent: #5b54f0;
  --accent-ink: #4039d6;
  --sky: #00a6e6;
  --good: #11b886;
  --good-bg: #e3f8f0;
  --warn: #f59e0b;
  --danger: #ef4767;
  --shadow: 0 18px 50px -20px rgba(40, 44, 95, 0.35);
  --shadow-sm: 0 6px 20px -10px rgba(40, 44, 95, 0.3);

  /* Type — large by default */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fs-base: 19px;
  --radius: 20px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html { font-size: var(--fs-base); }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(0, 179, 255, 0.12), transparent 60%),
    radial-gradient(1000px 500px at -10% 0%, rgba(109, 94, 252, 0.14), transparent 55%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem clamp(1rem, 4vw, 3rem);
}
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand__logo {
  font-size: 2rem;
  filter: drop-shadow(0 4px 8px rgba(91, 84, 240, 0.4));
}
.brand__name {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.topbar__actions { display: flex; align-items: center; gap: 0.6rem; }
.user-email { color: var(--ink-soft); font-weight: 600; margin-right: 0.4rem; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 4vw, 3rem) 5rem;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0.7em 1.4em;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--primary {
  background: linear-gradient(135deg, var(--bg-grad-1), var(--sky));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { box-shadow: 0 12px 28px -10px rgba(0, 140, 220, 0.6); }
.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { background: var(--surface-2); border-color: #d4d9ea; }
.btn--block { width: 100%; }
.btn--lg { font-size: 1.15rem; padding: 0.75em 1.6em; }
.btn--xl { font-size: 1.3rem; padding: 0.85em 1.8em; }
.btn--danger-ghost { background: transparent; color: var(--danger); border-color: transparent; }
.btn--danger-ghost:hover { background: #fdeaef; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Cards & forms ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 4vw, 2.6rem);
}
.form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field__label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}
.input {
  font-family: inherit;
  font-size: 1.15rem;
  padding: 0.75rem 0.95rem;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(91, 84, 240, 0.16);
  background: #fff;
}
.input--code { text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.1rem; }
.form__error {
  background: #fdeaef; color: #b21e44; font-weight: 600;
  padding: 0.7rem 1rem; border-radius: var(--radius-sm); margin: 0;
}
.form__ok {
  background: var(--good-bg); color: #0a7a59; font-weight: 600;
  padding: 0.7rem 1rem; border-radius: var(--radius-sm); margin: 0;
}

/* ---------- Auth view ---------- */
.auth {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-top: clamp(1rem, 5vw, 4rem);
}
.hero__title {
  font-size: clamp(2.6rem, 5vw, 4rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 1.2rem;
}
.accent {
  background: linear-gradient(120deg, var(--bg-grad-1), var(--sky));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__sub { font-size: 1.3rem; color: var(--ink-soft); max-width: 32ch; }
.auth__card { max-width: 460px; width: 100%; }
.tabs {
  display: flex; gap: 0.4rem; background: var(--surface-2);
  padding: 0.4rem; border-radius: 999px; margin-bottom: 1.6rem;
}
.tab {
  flex: 1; font-family: inherit; font-size: 1.1rem; font-weight: 700;
  border: none; background: transparent; color: var(--ink-soft);
  padding: 0.7rem; border-radius: 999px; cursor: pointer;
}
.tab.is-active { background: #fff; color: var(--accent-ink); box-shadow: var(--shadow-sm); }

/* ---------- Dashboard ---------- */
.dash__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; margin: 1rem 0 2rem;
}
.dash__title { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.dash__sub { color: var(--ink-faint); font-size: 1.05rem; margin: 0.3rem 0 0; }
.dash__head-actions { display: flex; gap: 0.7rem; }

.watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.6rem;
}

/* ---------- Watch card ---------- */
.watch {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem;
  display: flex; flex-direction: column; gap: 1.1rem;
  position: relative;
  border: 2px solid transparent;
}
.watch.is-deal { border-color: var(--good); }
.watch__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.watch__route {
  font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 0.5rem; margin: 0;
}
.watch__route .arrow { color: var(--sky); }
.watch__label { color: var(--ink-faint); font-size: 1rem; font-weight: 600; margin: 0.2rem 0 0; }

.badge {
  font-size: 0.85rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 0.35rem 0.7rem; border-radius: 999px;
  white-space: nowrap;
}
.badge--deal { background: var(--good-bg); color: #0a7a59; }
.badge--watching { background: #eef0fb; color: var(--accent-ink); }
.badge--paused { background: #f0f1f5; color: var(--ink-faint); }

.watch__price-row { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.price-now {
  font-size: 3.1rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1;
}
.price-now.is-deal { color: var(--good); }
.price-now.is-none { font-size: 1.6rem; color: var(--ink-faint); font-weight: 700; }
.price-target { font-size: 1.1rem; color: var(--ink-soft); font-weight: 600; }

.meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; color: var(--ink-soft); font-size: 1.02rem; }
.meta b { color: var(--ink); }

.chart { width: 100%; height: 70px; display: block; }
.chart-empty { color: var(--ink-faint); font-size: 0.95rem; }

.watch__actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: auto; align-items: center; }
.watch__actions .spacer { flex: 1; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 4rem 1rem; }
.empty__emoji { font-size: 4rem; }
.empty__title { font-size: 2rem; font-weight: 800; margin: 0.5rem 0; }
.empty__text { font-size: 1.2rem; color: var(--ink-soft); margin-bottom: 1.6rem; }

/* ---------- Dialog ---------- */
.dialog {
  border: none; border-radius: var(--radius); padding: 0; width: min(640px, 92vw);
  box-shadow: var(--shadow); color: var(--ink); background: var(--surface);
}
.dialog::backdrop { background: rgba(21, 25, 43, 0.55); backdrop-filter: blur(4px); }
.dialog .form { padding: clamp(1.6rem, 4vw, 2.4rem); }
.dialog__title { font-size: 1.9rem; font-weight: 800; margin: 0 0 0.6rem; }
.dialog__lead { color: var(--ink-soft); font-size: 1.08rem; margin: 0 0 0.6rem; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 0.7rem; margin-top: 0.6rem; }
.dialog__actions--spread { justify-content: space-between; align-items: center; }
.dialog__actions--spread > div { display: flex; gap: 0.7rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-weight: 700; font-size: 1.05rem;
  padding: 0.9rem 1.5rem; border-radius: 999px; box-shadow: var(--shadow);
  z-index: 50; max-width: 90vw;
}
.toast.is-error { background: var(--danger); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth__hero { order: -1; }
  .watch-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  :root { --fs-base: 18px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar__actions .btn { padding: 0.6em 1em; }
  .user-email { display: none; }
}

[hidden] { display: none !important; }
