/* ==========================================================================
   ATLAS WEATHER — Design tokens
   Theme: a quiet "instrument panel" — isobar contour lines, mono telemetry
   readouts, sky / sun / aurora accents borrowed from the weather itself.
   ========================================================================== */

:root {
  --bg: #0f1b2d;
  --surface: #16243b;
  --surface-2: #1e3050;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #eaf2fa;
  --text-muted: #9fb3c8;
  --text-faint: #7088a3;

  --sky: #5ec8e0;
  --sky-dim: rgba(94, 200, 224, 0.14);
  --sun: #f2a65a;
  --sun-dim: rgba(242, 166, 90, 0.14);
  --aurora: #4fd1a5;
  --aurora-dim: rgba(79, 209, 165, 0.14);
  --danger: #f2716b;
  --danger-dim: rgba(242, 113, 107, 0.14);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 30px -16px rgba(0, 0, 0, 0.55);

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

/* ==========================================================================
   Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

button,
input {
  font: inherit;
  color: inherit;
}

ul {
  margin: 0;
  padding: 0;
}

::selection {
  background: var(--sky);
  color: #0b1622;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   Base / page texture
   The two corner ring patterns are the "isobar" signature — faint pressure
   contours, like a weather chart, reading at low opacity behind the content.
   ========================================================================== */

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    repeating-radial-gradient(
      circle at 88% -10%,
      transparent 0,
      transparent 38px,
      rgba(94, 200, 224, 0.05) 39px,
      rgba(94, 200, 224, 0.05) 40px
    ),
    repeating-radial-gradient(
      circle at -5% 108%,
      transparent 0,
      transparent 46px,
      rgba(242, 166, 90, 0.04) 47px,
      rgba(242, 166, 90, 0.04) 48px
    );
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--sky);
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

h1 {
  font-size: 2.1rem;
}

h2 {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

p {
  margin: 0 0 12px;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.96rem;
}

b,
strong {
  color: var(--text);
  font-weight: 600;
}

/* ==========================================================================
   Top navigation
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(15, 27, 45, 0.72);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.brand-icon {
  display: flex;
  color: var(--sky);
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
  border-left: 1px solid var(--border-strong);
  padding-left: 8px;
}

.nav-links {
  display: flex;
  gap: 2px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.page-head {
  max-width: 640px;
  margin-bottom: 32px;
}

.page-head .lead {
  font-size: 1rem;
  margin: 0;
}

/* ==========================================================================
   Eyebrow label (small mono metadata tag, reused across pages)
   ========================================================================== */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
}

.eyebrow-sky {
  color: var(--sky);
}

.eyebrow-sky::before {
  background: var(--sky);
  box-shadow: 0 0 0 3px var(--sky-dim);
}

/* ==========================================================================
   Buttons & forms
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 22px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.12s ease,
    background-color 0.15s ease,
    opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-sky {
  background: var(--sky);
  color: #0b1622;
}

.btn-sky:hover {
  background: #79d3e8;
}

.btn-sun {
  background: var(--sun);
  color: #2a1700;
  white-space: nowrap;
}

.btn-sun:hover {
  background: #f5b876;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn:disabled {
  background: var(--surface-2);
  color: var(--text-faint);
  cursor: not-allowed;
  opacity: 1;
}

.btn:disabled:active {
  transform: none;
}

.search-form {
  display: flex;
  gap: 10px;
  max-width: 480px;
  margin: 0 0 8px;
}

.search-form input[type="text"] {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 16px;
  border-radius: var(--radius-md);
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.search-form input::placeholder {
  color: var(--text-faint);
}

.search-form input:focus-visible {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px var(--sky-dim);
  outline: none;
}

.error {
  display: inline-block;
  background: var(--danger-dim);
  border: 1px solid rgba(242, 113, 107, 0.35);
  color: #ffd9d6;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  max-width: 480px;
}

/* ==========================================================================
   Weather result card
   ========================================================================== */

