:root {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #14203a;
  --surface-strong: #1d2d4e;
  --line: rgba(191, 219, 254, 0.18);
  --text: #f8fbff;
  --muted: #bed0ef;
  --blue: #3b82f6;
  --blue-strong: #2563eb;
  --green: #22c55e;
  --red: #ef4444;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at top right, #1e3a8a 0, transparent 38%), var(--bg);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }

.app-shell { width: min(100%, 620px); min-height: 100vh; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom)); }
.app-header { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand-mark { width: 48px; height: 48px; flex: 0 0 auto; }
.brand-mark img { display: block; width: 100%; height: 100%; }
.app-header h1, .app-header p { margin: 0; }
.app-header h1 { font-size: 1.35rem; letter-spacing: -0.02em; }
.eyebrow { color: #93c5fd; font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.text-button { margin-left: auto; border: 0; color: #bfdbfe; background: transparent; padding: 10px 4px; font-weight: 700; }
.status-message { min-height: 2.7rem; margin: 18px 2px; color: var(--muted); font-size: .95rem; }
.status-message[data-tone="error"] { color: #fecaca; }
.status-message[data-tone="success"] { color: #bbf7d0; }

.card { padding: clamp(24px, 7vw, 36px); border: 1px solid var(--line); border-radius: 26px; background: rgba(20, 32, 58, .88); box-shadow: 0 20px 55px rgba(0, 0, 0, .22); }
.card h2 { margin: 0 0 8px; font-size: clamp(1.55rem, 7vw, 2.15rem); letter-spacing: -0.04em; }
.muted { margin: 0; color: var(--muted); line-height: 1.55; }
.login-card form { display: grid; gap: 16px; margin-top: 24px; }
.identity-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0; border: 0; }
.identity-choice { display: flex; align-items: center; gap: 10px; min-height: 72px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: #101b31; font-weight: 800; }
.identity-choice:has(input:checked) { border-color: #60a5fa; background: #19335d; box-shadow: inset 0 0 0 1px #60a5fa; }
.identity-choice input { position: absolute; opacity: 0; }
.identity-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-weight: 900; }
.dad-icon { background: #1d4ed8; }
.son-icon { background: #15803d; }
.field-label { margin-top: 4px; color: #dbeafe; font-size: .9rem; font-weight: 700; }
input[type="password"] { width: 100%; min-height: 52px; padding: 0 15px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: #0d172a; }
input[type="password"]::placeholder { color: #7890b8; }
.primary-button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 56px; padding: 12px 18px; border: 0; border-radius: 16px; color: white; background: linear-gradient(135deg, var(--blue), var(--blue-strong)); box-shadow: 0 12px 24px rgba(37, 99, 235, .28); font-weight: 850; font-size: 1rem; }
.primary-button:disabled { cursor: wait; opacity: .6; }
.ready-card { text-align: center; padding-top: 44px; padding-bottom: 38px; }
.ready-card .muted { max-width: 410px; margin: 0 auto; }
.call-button { width: 100%; margin-top: 30px; min-height: 64px; font-size: 1.1rem; }
.button-icon { font-size: 1.35rem; }
.privacy-note { margin: 22px 0 0; color: #93c5fd; font-size: .82rem; line-height: 1.45; }

.call-screen { display: grid; gap: 18px; }
.video-stage { position: relative; isolation: isolate; min-height: min(68vh, 580px); overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: #030712; box-shadow: 0 20px 55px rgba(0, 0, 0, .3); }
.remote-video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.remote-placeholder { position: absolute; inset: 0; display: grid; place-content: center; gap: 15px; padding: 30px; text-align: center; color: #c9d8f4; background: radial-gradient(circle at 50% 40%, #1e3a8a, #090f1d 67%); }
.remote-placeholder[hidden] { display: none; }
.waiting-pulse { width: 52px; height: 52px; margin: auto; border: 5px solid rgba(255, 255, 255, .22); border-top-color: var(--green); border-radius: 50%; animation: spin 1.1s linear infinite; }
.remote-placeholder p { margin: 0; font-weight: 700; line-height: 1.4; }
.local-frame { position: absolute; right: 14px; bottom: 14px; z-index: 1; width: clamp(112px, 31vw, 170px); aspect-ratio: 3 / 4; overflow: hidden; border: 2px solid rgba(255, 255, 255, .62); border-radius: 18px; background: #111827; box-shadow: 0 8px 24px rgba(0, 0, 0, .38); }
.local-frame video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.local-label { position: absolute; bottom: 0; left: 0; padding: 5px 9px; color: white; background: rgba(0, 0, 0, .55); font-size: .72rem; font-weight: 800; }
.call-controls { display: flex; justify-content: center; gap: 14px; padding-bottom: 4px; }
.round-button { display: grid; place-items: center; width: 58px; height: 58px; border: 1px solid var(--line); border-radius: 50%; color: white; background: #1e2c47; font-size: 1.35rem; }
.round-button[aria-pressed="true"] { color: #1e293b; background: #e2e8f0; }
.danger-button { background: var(--red); transform: rotate(135deg); }
.no-script { padding: 18px; color: #fecaca; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 380px) { .app-shell { padding-left: 14px; padding-right: 14px; } .card { border-radius: 20px; } }
