/* ============================================================
   kf.css — the KidForms kit of parts
   ------------------------------------------------------------
   One shared file that holds every button, box, input and popup
   the site uses. Change a value here and it changes on every page.

   IMPORTANT: this matches how kidforms.co already looks. The values
   below were taken straight off the live signup page, landing page
   and app, so switching a page onto this kit should NOT change how
   it looks to a parent. That is the point: consistency now, and one
   place to make design changes later.

   Structure and naming follow the shadcn convention Lovable uses
   (primary / secondary / outline / ghost / destructive, and the
   background / foreground / muted token pairs), so the two builds
   speak the same language even though the look is ours.

   How to use it on a page:
     <link rel="stylesheet" href="/kf.css?v=3">
   Then delete that page's own copies of these rules. Page-specific
   styles go after the link, not before.
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  /* brand, taken from the live landing and signup pages */
  --blue: #0058e6;
  --blue-dark: #0042ad;
  --blue-soft: #e8f0fe;
  --navy: #0a1530;
  --navy-2: #131f3d;
  --slate: #5a6478;
  --slate-light: #8a93a6;
  --line: #e4e8ef;
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --ink: #0a1530;
  --green: #2e9e5b;
  --green-soft: #e6f4ec;
  --amber: #b07d00;
  --amber-soft: #fff8e1;
  --amber-line: #ffe082;
  --red: #c62828;
  --red-soft: #ffebee;
  --red-line: #fecaca;

  /* shadcn-style aliases so both builds use the same words */
  --background: var(--bg);
  --foreground: var(--ink);
  --card: #ffffff;
  --card-foreground: var(--ink);
  --primary: var(--blue);
  --primary-foreground: #ffffff;
  --secondary: #ffffff;
  --secondary-foreground: var(--slate);
  --muted: var(--bg-soft);
  --muted-foreground: var(--slate);
  --accent: var(--bg-soft);
  --accent-foreground: var(--ink);
  --destructive: var(--red);
  --destructive-foreground: #ffffff;
  --border: var(--line);
  --input: var(--line);
  --ring: var(--blue);

  /* shape */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 9px;
  --radius-lg: 14px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px rgba(10, 21, 48, .04);
  --shadow-card: 0 8px 28px rgba(10, 21, 48, .06);
  --shadow-pop: 0 12px 40px rgba(10, 21, 48, .25);

  --kf-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- 2. Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--kf-font);
  color: var(--ink);
  background: var(--bg-soft);
  line-height: 1.6;
}

a { color: var(--blue); }

h1 { font-size: 26px; font-weight: 800; letter-spacing: -.8px; color: var(--navy); }
h2 { font-size: 20px; font-weight: 800; letter-spacing: -.5px; color: var(--navy); }
h3 { font-size: 16px; font-weight: 700; color: var(--navy); }

.kf-sub { font-size: 14px; color: var(--slate); }
.kf-note { font-size: 12px; color: var(--slate-light); }
.kf-muted { color: var(--slate); }

.kf-wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.kf-wrap-narrow { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 20px; }

/* ---------- 3. Logo ---------- */
.kf-logo {
  font-size: 19px; font-weight: 800; letter-spacing: -.5px;
  display: flex; align-items: center; gap: 9px;
  color: var(--navy); text-decoration: none;
}
.kf-logo-mark {
  width: 28px; height: 28px; background: var(--blue); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.kf-logo-mark i { font-size: 17px; }

/* ---------- 4. Buttons ---------- */
/* Default is the full-width chunky button the signup flow uses. */
.kf-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px;
  border: none; border-radius: var(--radius-md);
  font-family: inherit; font-size: 16px; font-weight: 700; text-decoration: none;
  cursor: pointer; transition: all .15s;
  background: #fff; color: var(--slate); border: 1.5px solid var(--line);
}
.kf-btn:hover { background: var(--bg-soft); }
.kf-btn:active { transform: scale(.99); }
.kf-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.kf-btn:disabled, .kf-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.kf-btn i, .kf-btn svg { font-size: 18px; flex-shrink: 0; pointer-events: none; }

