/* ============================================================================
   Facile brand system — "Grove" direction. Single source of truth.
   Sprout mark + Sora typeface + blue system. Served same-origin so it loads
   under the app CSP (style-src 'self'; font-src 'self'). Values are final —
   from the brand handoff (tokens.css / README).
   ========================================================================== */

/* --- Type: Sora, self-hosted variable font (weights 400–800) -------------- */
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/sora.woff2') format('woff2');
}

/* --- Design tokens -------------------------------------------------------- */
:root {
  --facile-primary:        #064FF9;
  --facile-primary-700:    #0538B8;
  --facile-primary-bright: #2F74FF;
  --facile-sky:            #38BDF8;
  --facile-blue-deep:      #0A2A9E;
  --facile-navy:           #0A0F29;
  --facile-navy-line:      #39415F;
  --facile-gray:           #6B7280;
  --facile-gray-light:     #F3F5F7;
  --facile-white:          #FFFFFF;
  --facile-tint:           #EAF1FF;
  --facile-sky-text:       #7FB0FF;
  --facile-border:         #E7EAF2;
  --facile-border-strong:  #E1E5EF;
  --facile-stem-light:     #E6EDFF;
  --facile-success:        #0A9E5B;
  --facile-danger:         #EF4444;

  --facile-gradient:      linear-gradient(150deg, #38BDF8, #064FF9 52%, #0A2A9E);
  --facile-gradient-band: linear-gradient(135deg, #064FF9, #0A2A9E);
  --facile-gradient-text: linear-gradient(135deg, #38BDF8, #064FF9);

  --facile-font: 'Sora', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --facile-r-button: 20px;
  --facile-r-input:  20px;
  --facile-r-chip:   13px;
  --facile-r-card:   20px;

  --facile-sh-card:      0 12px 34px -14px rgba(0, 0, 0, .32);
  --facile-sh-window:    0 34px 64px -24px rgba(10, 15, 41, .40);
  --facile-sh-icon-glow: 0 24px 44px -16px rgba(6, 79, 249, .55);

  --facile-container: 1160px;
}

/* --- Logo: the sprout mark ------------------------------------------------
   Markup (brand, light bg):
     <span class="sprout"><svg viewBox="0 0 48 54" width="42" height="47" ...>
       <path class="leaf-l" d="M24 30 C13 30 7 21 8 10 C20 11 26 20 24 30 Z"/>
       <path class="leaf-r" d="M24 24 C35 24 41 15 40 4 C28 5 22 14 24 24 Z"/>
       <path class="stem" d="M24 45 C23 37 23 28 24 20" fill="none" stroke-width="3.6" stroke-linecap="round"/>
     </svg></span>
   Fills come from these classes so treatment = a class on .sprout. */
.sprout { display: inline-block; line-height: 0; flex: none; }
.sprout svg { display: block; overflow: visible; }
/* brand — light backgrounds (default) */
.sprout .leaf-l { fill: var(--facile-primary); }
.sprout .leaf-r { fill: var(--facile-sky); }
.sprout .stem   { stroke: var(--facile-navy); }
/* brandDark — navy / dark backgrounds (keeps the stem visible) */
.sprout.on-dark .leaf-l { fill: var(--facile-primary-bright); }
.sprout.on-dark .leaf-r { fill: var(--facile-sky); }
.sprout.on-dark .stem   { stroke: var(--facile-stem-light); }
/* white — inside the gradient app-icon tile */
.sprout.on-tile .leaf-l { fill: rgba(255,255,255,.62); }
.sprout.on-tile .leaf-r { fill: #fff; }
.sprout.on-tile .stem   { stroke: #fff; }

/* --- Wordmark + tagline --------------------------------------------------- */
.wordmark {
  font-family: var(--facile-font);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-size: 26px;
  color: var(--facile-navy);
}
.wordmark.on-dark { color: var(--facile-white); }
.wordmark.wm-lg { font-size: 32px; }
.wordmark.wm-sm { font-size: 18px; }
/* Public shell contexts */
.pub-header .wordmark { font-size: 30px; }
.pub-foot .wordmark { font-size: 18px; }
.tagline {
  font-family: var(--facile-font);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 13px;
  line-height: 1;
  color: #6B7280;
}
.tagline.on-dark { color: rgba(255, 255, 255, 0.55); }

/* Horizontal lockup: mark + wordmark side by side. The sprout viewBox carries a
   little whitespace on its right, so the optical gap runs a touch wider than the
   value — keep it tight. */
.lockup { display: inline-flex; align-items: center; gap: 3px; }

/* App-icon tile: white sprout on the primary gradient. */
.app-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--facile-gradient);
  border-radius: 30%;
  box-shadow: var(--facile-sh-icon-glow);
}

/* --- Surfaces + gradients ------------------------------------------------- */
.card {
  background: var(--facile-white);
  border: 1px solid var(--facile-border);
  border-radius: var(--facile-r-card);
  box-shadow: 0 12px 34px -18px rgba(10, 15, 41, .22);
}
.gradient-band { background-image: var(--facile-gradient-band); }
.gradient-text {
  background-image: var(--facile-gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Controls ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--facile-font);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  padding: 13px 22px;
  border: none;
  border-radius: var(--facile-r-button);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, filter .15s ease, transform .15s ease;
}
.btn-primary { color: #fff; background: var(--facile-primary); }
.btn-primary:hover { background: var(--facile-primary-700); }
.btn-ghost { color: var(--facile-navy); background: #fff; border: 1px solid var(--facile-border); }
.btn-ghost:hover { background: var(--facile-gray-light); }
.btn:disabled { opacity: .6; cursor: default; }

/* --- Shared public-page shell (auth / onboarding / billing pages) --------- */
.pub-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--facile-font);
  color: var(--facile-navy);
  background: radial-gradient(1100px 520px at 50% -8%, #EAF1FF 0%, #F3F5F7 55%);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
.pub-header { padding: 34px 18px 6px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pub-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 22px 18px 44px; }
.pub-foot { background: var(--facile-navy); padding: 24px 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pub-foot .foot-note { color: rgba(255,255,255,.5); font-size: 12px; }
.pub-card {
  width: 100%;
  max-width: 440px;
  background: var(--facile-white);
  border: 1px solid var(--facile-border);
  border-radius: var(--facile-r-card);
  box-shadow: var(--facile-sh-card);
  padding: 34px 28px;
}
.pub-lead { text-align: center; margin-bottom: 20px; }
.pub-lead h1 { font-family: var(--facile-font); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; font-size: 23px; }
.pub-lead p { margin: 0; color: var(--facile-gray); font-size: 14px; line-height: 1.55; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #3a4255; }
.field input {
  width: 100%; padding: 11px 12px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--facile-border); border-radius: var(--facile-r-input);
  background: var(--facile-gray-light); color: var(--facile-navy);
}
.field input:focus { outline: none; border-color: var(--facile-primary); box-shadow: 0 0 0 3px rgba(6,79,249,.16); background: #fff; }
.field .hint { font-size: 12px; color: var(--facile-gray); margin-top: 5px; }
.btn-block { width: 100%; }
.msg { font-size: 13px; margin-top: 12px; text-align: center; min-height: 18px; }
.msg.err { color: var(--facile-danger); }
.linkrow { text-align: center; margin-top: 16px; font-size: 13px; color: var(--facile-gray); }
.linkrow a { color: var(--facile-primary); text-decoration: none; font-weight: 600; }
.linkrow a:hover { text-decoration: underline; }
.hidden { display: none !important; }
