/* Grow Electronics -- shared design system for customer-facing pages
   (the phone setup page and the parent portal). Not used by the staff
   admin, which keeps its own look in style.css -- these are the pages an
   actual customer or parent sees, so they get the real brand treatment:
   the logo, the navy/blue/teal palette, Poppins + Inter. */

:root {
  --navy: #0B1440;
  --navy-deep: #001043;
  --blue: #0456C9;
  --blue-light: #2F7BFF;
  --teal: #09BFD4;
  --teal-dark: #078CA0;
  --bg: #F5F8FC;
  --surface: #ffffff;
  --border: #E2E8F3;
  --border-soft: #EDF1F8;
  --muted: #5B6B85;
  --muted-soft: #8996AC;
  --success: #16A34A;
  --success-bg: #EFFBF3;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --warn: #B45309;
  --warn-bg: #FFFBEB;
  --gradient: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 45%, var(--teal) 100%);
  --shadow-sm: 0 1px 2px rgba(11, 20, 64, 0.05);
  --shadow-md: 0 4px 16px rgba(11, 20, 64, 0.07);
  --shadow-lg: 0 12px 32px rgba(11, 20, 64, 0.10);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: "Poppins", "Inter", sans-serif;
  color: var(--navy-deep);
  letter-spacing: -0.01em;
}

/* ---------- page chrome ---------- */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 22px 20px 0;
  display: flex;
  justify-content: center;
  position: relative;
}

.brand-mark { display: flex; align-items: center; gap: 10px; }
.brand-mark img { height: 30px; width: 30px; display: block; }
.brand-mark .divider { width: 1px; height: 18px; background: var(--border); }
.brand-mark .product-name { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 14px; color: var(--navy); }
.brand-mark .product-name b { color: var(--teal-dark); font-weight: 700; }

.topbar-actions { position: absolute; right: 20px; top: 22px; }

.shell {
  flex: 1;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}
.shell.narrow { max-width: 440px; }

.hero { text-align: center; margin-bottom: 26px; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--teal-dark);
  background: rgba(9, 191, 212, 0.10); padding: 5px 12px; border-radius: 999px;
  margin-bottom: 14px;
}
.hero h1 { font-size: 26px; font-weight: 700; margin: 0 0 8px; line-height: 1.25; }
.hero p.lead { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0; max-width: 480px; margin-inline: auto; }

/* ---------- cards & surfaces ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.panel-info {
  background: linear-gradient(135deg, rgba(4, 86, 201, 0.06), rgba(9, 191, 212, 0.08));
  border: 1px solid rgba(4, 86, 201, 0.14);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 22px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--navy);
}
.panel-info h2 { font-size: 14px; margin: 0 0 8px; color: var(--navy-deep); font-weight: 700; }
.panel-info ul { margin: 6px 0 0; padding-left: 18px; }
.panel-info li { margin-bottom: 6px; }
.panel-info li::marker { color: var(--teal-dark); }

/* ---------- forms ---------- */

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; margin-top: 16px; color: var(--navy); }
label:first-child { margin-top: 0; }

input[type=text], input[type=tel], input[type=email], select, textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
  color: var(--navy);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(47, 123, 255, 0.15);
}
input::placeholder { color: var(--muted-soft); }

.field-hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }

