/* =====================================================================
   style.css — Gardio design system
   ---------------------------------------------------------------------
   The single stylesheet for the whole site. Brand tokens live in :root;
   everything below is built from them. Loaded once via header.php.

   Palette and feel come straight from the conception doc:
   premium dark fintech — deep navy, electric blue, a sparing gold accent,
   warm white text. Distinctive marks: the gold "o" in the logo, the
   `// EYEBROW` section tags, and the blue gradient on key headline words.
   ===================================================================== */

:root {
  /* --- Color --- */
  --bg:            #090e1a;                      /* deep navy, almost black */
  --bg-2:          #0d1424;                      /* slightly raised surface */
  --accent:        #4f8ef7;                      /* electric blue — primary */
  --accent-2:      #82b3ff;                      /* lighter blue — gradients */
  --gold:          #c9a84c;                      /* used very sparingly */
  --ink:           #f0ede6;                      /* warm white — primary text */
  --muted:         rgba(240, 237, 230, 0.45);    /* secondary text */
  --muted-strong:  rgba(240, 237, 230, 0.70);    /* slightly clearer secondary */

  --card:          rgba(255, 255, 255, 0.03);
  --card-border:   rgba(255, 255, 255, 0.08);
  --card-border-2: rgba(255, 255, 255, 0.16);    /* hover / focus surfaces */

  --danger:        #ff6b6b;
  --danger-bg:     rgba(255, 107, 107, 0.10);
  --danger-border: rgba(255, 107, 107, 0.30);
  --success:       #4ade80;
  --success-bg:    rgba(74, 222, 128, 0.10);
  --success-border:rgba(74, 222, 128, 0.30);
  --info-bg:       rgba(79, 142, 247, 0.12);
  --info-border:   rgba(79, 142, 247, 0.35);

  /* --- Type --- */
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
               monospace;

  /* --- Shape & rhythm --- */
  --radius:    14px;
  --radius-sm: 10px;
  --maxw:        1100px;   /* default content width */
  --maxw-narrow:  440px;   /* auth cards, focused flows */
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

img { max-width: 100%; display: block; }

h1, h2, h3 {
  margin: 0 0 0.5em;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.2rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }

p { margin: 0 0 1rem; }

/* ---------------------------------------------------------------------
   Signature elements
   --------------------------------------------------------------------- */

/* Blue gradient on key headline words: <span class="grad">word</span> */
.grad {
  background: linear-gradient(115deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Section eyebrow: <p class="eyebrow">HOW IT WORKS</p>  ->  // HOW IT WORKS */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}
.eyebrow::before { content: "// "; color: var(--gold); }

/* The wordmark: Gardi<span class="brand__o">o</span> */
.brand {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand__o { color: var(--gold); }

.muted { color: var(--muted); }

/* ---------------------------------------------------------------------
   Layout scaffolding
   --------------------------------------------------------------------- */
.page { flex: 1 0 auto; width: 100%; display: flex; flex-direction: column; }   /* lets the footer sit at the bottom + lets centered flows fill height */

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem);
}
.container--narrow { max-width: var(--maxw-narrow); }

/* Centered column for auth pages / focused flows */
.auth-wrap {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vh, 4rem) 1rem;
}
.auth-wrap .card { width: 100%; max-width: var(--maxw-narrow); }
.auth-foot { margin-top: 1.25rem; font-size: 0.88rem; color: var(--muted); text-align: center; }

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem);
}

/* A heading sized for inside a card (full-page h1 is far too large here).
   Covers both a plain <h1> in a card and an explicit .card-title class. */
.card h1, .card-title { font-size: 1.5rem; margin-bottom: 1.25rem; }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  padding: 0.72rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.2s ease,
              background 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--accent); color: #06101f; }
.btn--primary:hover { filter: brightness(1.08); color: #06101f; }

.btn--ghost { background: transparent; border-color: var(--card-border); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--ink); }

.btn--block { width: 100%; }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.field { margin-bottom: 1rem; }
.field > label,
label.field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted-strong);
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--info-bg);
}
::placeholder { color: var(--muted); }

/* Chrome paints autofilled inputs with its own pale background, ignoring the
   `background` above. This masks it with a dark inset fill so filled inputs
   stay on-theme. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #181d2a inset;
  caret-color: var(--ink);
  transition: background-color 9999s ease 0s;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted-strong) 50%),
    linear-gradient(135deg, var(--muted-strong) 50%, transparent 50%);
  background-position: calc(100% - 20px) 1.1rem, calc(100% - 15px) 1.1rem;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}

/* The open <select> popup is OS-native and defaults to white; its options would
   inherit the light text color above (invisible on white). Chrome on Windows
   honors option backgrounds, so theme the popup dark with readable text. */
select option   { background: #0d1424; color: var(--ink); }
select optgroup { background: #0d1424; color: var(--muted-strong); }

/* ---------------------------------------------------------------------
   Alerts (errors, notices, info banners)
   --------------------------------------------------------------------- */
.alert {
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}
.alert--error   { color: var(--danger);    background: var(--danger-bg);  border-color: var(--danger-border); }
.alert--success { color: var(--success);   background: var(--success-bg); border-color: var(--success-border); }
.alert--info    { color: var(--accent-2);  background: var(--info-bg);    border-color: var(--info-border); }

/* ---------------------------------------------------------------------
   Navbar
   --------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(9, 14, 26, 0.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}
.nav__links { display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 1.4rem); }
.nav__link  { color: var(--muted-strong); font-size: 0.95rem; }
.nav__link:hover { color: var(--ink); }

/* EN / FR toggle */
.lang { display: inline-flex; align-items: center; gap: 0.2rem; font-family: var(--font-mono); font-size: 0.8rem; }
.lang a    { color: var(--muted); padding: 0.15rem 0.45rem; border-radius: 6px; }
.lang a:hover { color: var(--ink); }
.lang a.on { color: #06101f; background: var(--accent); }
.lang span { opacity: 0.4; }

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.footer {
  flex-shrink: 0;
  border-top: 1px solid var(--card-border);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2.5rem);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}
.footer__inner { max-width: var(--maxw); margin: 0 auto; }
.footer__legal { max-width: 780px; margin-bottom: 0.75rem; }
.footer a { color: var(--muted-strong); }
.footer a:hover { color: var(--ink); }
.footer__links { margin: .75rem 0; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; align-items: center; opacity: .85; font-size: .9em; }
.footer__links a { text-decoration: none; }
.footer__links a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------------
   Accessibility floor
   --------------------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.legal { max-width: 760px; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) 0 2.5rem; line-height: 1.7; }
.legal h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: .35rem; }
.legal h2 { font-size: 1.15rem; margin: 2rem 0 .6rem; }
.legal p, .legal li { color: var(--muted-strong); }
.legal a { color: var(--ink); }
.legal__updated { color: var(--muted); font-size: .9em; margin-bottom: 2rem; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: .35rem; }