/* =====================================================================
   GEOpetra design system — TERS theme (restrained)
   ---------------------------------------------------------------------
   Brand chrome (nav, wordmark, eyebrow, footer) carries the GEOpetra
   look. The "meat" of the app — analysis cards, tables, forms, results —
   keeps Bootstrap's clean default surfaces and uses the brand palette
   only as ACCENTS (primary buttons, links, active states, focus rings).

   Tokens mirror GEOpetra_website/DESIGN_SYSTEM.md — keep them in sync.
   This file is for the interactive app only; PDF/print templates are
   standalone and intentionally unaffected.
   ===================================================================== */

:root {
  /* ---- Brand tokens (source of truth: DESIGN_SYSTEM.md) ---- */
  /* Earth — primary neutral scale (warm stone/brown) */
  --color-earth-50:  #FAF7F2;
  --color-earth-100: #F2EBE0;
  --color-earth-200: #E2D3C0;
  --color-earth-300: #CBAF8A;
  --color-earth-400: #B08B62;
  --color-earth-500: #8C6D47;
  --color-earth-600: #6E5238;
  --color-earth-700: #52392A;
  --color-earth-800: #3A271D;
  --color-earth-900: #2C1E16;
  --color-earth-950: #1C1612;

  /* Terra — accent / CTA (rust / terracotta) */
  --color-terra-400: #D4754F;
  --color-terra-500: #C05A35;
  --color-terra-600: #A84828;

  /* Stone — supplementary neutral */
  --color-stone-light: #F5F0E8;
  --color-stone-mid:   #D9CEBC;
  --color-stone-dark:  #8A7D6E;

  /* ---- Accent-only Bootstrap retokenization ----
     Recolor just the "primary" channel (buttons, links, .text-primary,
     spinners, etc.) to terracotta. Surfaces, neutrals, borders, body
     text and radii keep Bootstrap's clean defaults. */
  --bs-primary: var(--color-terra-500);
  --bs-primary-rgb: 192, 90, 53;
  --bs-primary-text-emphasis: var(--color-terra-600);

  --bs-link-color: var(--color-terra-500);
  --bs-link-color-rgb: 192, 90, 53;
  --bs-link-hover-color: var(--color-terra-600);
  --bs-link-hover-color-rgb: 168, 72, 40;

  --bs-focus-ring-color: rgba(192, 90, 53, 0.25);

  /* Brand UI font (does not affect surface cleanliness). */
  --bs-body-font-family: "Geist", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bs-font-monospace: "Geist Mono", ui-monospace, SFMono-Regular, Menlo,
    Consolas, "Liberation Mono", monospace;
}

/* Clean, neutral content background — as before. */
body { background-color: #f8f9fa; }

/* =====================================================================
   Brand chrome — navigation (light, sticky, warm) + wordmark.
   ===================================================================== */
.app-navbar {
  background-color: rgba(250, 247, 242, 0.95);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-earth-200);
  min-height: 64px;
}
.app-navbar .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.35rem;
}
.app-navbar .navbar-brand .brand-geo { color: var(--color-terra-500); }
.app-navbar .navbar-brand .brand-petra { color: var(--color-earth-950); }
.app-navbar .nav-link {
  color: var(--color-earth-700);
  font-weight: 500;
}
.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus,
.app-navbar .nav-link.show {
  color: var(--color-terra-500);
}
.app-navbar .navbar-toggler { border-color: var(--color-earth-200); }

/* Eyebrow — signature uppercase, wide-tracked section label. */
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-earth-500);
  margin-bottom: 0.5rem;
}

/* Footer (PE disclaimer band) — warm, low-density chrome. */
.pe-disclaimer {
  font-size: 0.75rem;
  color: var(--color-earth-500);
  border-top: 1px solid var(--color-earth-200);
}

/* =====================================================================
   Accents only — applied over Bootstrap's clean defaults.
   ===================================================================== */

/* Primary call-to-action → terracotta. */
.btn-primary {
  --bs-btn-bg: var(--color-terra-500);
  --bs-btn-border-color: var(--color-terra-500);
  --bs-btn-hover-bg: var(--color-terra-600);
  --bs-btn-hover-border-color: var(--color-terra-600);
  --bs-btn-active-bg: var(--color-terra-600);
  --bs-btn-active-border-color: var(--color-terra-600);
  --bs-btn-disabled-bg: var(--color-terra-500);
  --bs-btn-disabled-border-color: var(--color-terra-500);
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
}
.btn-outline-primary {
  --bs-btn-color: var(--color-terra-500);
  --bs-btn-border-color: var(--color-terra-500);
  --bs-btn-hover-bg: var(--color-terra-500);
  --bs-btn-hover-border-color: var(--color-terra-500);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--color-terra-600);
  --bs-btn-active-border-color: var(--color-terra-600);
  --bs-btn-active-color: #fff;
}
.btn-link {
  --bs-btn-color: var(--color-terra-500);
  --bs-btn-hover-color: var(--color-terra-600);
}

