/* Shared design tokens + a small component kit for the login / register / admin
   pages. Mirrors the palette in kids-core.css so every page looks like one app. */
:root {
  --bg: #fff7ec;
  --bg2: #ffeede;
  --card: #ffffff;
  --ink: #3a3340;
  --muted: #9b94a3;
  --line: #f0e6d8;
  --grape: #7b61ff;
  --grape-d: #6749f5;
  --coral: #ff6f91;
  --sun: #ffc23c;
  --mint: #28c08a;
  --sky: #36b8e8;
  --shadow-sm: 0 2px 6px rgba(90,60,40,.07);
  --shadow: 0 6px 22px rgba(90,60,40,.12);
  --shadow-lg: 0 16px 50px rgba(70,40,90,.22);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -10%, var(--bg2), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, #ffe9f0, transparent 55%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- auth (login / register) ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  width: min(420px, 100%); background: var(--card); border-radius: 28px;
  box-shadow: var(--shadow-lg); border: 2px solid #fff; padding: 2rem 1.8rem 1.9rem;
}
.brand { display: flex; align-items: center; gap: .7rem; justify-content: center; margin-bottom: 1rem; }
.brand .logo { font-size: 2.2rem; line-height: 1; filter: drop-shadow(0 3px 0 rgba(0,0,0,.08)); }
.brand img.logo { width: 2.4rem; height: 2.4rem; border-radius: 12px; object-fit: cover; }
.brand h1 { margin: 0; font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
.auth-card h2 { margin: 0 0 .25rem; font-size: 1.3rem; font-weight: 700; text-align: center; }
.auth-card .sub { margin: 0 0 1.3rem; color: var(--muted); font-weight: 500; font-size: .9rem; text-align: center; }

.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .9rem; font-weight: 600; font-size: .88rem; }
.field input {
  font: inherit; font-weight: 500; padding: .7rem .8rem; border: 2px solid var(--line);
  border-radius: 14px; background: #fff; color: var(--ink); width: 100%;
}
.field input:focus { outline: none; border-color: var(--grape); }

.btn {
  font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer; border: none; color: #fff;
  background: linear-gradient(135deg, var(--grape), var(--coral));
  padding: .8rem 1.2rem; border-radius: 16px; width: 100%;
  box-shadow: 0 10px 24px rgba(123,97,255,.32); transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(123,97,255,.42); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* "Continue with Google" (shown by JS only when the server has OAuth configured) */
.auth-or { display: flex; align-items: center; gap: .8rem; margin: 1rem 0; color: var(--muted); font-size: .8rem; font-weight: 600; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 2px; background: var(--line); border-radius: 2px; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  font: inherit; font-weight: 700; font-size: .98rem; cursor: pointer; text-decoration: none;
  color: var(--ink); background: #fff; border: 2px solid var(--line);
  padding: .72rem 1.2rem; border-radius: 16px; width: 100%; box-sizing: border-box;
  box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s;
}
.auth-or[hidden], .btn-google[hidden] { display: none; }  /* display:flex would beat the hidden attr */
.btn-google:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-google:active { transform: translateY(0); }
.btn-google svg { flex: 0 0 auto; }

.alt { margin: 1.1rem 0 0; text-align: center; font-size: .88rem; color: var(--muted); font-weight: 500; }
.alt a { color: var(--grape-d); font-weight: 700; text-decoration: none; }
.alt a:hover { text-decoration: underline; }
.legal-note { margin-top: .8rem; font-size: .74rem; }
.legal-note a { font-weight: 600; color: var(--muted); text-decoration: underline; }

.error {
  margin: 0 0 .9rem; min-height: 1.2em; font-size: .85rem; font-weight: 600; color: var(--coral);
}
.error:not(:empty) {
  background: #fff0f3; border: 1px solid #ffd9e1; border-radius: 12px; padding: .5rem .7rem;
}

/* ---------- admin ---------- */
.admin-top {
  max-width: 1080px; margin: 0 auto; padding: 2rem 1.25rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.admin-top .brand { margin: 0; }
.back-link {
  font: inherit; font-weight: 600; font-size: .9rem; text-decoration: none;
  color: var(--muted); border: 2px solid var(--line); background: #fff;
  padding: .5rem .9rem; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.back-link:hover { color: var(--ink); border-color: #e6d8c4; }
main.admin { max-width: 1080px; margin: 0 auto; padding: .5rem 1.25rem 4rem; }

.totals { display: flex; gap: .8rem; flex-wrap: wrap; margin: .5rem 0 1.4rem; }
.totals .box { flex: 1; min-width: 150px; background: #fbf7ff; border: 2px solid #ece4ff; border-radius: 16px; padding: .7rem .9rem; }
.totals .box .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.totals .box .val { font-size: 1.5rem; font-weight: 700; }

.table-card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); border: 2px solid #fff; overflow: hidden; }
table.users { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.users th, table.users td { padding: .7rem .8rem; text-align: left; white-space: nowrap; }
table.users thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted);
  font-weight: 700; border-bottom: 2px solid var(--line); background: #fffdf9;
}
table.users tbody tr { border-bottom: 1px solid var(--line); }
table.users tbody tr:last-child { border-bottom: none; }
table.users td.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge-admin { font-size: .7rem; font-weight: 700; color: #5a4300; background: var(--sun); border-radius: 999px; padding: .12rem .55rem; }
.badge-blocked { font-size: .7rem; font-weight: 700; color: #fff; background: var(--coral); border-radius: 999px; padding: .12rem .55rem; }
table.users tr.blocked-row td { opacity: .65; }
table.users td.actions { text-align: right; white-space: nowrap; }
table.users td.actions .imp-btn { margin-left: .4rem; }
.imp-btn.danger { background: linear-gradient(135deg, #ff6f91, #e2483d); }
.imp-btn {
  font: inherit; font-weight: 700; font-size: .82rem; cursor: pointer; border: none; color: #fff;
  background: linear-gradient(135deg, var(--grape), var(--coral)); padding: .4rem .8rem; border-radius: 999px;
}
.imp-btn:hover { filter: brightness(1.05); }
.imp-btn:disabled { opacity: .4; cursor: default; filter: none; }
.muted { color: var(--muted); }