.radio-group { display: flex; gap: 10px; margin-top: 8px; }
.radio-option {
  flex: 1; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; cursor: pointer; font-size: 14px; font-weight: 600; text-align: center;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.radio-option input { margin-right: 6px; accent-color: var(--blue); }
.radio-option.checked { border-color: var(--blue); background: rgba(4, 86, 201, 0.06); color: var(--blue); }

.bundle-option {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-top: 8px; cursor: pointer; font-size: 14px;
  transition: border-color .15s ease, background .15s ease;
}
.bundle-option input { margin-right: 8px; accent-color: var(--blue); }
.bundle-option.checked { border-color: var(--blue); background: rgba(4, 86, 201, 0.06); }
.bundle-option .bundle-name { font-weight: 600; }
.bundle-option .bundle-desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.parent-fields { border-left: 3px solid var(--teal); padding-left: 14px; margin-top: 16px; }

/* ---------- buttons ---------- */

.btn-primary {
  display: block; width: 100%;
  background: var(--gradient);
  color: #fff; border: none;
  padding: 15px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 15.5px; font-family: "Poppins", sans-serif;
  cursor: pointer; text-align: center; text-decoration: none;
  box-shadow: 0 6px 18px rgba(4, 86, 201, 0.22);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn-primary:hover { filter: brightness(1.04); box-shadow: 0 8px 22px rgba(4, 86, 201, 0.28); }
.btn-primary:active { transform: translateY(1px); }
/* NOTE: intentionally no bare `button[type=submit]` rule -- every button
   gets an explicit .btn-primary / .btn-secondary / .btn-danger-outline
   class in the markup. An element-level default here previously beat the
   more-specific-looking single-class rules below on specificity (an
   attribute selector counts the same as a class), which made "Decline"
   and "Sign out" silently render as the primary gradient button. */

.btn-secondary {
  display: block; width: 100%; background: #fff; color: var(--navy);
  border: 1.5px solid var(--border); padding: 13.5px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14.5px; cursor: pointer; text-align: center; text-decoration: none;
}
.btn-secondary:hover { border-color: var(--blue-light); color: var(--blue); }

.btn-danger-outline {
  display: block; width: 100%; background: #fff; color: var(--danger);
  border: 1.5px solid #fecaca; padding: 13.5px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14.5px; cursor: pointer; text-align: center;
}
.btn-danger-outline:hover { background: var(--danger-bg); }

.add-phone {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; background: #fff; color: var(--blue);
  border: 1.5px dashed var(--blue-light); padding: 13px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14.5px; cursor: pointer; margin-top: 4px;
}
.add-phone:hover { background: rgba(4, 86, 201, 0.05); }

/* ---------- feedback ---------- */

.alert-error {
  background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca;
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; margin-bottom: 18px;
}
.badge-status {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 6px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
}
.badge-status.warn { color: var(--warn); background: var(--warn-bg); }
.badge-status.success { color: var(--success); background: var(--success-bg); }

/* ---------- misc components ---------- */

.divider-line { height: 1px; background: var(--border-soft); margin: 20px 0; border: none; }

.fine-print { color: var(--muted); font-size: 12.5px; text-align: center; margin-top: 22px; line-height: 1.6; }
.fine-print a { color: var(--blue); font-weight: 600; text-decoration: none; }
.fine-print a:hover { text-decoration: underline; }

.empty-state { color: var(--muted); font-size: 14px; text-align: center; padding: 36px 20px; }

.back-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 600;
  margin-bottom: 16px;
}
.back-link:hover { color: var(--blue); }

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

/* ---------- phone-setup form blocks ---------- */

.phone-block { position: relative; }
.phone-block + .phone-block { margin-top: 18px; }
.phone-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.phone-header h2 { font-size: 16px; margin: 0; font-weight: 700; }
.remove-phone { background: none; border: none; color: var(--danger); font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px; }

/* ---------- "you're all set" done state ---------- */

.center { text-align: center; }
.done-phone { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border-soft); }
.done-phone:last-child { border-bottom: none; }
.done-phone img { width: 84px; height: 84px; border-radius: 12px; border: 1px solid var(--border); padding: 4px; background: #fff; }
.done-phone .name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.done-phone .qr-hint { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.success-ring {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 16px;
  background: var(--success-bg); display: flex; align-items: center; justify-content: center;
}

/* ---------- parent portal: kid cards, requests, chips ---------- */

.kid-card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 14px; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.kid-card:hover { border-color: var(--blue-light); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kid-name { font-size: 17px; font-weight: 700; margin-bottom: 6px; font-family: "Poppins", sans-serif; }
.kid-meta { color: var(--muted); font-size: 13px; }

.req-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; font-family: "Poppins", sans-serif; }
.req-meta { color: var(--muted); font-size: 13px; margin-bottom: 4px; line-height: 1.5; }
.req-actions { display: flex; gap: 10px; margin-top: 14px; }
.req-actions form { flex: 1; margin: 0; }

.section-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 30px 0 12px; }
.section-label:first-of-type { margin-top: 0; }

.app-list { display: flex; flex-wrap: wrap; gap: 8px; }
.app-chip {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-weight: 500; color: var(--navy);
}

.ask-toggle { margin-top: 14px; border-top: 1px solid var(--border-soft); padding-top: 12px; }
.ask-toggle summary { font-size: 13px; color: var(--blue); font-weight: 600; cursor: pointer; list-style: none; }
.ask-toggle summary::-webkit-details-marker { display: none; }
.ask-toggle summary::before { content: "💬 "; }
.msg-thread { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.msg { padding: 9px 12px; border-radius: 10px; font-size: 13px; background: var(--bg); }
.msg-you { background: rgba(4, 86, 201, 0.07); }
.msg-meta { color: var(--muted); font-size: 11px; margin-bottom: 2px; font-weight: 600; }
.ask-toggle textarea { width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13.5px; font-family: inherit; margin-top: 8px; resize: vertical; min-height: 54px; }
.ask-toggle .btn-primary { width: auto; display: inline-block; padding: 9px 16px; font-size: 13.5px; margin-top: 8px; box-shadow: none; }

.contact-footer { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 13px; text-align: center; }
.contact-footer a { color: var(--blue); font-weight: 600; text-decoration: none; }

@media (max-width: 480px) {
  .shell { padding: 20px 16px 48px; }
  .hero h1 { font-size: 22px; }
  .card { padding: 18px; border-radius: 14px; }
}

/* ---------- app details (auto-pulled from the Play Store) ---------- */

.app-detail {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 10px 0 12px; padding: 12px;
  background: var(--bg); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
}
.app-detail-icon {
  width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
  object-fit: cover; background: #fff; border: 1px solid var(--border);
}
.app-detail-body { min-width: 0; }
.app-rating { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.app-rating .stars {
  position: relative; display: inline-block; font-size: 13px; line-height: 1;
  color: var(--border); font-family: Arial, sans-serif; letter-spacing: 1px;
}
.app-rating .stars::before { content: "\2605\2605\2605\2605\2605"; }
.app-rating .stars::after {
  content: "\2605\2605\2605\2605\2605";
  position: absolute; top: 0; left: 0; overflow: hidden;
  width: var(--pct, 0%); color: #F5A623;
}
.app-rating-num { font-weight: 700; font-size: 13px; color: var(--navy); }
.app-rating-count { color: var(--muted); font-size: 12px; }
.app-detail-summary { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ---------- parent portal: request history (approved / declined) ---------- */

.history-row { padding: 14px 20px; margin-bottom: 10px; }
.badge-status.muted { color: var(--muted); background: var(--border-soft); }

/* ---------- parent portal: App Safety Check (expandable section on the approval card) ---------- */

.sc { margin: 0 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.sc > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 14px; min-height: 44px; }
.sc > summary::-webkit-details-marker, .sc details > summary::-webkit-details-marker { display: none; }
.sc > summary::after { content: "\25BE"; margin-left: auto; color: var(--muted); }
.sc[open] > summary::after { content: "\25B4"; }
.sc-title { font-weight: 700; color: var(--navy); font-size: 14.5px; }
.sc-tag { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.sc-tag-pre { color: var(--warn); background: var(--warn-bg); border: 1px solid #F5D8A8; }
.sc-tag-good { color: var(--success); background: var(--success-bg); border: 1px solid #BBF7D0; }
.sc-teaser { font-size: 12.5px; color: var(--muted); }
.sc-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: #33415C; line-height: 1.5; }
.sc-meta { margin: 0; font-size: 12.5px; color: var(--muted); }
.sc-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-dark); margin-top: 4px; }
.sc-staff { padding: 10px 12px; background: #EEF5FF; border-radius: 8px; }
.sc-flag { padding: 8px 12px; border-radius: 8px; background: var(--danger-bg); color: #991B1B; font-weight: 600; }
.sc-list, .sc-ask { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sc-ask li { padding: 8px 12px; border: 1px dashed var(--border); border-radius: 8px; background: var(--bg); }
.sc-item { border: 1px solid var(--border-soft); border-radius: 8px; }
.sc-item > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; }
.sc-item > summary span:first-child { color: var(--navy); font-weight: 600; }
.sc-item > .sc-quote, .sc-item > .sc-note { margin: 0 12px 10px; }
.sc-src { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.sc-quote { padding: 8px 10px; background: var(--bg); border-radius: 6px; color: var(--navy); overflow-wrap: anywhere; }
.sc-quote-sm { margin: 2px 0 6px; font-size: 12px; }
.sc-note { color: #33415C; }
.sc-risks { display: flex; flex-direction: column; gap: 6px; }
.sc-risk { border-radius: 8px; border: 1px solid transparent; }
.sc-risk > summary { list-style: none; cursor: pointer; padding: 8px 12px; }
.sc-risk > .sc-note, .sc-risk > .sc-quote { margin: 0 12px 10px; }
.sc-check_first { background: #FEF3C7; border-color: #FDE68A; color: #78350F; }
.sc-higher { background: #FEE2E2; border-color: #FECACA; color: #7F1D1D; }
.sc-low { background: #DCFCE7; border-color: #BBF7D0; color: #14532D; }
.sc-grow { padding: 10px 12px; border-radius: 8px; background: #E6F7FA; display: flex; flex-direction: column; gap: 3px; }
.sc-all > summary { cursor: pointer; color: var(--blue); font-weight: 600; list-style: none; padding: 4px 0; }
.sc-allrow { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border-soft); }
.sc-ans { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; height: fit-content; }
.sc-a-yes { background: var(--navy); color: #fff; }
.sc-a-no { border: 1px solid #9AA9B5; color: var(--navy); }
.sc-a-not_stated, .sc-a-possibly { border: 1px dashed #9AA9B5; color: var(--muted); background: var(--bg); }
.sc-disclaimer { margin: 4px 0 0; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border-soft); padding-top: 10px; }

.sc-summary{background:#eef5ff;border:1px solid #cfe0fb;border-radius:10px;padding:12px 14px;margin:10px 0 14px}
.sc-summary-h{font-weight:700;font-size:.95rem;margin-bottom:4px}
.sc-summary p{margin:0;line-height:1.5}
.sc-summary-f{font-size:.78rem;color:#5b6b80;margin-top:6px}
.sc-more{margin:12px 0}.sc-more a{font-weight:600}
.sc-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:8px 0 12px}
.sc-fact{border:1px solid #d7e2ea;border-radius:8px;padding:6px 8px;font-size:.85rem;min-width:0}
.sc-fact span{display:block;color:#5b6b80;font-size:.75rem}.sc-fact b{overflow-wrap:anywhere}
.sc-fact-warn{background:#fffbeb;border-color:#fde68a}.sc-fact-ok{background:#f0fdf4;border-color:#bbf7d0}.sc-fact-unknown b{color:#6b7a86;font-weight:600}
.sc-take{border-radius:10px;padding:10px 12px;margin:8px 0;background:#eef5ff;border:1px solid #cfe0fb}.sc-take-not_recommended{background:#fee2e2;border-color:#fecaca}.sc-take-older_only{background:#fef3c7;border-color:#fde68a}.sc-take-ok_with_settings{background:#f0fdf4;border-color:#bbf7d0}
.sc-concern{font-weight:700;margin:8px 0 6px}.sc-concern-high{color:#b91c1c}.sc-concern-medium{color:#b45309}
.sc-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-bottom:12px}
.sc-tile{border:1px solid #d7e2ea;border-radius:8px;padding:6px 8px;min-width:0;background:#fff}.sc-tile span{display:block;font-size:.75rem;color:#5b6b80}.sc-tile b{display:block}.sc-tile small{display:block;font-size:.72rem;color:#425a6c;overflow-wrap:anywhere}
.sc-tile-high{background:#fef2f2;border-color:#fecaca}.sc-tile-high b{color:#b91c1c}.sc-tile-medium{background:#fffbeb;border-color:#fde68a}.sc-tile-medium b{color:#b45309}.sc-tile-low{background:#f0fdf4;border-color:#bbf7d0}.sc-tile-low b{color:#15803d}.sc-tile-unknown b{color:#6b7a86;font-weight:600}
.sc-tile{position:relative;overflow:hidden;border-radius:12px;padding:10px 10px 9px;box-shadow:0 1px 2px rgba(18,40,63,.05),0 3px 10px rgba(18,40,63,.05)}
.sc-tile::before{content:"";position:absolute;left:0;right:0;top:0;height:3px;background:#cbd5e1}
.sc-tile-high::before{background:#dc2626}.sc-tile-medium::before{background:#f59e0b}.sc-tile-low::before{background:#16a34a}.sc-tile-info::before{background:#0077ad}
.sc-tile b{display:inline-block;margin:3px 0 2px;padding:1px 8px;border-radius:999px;background:#f1f5f9;font-size:.85rem}
.sc-tile-high b{background:#fee2e2}.sc-tile-medium b{background:#fef3c7}.sc-tile-low b{background:#dcfce7}.sc-tile-info b{background:#e0f2fe;color:#075985}
.sc-tile-unknown{border-style:dashed;box-shadow:none;background:#fbfcfd}.sc-tile span{font-weight:700;color:#12283f}
.sc-rep li{border-left:3px solid #dc2626;padding-left:8px}
.sc-top{margin:8px 0;padding:9px 12px;border-radius:10px;background:#fef2f2;border:1px solid #fecaca;color:#b91c1c;font-weight:700}