.kf-btn-primary { background: var(--blue); color: #fff; border: none; }
.kf-btn-primary:hover:not(:disabled) { background: var(--blue-dark); }

.kf-btn-outline,
.kf-btn-ghost { background: #fff; color: var(--slate); border: 1.5px solid var(--line); }
.kf-btn-outline:hover, .kf-btn-ghost:hover { background: #fff; border-color: var(--slate-light); }

.kf-btn-danger { background: #fff; color: var(--red); border: 1.5px solid var(--red-line); }
.kf-btn-danger:hover { background: var(--red-soft); }

.kf-btn-link { background: none; border: none; color: var(--blue); width: auto; min-height: 0; padding: 0; font-size: 14px; }
.kf-btn-link:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }

/* Sizes. kf-btn-inline is the landing-page button that sits in a row. */
.kf-btn-inline { display: inline-flex; width: auto; padding: 15px 26px; min-height: 52px; border-radius: var(--radius); font-weight: 600; }
.kf-btn-sm { width: auto; display: inline-flex; padding: 9px 14px; min-height: 0; font-size: 13px; font-weight: 600; border-radius: var(--radius); }
.kf-btn-block { width: 100%; display: flex; }
.kf-btn-row { display: flex; gap: 10px; margin-top: 22px; }

/* ---------- 5. Cards, panels and tiles ---------- */
.kf-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 28px;
}
@media (max-width: 640px) { .kf-card { padding: 18px 14px; } }
.kf-card-title { font-size: 20px; font-weight: 800; letter-spacing: -.5px; color: var(--navy); margin-bottom: 6px; }
.kf-card-desc { font-size: 14px; color: var(--slate); }

/* Flat card, no lift. Used for lists of things. */
.kf-card-flat { box-shadow: none; border-radius: var(--radius-lg); padding: 20px; }

.kf-tile {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: #fff; border: 1px solid #eceff3; border-radius: var(--radius-lg);
  padding: 14px; cursor: pointer; font-family: inherit;
  transition: border-color .15s, background .15s;
}
.kf-tile:hover { border-color: var(--slate-light); }
.kf-tile-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--blue-soft); color: var(--blue);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kf-tile-icon i { font-size: 20px; }
.kf-tile-body { flex: 1; min-width: 0; }
.kf-tile-name { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.kf-tile-meta { display: block; font-size: 13px; color: var(--slate); }

/* ---------- 6. Form rows ---------- */
.kf-field { margin-bottom: 14px; }
.kf-field label, .kf-label {
  display: block; font-size: 12px; font-weight: 700; color: var(--slate);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px;
}
/* Sentence-case label for longer questions where shouty caps read badly. */
.kf-label-plain { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }

.kf-input,
.kf-field input[type="text"], .kf-field input[type="email"], .kf-field input[type="tel"],
.kf-field input[type="date"], .kf-field input[type="password"], .kf-field input[type="number"],
.kf-field select, .kf-field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: #fff;
  font-family: inherit; font-size: 14px; font-weight: 500; color: var(--navy);
  transition: border-color .15s;
}
/* Note for later: bumping this to 16px on phones stops iOS zooming in when a
   parent taps a field. Left at 14px for now so nothing shifts. */
.kf-field textarea, textarea.kf-input { min-height: 72px; line-height: 1.5; }
.kf-input:focus, .kf-field input:focus, .kf-field select:focus, .kf-field textarea:focus {
  outline: none; border-color: var(--blue);
}
.kf-input:disabled { opacity: .6; cursor: not-allowed; }

.kf-row { display: flex; gap: 12px; }
.kf-row > * { flex: 1; min-width: 0; }
@media (max-width: 560px) { .kf-row { flex-direction: column; gap: 0; } }

.kf-check { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 400; cursor: pointer; }
.kf-check input { width: 20px; height: 20px; flex: none; accent-color: var(--blue); }

/* Green tick that sits beside a field we already filled in. */
.kf-field-check {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--green-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kf-field-check i { font-size: 13px; }

input[type="file"].kf-hidden-file { display: none; }

/* ---------- 7. Drop zone ---------- */
.kf-drop {
  position: relative;
  border: 2px dashed var(--line); border-radius: var(--radius);
  background: var(--bg-soft); padding: 32px 16px; text-align: center; cursor: pointer;
  transition: all .2s;
}
.kf-drop:hover { border-color: var(--slate-light); }
.kf-drop.kf-drop-over { background: var(--blue-soft); border-color: var(--blue); }
.kf-drop i { font-size: 26px; color: var(--slate); }

/* ---------- 8. Messages and badges ---------- */
.kf-msg {
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 14px;
}
.kf-msg-good { background: var(--green-soft); border-color: #bfe3cd; color: #2e7d32; }
.kf-msg-warn { background: var(--amber-soft); border-color: var(--amber-line); color: #8d6e00; }
.kf-msg-bad  { background: var(--red-soft);  border-color: var(--red-line);   color: var(--red); }
.kf-msg-info { background: #eef4ff; border-color: #cdddff; color: var(--blue-dark); }

.kf-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  background: var(--blue-soft); color: var(--blue-dark);
}
.kf-badge-good { background: var(--green-soft); color: #2e7d32; }
.kf-badge-outline { background: #fff; color: var(--slate); border: 1px solid var(--line); }

/* ---------- 9. Popups ---------- */
.kf-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10, 21, 48, .5);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.kf-modal.kf-open { display: flex; }
.kf-modal-box {
  background: #fff; border-radius: var(--radius-lg);
  width: 100%; max-width: 600px; max-height: 88vh; overflow: auto;
  padding: 22px; position: relative;
  box-shadow: var(--shadow-pop);
}
.kf-modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none;
  font-size: 24px; line-height: 1; color: var(--slate-light); cursor: pointer;
}
.kf-modal-close:hover { color: var(--slate); }
.kf-modal-title { font-size: 20px; font-weight: 800; letter-spacing: -.5px; color: var(--navy); margin-bottom: 14px; padding-right: 28px; }
.kf-modal-desc { font-size: 14px; color: var(--slate); margin-bottom: 16px; }
.kf-modal-foot { display: flex; gap: 10px; margin-top: 18px; }

/* ---------- 10. Spinner and skeleton ---------- */
.kf-spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 3px solid var(--line); border-top-color: var(--blue);
  border-radius: 50%; animation: kf-spin .8s linear infinite;
}
.kf-spinner-lg { width: 36px; height: 36px; }
@keyframes kf-spin { to { transform: rotate(360deg) } }

.kf-skeleton { background: var(--bg-soft); border-radius: var(--radius); animation: kf-pulse 2s cubic-bezier(.4,0,.6,1) infinite; }
@keyframes kf-pulse { 50% { opacity: .5 } }

/* ---------- 11. Small helpers ---------- */
.kf-stack > * + * { margin-top: 12px; }
.kf-sep { height: 1px; background: var(--line); border: 0; margin: 18px 0; }
.kf-center { text-align: center; }
.kf-hide { display: none !important; }
