/* ============================================================
   TailsAbode Kids — auth / dashboard shared styles
   Separate from the adoption platform. Used by:
   - kids-register.html
   - kids-login.html
   - kids-dashboard.html
   ============================================================ */

:root {
  --kids-amber:   #F59E0B;
  --kids-amber-2: #D97706;
  --kids-pink:    #EC4899;
  --kids-cream:   #FFF7E6;
  --kids-mint:    #ECFDF5;
  --kids-sky:     #E0F2FE;
  --kids-lilac:   #F3E8FF;
}

/* Friendlier headline font for the family-oriented experience */
.h2, .h3, .auth-title, .nav-logo, .dash-title {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif !important;
  letter-spacing: -.02em !important;
}

/* Slim top nav for auth screens (no marketing ribbon) */
.kids-topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.kids-topbar .row {
  max-width: 1180px; margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
}
.kids-topbar a.brand {
  display: inline-flex; align-items: center; gap: .625rem;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  font-weight: 800; font-size: 1.125rem; color: var(--text-1);
  text-decoration: none;
}
.kids-topbar a.brand img {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
}
.kids-topbar .links {
  display: inline-flex; gap: 1.25rem;
  font-size: .875rem; color: var(--text-2);
}
.kids-topbar .links a { color: var(--text-2); text-decoration: none; }
.kids-topbar .links a:hover { color: var(--text-1); }
.kids-topbar .links a.active { color: var(--text-1); font-weight: 600; }

/* AUTH LAYOUT */
.auth-shell {
  min-height: calc(100vh - 65px);
  display: flex; align-items: stretch;
}
.auth-side {
  flex: 1;
  background:
    radial-gradient(900px 600px at 80% 20%, color-mix(in srgb, var(--kids-pink) 18%, transparent) 0%, transparent 60%),
    radial-gradient(900px 600px at 0% 100%, color-mix(in srgb, var(--kids-amber) 18%, transparent) 0%, transparent 60%),
    var(--kids-cream);
  padding: 4rem 3rem;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-end;
  border-right: 1px solid var(--border);
}
.auth-side .pitch {
  max-width: 460px;
  width: 100%;
}
.auth-side h2 {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 1.25rem;
}
.auth-side h2 em {
  font-style: italic; font-weight: 500; color: var(--kids-amber-2);
}
.auth-side p {
  color: var(--text-2); font-size: 1rem; line-height: 1.7;
  margin-bottom: 2rem;
}
.auth-side ul {
  list-style: none; display: flex; flex-direction: column; gap: .875rem;
}
.auth-side ul li {
  display: flex; gap: .75rem; align-items: flex-start;
  font-size: .9375rem; color: var(--text-2);
}
.auth-side ul li svg {
  flex-shrink: 0; width: 20px; height: 20px; color: var(--green);
  margin-top: 2px;
}

.auth-card-wrap {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 1.5rem;
  background: var(--surface);
}
.auth-card {
  width: 100%; max-width: 440px;
}
.auth-card .auth-eyebrow {
  display: inline-block;
  font-size: .6875rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--kids-amber-2);
  background: color-mix(in srgb, var(--kids-amber) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--kids-amber) 30%, transparent);
  padding: .375rem .75rem; border-radius: 99px;
  margin-bottom: 1.25rem;
}
.auth-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: .625rem;
}
.auth-sub {
  color: var(--text-2); font-size: .9375rem; line-height: 1.6;
  margin-bottom: 2rem;
}

/* FORM */
.field { display: flex; flex-direction: column; margin-bottom: 1rem; }
.field label {
  font-size: .8125rem; font-weight: 600; color: var(--text-1);
  margin-bottom: .375rem;
}
.field input, .field select {
  background: var(--surface);
  border: 1px solid var(--border-h);
  border-radius: 10px;
  padding: .75rem .875rem;
  font-size: .9375rem;
  color: var(--text-1);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--kids-amber-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kids-amber) 22%, transparent);
}
.field textarea {
  background: var(--surface);
  border: 1px solid var(--border-h);
  border-radius: 10px;
  padding: .75rem .875rem;
  font-size: .9375rem;
  color: var(--text-1);
  font-family: inherit;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea:focus {
  outline: none;
  border-color: var(--kids-amber-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kids-amber) 22%, transparent);
}
.field .hint {
  font-size: .75rem; color: var(--text-3);
  margin-top: .375rem;
}
.field .err {
  font-size: .75rem; color: #DC2626;
  margin-top: .375rem;
}