/* Accent text/icons → terracotta. */
.text-primary { color: var(--color-terra-500) !important; }

/* Focus ring → terracotta (over otherwise-default inputs). */
.form-control:focus,
.form-select:focus {
  border-color: var(--color-terra-400);
  box-shadow: 0 0 0 0.2rem rgba(192, 90, 53, 0.18);
}

/* Active selections pick up the accent. */
.list-group { --bs-list-group-active-bg: var(--color-terra-500);
  --bs-list-group-active-border-color: var(--color-terra-500); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--color-terra-500); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--color-terra-500); }
.nav-tabs { --bs-nav-tabs-link-active-color: var(--color-terra-600); }
.nav-tabs .nav-link:hover { color: var(--color-terra-500); }
.progress-bar { background-color: var(--color-terra-500); }

/* Favorite-pinned card highlight → terracotta, not yellow. */
.card.border-warning { border-color: var(--color-terra-500) !important; }

/* Product cards — warm border, soft hover lift (DESIGN_SYSTEM §5 Cards). */
.product-card {
  border-color: var(--color-earth-200);
  transition: box-shadow 0.15s ease-in-out;
}
.product-card:hover { box-shadow: 0 12px 32px rgba(58, 39, 29, 0.10); }
.product-card .card-footer {
  background-color: transparent;
  border-top: 1px solid var(--color-earth-100);
}

/* Product-card icon tile: 48px rounded earth-100 tile, terra stroke icon
   (DESIGN_SYSTEM §5 "Cards"). Used on the product picker. */
.product-icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 0.75rem;
  background-color: var(--color-earth-100);
  color: var(--color-terra-500);
  font-size: 1.5rem;
  line-height: 1;
}

/* The limitation/assumption callout uses the accent rule. */
.limitation-warning { border-left: 4px solid var(--color-terra-500); }

/* =====================================================================
   Auth / entrance pages (sign in, sign up, password reset, MFA challenge)
   — full brand treatment: petoskey-tile background, hex badge logo,
   centered white card.
   ===================================================================== */
body.auth-body {
  background-color: var(--color-earth-50);
  background-image: url("../brand/bg-petoskey-tile-subtle.a3cb98aa8f0c.svg");
  background-size: 420px auto;
}
.auth-shell { max-width: 430px; padding: 1.5rem 0 3rem; }
.auth-logo {
  width: 110px;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(58, 39, 29, 0.18));
}
.auth-card {
  background: #fff;
  border: 1px solid var(--color-earth-200);
  border-radius: 1rem;
  box-shadow: 0 12px 32px rgba(58, 39, 29, 0.10);
}
/* allauth form action rows: inline buttons on manage pages, full-width
   stacked buttons inside the entrance card. */
.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.auth-card .auth-actions { display: grid; }

/* allauth renders widgets without Bootstrap classes; style bare inputs
   inside allauth forms to match .form-control. */
.allauth-fields input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]),
.allauth-fields select,
.allauth-fields textarea {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  background-clip: padding-box;
  border: var(--bs-border-width) solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.allauth-fields input:not([type="checkbox"]):not([type="radio"]):focus,
.allauth-fields select:focus,
.allauth-fields textarea:focus {
  border-color: var(--color-terra-400);
  box-shadow: 0 0 0 0.2rem rgba(192, 90, 53, 0.18);
  outline: 0;
}
/* Native checkboxes/radios pick up the brand accent. */
input[type="checkbox"],
input[type="radio"] { accent-color: var(--color-terra-500); }
/* Bootstrap hardcodes blue for checked .form-check-input — rebrand it. */
.form-check-input:checked {
  background-color: var(--color-terra-500);
  border-color: var(--color-terra-500);
}
.form-check-input:focus {
  border-color: var(--color-terra-400);
  box-shadow: 0 0 0 0.2rem rgba(192, 90, 53, 0.18);
}

/* Account settings nav — shared across Profile / Plan / Email /
   Password / Two-Factor (partials/account_nav.html). */
.account-nav { font-size: 0.9rem; }
.account-nav .nav-link {
  color: var(--color-earth-700);
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  white-space: nowrap;
}
.account-nav .nav-link:hover { color: var(--color-terra-500); }
.account-nav .nav-link.active { color: #fff; }

/* Manage-card header h1s come from allauth's h1 element (h4-sized). */
.account-manage-card h1 { color: var(--color-earth-950); }
.account-panel .card-header { background-color: var(--color-earth-100); }