.weather-card {
  position: relative;
  overflow: hidden;
  max-width: 560px;
  margin-top: 28px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.weather-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--sky-dim), transparent 60%);
  pointer-events: none;
}

.weather-card-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.weather-desc {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
}

/* ----- Pro-only deeper detail / Free locked teaser, shown inside weather-card ----- */

.pro-detail {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-strong);
}

.locked-teaser {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-strong);
}

.locked-icon {
  flex-shrink: 0;
  font-size: 1.4rem;
  opacity: 0.85;
}

.locked-title {
  margin: 0 0 2px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
}

.locked-text {
  margin: 0;
  max-width: 320px;
  font-size: 0.82rem;
}

.locked-teaser .btn {
  margin-left: auto;
}

.locked-teaser-stack {
  flex-direction: column;
  align-items: flex-start;
  margin-top: 14px;
  padding-top: 0;
  border-top: none;
}

.locked-teaser-stack .btn {
  width: 100%;
  margin-left: 0;
}

.btn-sm {
  padding: 9px 16px;
  font-size: 0.82rem;
}

/* ----- Quota indicator (search page + dashboard) ----- */

.quota-row {
  max-width: 480px;
  margin-bottom: 18px;
}

.quota-bar {
  height: 6px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.quota-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--sky);
  transition: width 0.3s ease;
}

.quota-text {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.quota-text b {
  color: var(--text);
}

.quota-pro {
  color: var(--aurora);
  font-weight: 500;
}

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--aurora);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--aurora);
  box-shadow: 0 0 0 3px var(--aurora-dim);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.stat-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.stat-label {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text);
}

/* ==========================================================================
   Dashboard / plan card
   ========================================================================== */

.plan-card {
  max-width: 640px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.plan-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.plan-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
  text-transform: capitalize;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 999px;
}

.badge-free {
  background: var(--sun-dim);
  color: var(--sun);
  border: 1px solid rgba(242, 166, 90, 0.3);
}

.badge-pro {
  background: var(--aurora-dim);
  color: var(--aurora);
  border: 1px solid rgba(79, 209, 165, 0.3);
}

.banner {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-md);
}

.banner-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.banner-copy {
  flex: 1;
  min-width: 180px;
}

.banner-title {
  margin: 0 0 2px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.banner-text {
  margin: 0;
  font-size: 0.86rem;
}

.banner .btn {
  align-self: center;
}

.banner-warning {
  background: var(--sun-dim);
  border: 1px solid rgba(242, 166, 90, 0.25);
}

.banner-success {
  background: var(--aurora-dim);
  border: 1px solid rgba(79, 209, 165, 0.25);
}

/* ----- Dashboard: quota + history panels ----- */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
  max-width: 640px;
}

.dash-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.dash-card-note {
  margin: 8px 0 0;
  font-size: 0.84rem;
  color: var(--text-faint);
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
}

.history-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.history-city {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

.history-time {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-faint);
}

.history-temp {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--sky);
}

/* ==========================================================================
   Pricing
   ========================================================================== */

.pricing {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.plan-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.plan-tile-pro {
  border-color: rgba(94, 200, 224, 0.4);
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
}

.plan-tag {
  position: absolute;
  top: -11px;
  left: 24px;
  margin: 0;
  background: var(--sky);
  color: #0b1622;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.plan-tile-head {
  margin-bottom: 4px;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.price-amount {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
}

.price-period {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-faint);
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 22px;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.feature-list li::before {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.feature-list li.ok::before {
  content: "✓";
  background: var(--aurora-dim);
  color: var(--aurora);
}

.feature-list li.no {
  color: var(--text-faint);
}

.feature-list li.no::before {
  content: "–";
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-faint);
}

.plan-tile .btn {
  width: 100%;
  margin-top: auto;
}

.account-status {
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.account-status b {
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 700px) {
  h1 {
    font-size: 1.7rem;
  }

  .pricing {
    grid-template-columns: 1fr;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .banner .btn {
    width: 100%;
  }
}