.checkbox-row {
  display: flex; gap: .625rem; align-items: flex-start;
  font-size: .8125rem; color: var(--text-2); line-height: 1.5;
  margin-bottom: 1.25rem;
}
.checkbox-row input { margin-top: 3px; }
.checkbox-row a {
  color: var(--kids-amber-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(90deg, var(--kids-amber), var(--kids-amber-2));
  color: #fff;
  font-weight: 700;
  padding: .875rem 1.25rem;
  border: none;
  border-radius: 100px;
  font-size: .9375rem;
  cursor: pointer;
  font-family: inherit;
  transition: transform .15s, filter .15s;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.auth-divider {
  display: flex; align-items: center; gap: .75rem;
  margin: 1.5rem 0;
  font-size: .75rem; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .12em;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.auth-foot {
  text-align: center; font-size: .875rem; color: var(--text-2);
}
.auth-foot a {
  color: var(--kids-amber-2);
  font-weight: 600;
  text-decoration: none;
}
.auth-foot a:hover { text-decoration: underline; }

.demo-banner {
  background: color-mix(in srgb, var(--kids-amber) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--kids-amber) 30%, transparent);
  border-radius: 12px;
  padding: .75rem 1rem;
  font-size: .8125rem; color: var(--text-2);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   Targets the full range from 320px phones to 1920px+ desktops.
   Mobile-first overrides are applied with max-width queries
   because the base styles above are tuned for large screens.
   ============================================================ */

/* >=1440px — wider canvas, more breathing room. */
@media (min-width: 1440px) {
  .dash-page { max-width: 1320px; padding: 3rem 2rem 5rem; }
  .kids-topbar .row { max-width: 1320px; }
  .dash-grid { gap: 1.5rem; }
  .dash-section { padding: 2rem; }
}

/* <=1100px — split auth columns shrink, dashboard slimmer. */
@media (max-width: 1100px) {
  .auth-side { padding: 3rem 2rem; }
  .auth-card-wrap { padding: 2.5rem 1.5rem; }
}

/* <=880px — switch auth to single column, tighten dashboard padding. */
@media (max-width: 880px) {
  .auth-shell { flex-direction: column; min-height: auto; }
  .auth-side {
    padding: 2.25rem 1.5rem 2rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .auth-side .pitch { max-width: 100%; }
  .auth-side h2 { font-size: clamp(1.625rem, 6vw, 2.25rem); }
  .auth-side ul { gap: .625rem; }
  .auth-card-wrap { padding: 2rem 1.25rem 3rem; }
  .dash-page { padding: 1.75rem 1rem 3rem; }
  .dash-head { margin-bottom: 1.75rem; }
  .dash-section { padding: 1.25rem; border-radius: 14px; }
  .dash-section h3 { font-size: 1.125rem; margin-bottom: 1rem; }
}

/* <=640px — phones in landscape / large phones. */
@media (max-width: 640px) {
  .kids-topbar .row { padding: .75rem 1rem; gap: .75rem; }
  .kids-topbar .links { gap: .875rem; font-size: .8125rem; }
  /* Hide the marketing-site link on phones; it stays one tap away from the brand logo. */
  .kids-topbar .links a[href="kids.html"] { display: none; }
  .dash-head { gap: .75rem; margin-bottom: 1.5rem; }
  .dash-title { font-size: clamp(1.375rem, 6vw, 1.75rem); }
  .dash-sub { font-size: .875rem; }
  .dash-grid { gap: .875rem; margin-bottom: 1.5rem; }
  .kpi { padding: 1.125rem 1rem; border-radius: 14px; }
  .kpi .val { font-size: 1.875rem; }
  .dash-cal { gap: .375rem; }
  .dash-cal div { font-size: .6875rem; border-radius: 6px; }
}

/* <=480px — small phones (iPhone SE, Galaxy S, etc). */
@media (max-width: 480px) {
  .kids-topbar a.brand { font-size: 1rem; gap: .5rem; }
  .kids-topbar a.brand img { width: 28px; height: 28px; }
  .kids-topbar .links { gap: .75rem; }
  /* Drop "Marketing site" copy if it ever shows; keep the active page + sign-out only. */
  .auth-side { padding: 1.75rem 1.125rem 1.5rem; }
  .auth-card-wrap { padding: 1.5rem 1.125rem 2.5rem; }
  .auth-card .auth-eyebrow { font-size: .625rem; padding: .25rem .625rem; margin-bottom: 1rem; }
  .auth-title { font-size: clamp(1.5rem, 7vw, 1.875rem); }
  .auth-sub { font-size: .875rem; margin-bottom: 1.5rem; }
  .field { margin-bottom: .875rem; }
  .field input, .field select, .field textarea { padding: .6875rem .75rem; font-size: 1rem; /* 16px to prevent iOS zoom on focus */ }
  .btn-primary { padding: .8125rem 1rem; font-size: .9375rem; }
  .auth-divider { margin: 1.25rem 0; }
  .dash-page { padding: 1.25rem .875rem 2.5rem; }
  .dash-section { padding: 1rem; border-radius: 12px; margin-bottom: 1rem; }
  .kpi { padding: 1rem .875rem; }
  .kpi .val { font-size: 1.625rem; }
  .kpi .lbl { font-size: .625rem; }
  .kpi .sub { font-size: .75rem; }
  /* 28-day calendar — keep cells tappable but compact. */
  .dash-cal { gap: .25rem; }
  .dash-cal div { font-size: .625rem; }
  /* Form rows previously laid out as 2-up grids collapse cleanly. */
  .checkbox-row { font-size: .8125rem; }
}

/* <=360px — ultra-small phones (older Android, narrow viewports). */
@media (max-width: 360px) {
  .kids-topbar .row { padding: .625rem .75rem; }
  .kids-topbar a.brand { font-size: .9375rem; }
  .kids-topbar .links { gap: .625rem; font-size: .75rem; }
  .dash-page { padding: 1rem .625rem 2rem; }
  .dash-section { padding: .875rem .75rem; }
  .kpi { padding: .875rem .75rem; }
  .kpi .val { font-size: 1.5rem; }
  .auth-side { padding: 1.5rem 1rem; }
  .auth-side h2 { font-size: 1.5rem; line-height: 1.15; }
  .auth-side p { font-size: .875rem; margin-bottom: 1.25rem; }
  .auth-card-wrap { padding: 1.25rem 1rem 2rem; }
  .field input, .field select, .field textarea { padding: .625rem .6875rem; }
}

/* Pointer-coarse — bump tap targets to a comfortable 44px on touch. */
@media (pointer: coarse) {
  .btn-primary, .field input, .field select, .field textarea { min-height: 44px; }
  .checkbox-row input[type="checkbox"] { width: 18px; height: 18px; }
}

/* Reduced motion — respect OS preference. */
@media (prefers-reduced-motion: reduce) {
  .btn-primary, .bar > span, .field input, .field select, .field textarea {
    transition: none !important;
  }
  .btn-primary:hover { transform: none; }
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.dash-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 1rem;
  margin-bottom: 2.5rem;
}
.dash-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.1;
}
.dash-sub { color: var(--text-2); font-size: .9375rem; margin-top: .375rem; }

.dash-grid {
  display: grid;
  /* Auto-fits 1 col on phones, 2 on small tablets, 4 on wide screens. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}
.kpi .lbl {
  font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: .5rem;
}
.kpi .val {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  font-weight: 800;
  font-size: 2.25rem;
  line-height: 1;
}
.kpi .sub { font-size: .8125rem; color: var(--text-2); margin-top: .5rem; }
.kpi.ok .val { color: var(--green); }

.dash-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}
.dash-section h3 {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}
.dash-cal {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem;
}
.dash-cal div {
  aspect-ratio: 1/1; border-radius: 8px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; color: var(--text-3);
}
.dash-cal .ok   { background: var(--green); color: #fff; }
.dash-cal .miss { background: color-mix(in srgb, var(--kids-pink) 35%, transparent); color: #fff; }
.dash-cal .future { opacity: .4; }

.empty-state {
  text-align: center; padding: 2.5rem 1rem;
  color: var(--text-2);
}
.empty-state svg { width: 48px; height: 48px; color: var(--text-3); margin-bottom: 1rem; }
