:root {
    --family-bg: #080a2a;
    --family-navy: #0b0c35;
    --family-panel: #111442;
    --family-panel-2: #17164c;
    --family-purple: #7125df;
    --family-purple-soft: #9b6cff;
    --family-cyan: #08c7f4;
    --family-yellow: #ffd640;
    --family-orange: #ffae3d;
    --family-green: #5be46c;
    --family-white: #f9f8ff;
    --family-muted: #a8abd0;
    --family-border: rgba(140, 128, 222, .26);
    --family-shadow: 0 24px 70px rgba(2, 3, 25, .38);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--family-bg); }
body { min-height: 100vh; margin: 0; color: var(--family-white); font-family: "Nunito", system-ui, sans-serif; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.family-login-page {
    overflow-x: hidden;
    background:
        radial-gradient(circle at 30% 40%, rgba(113, 37, 223, .23), transparent 34rem),
        linear-gradient(115deg, #211152 0%, #0c0d35 60%, #070925 100%);
}

.family-login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 65%) minmax(390px, 35%); }
.family-login-story { position: relative; min-height: 760px; padding: 52px 5.5vw 40px; overflow: hidden; border-right: 1px solid rgba(118, 107, 202, .2); }
.family-login-story::before { content: ""; position: absolute; inset: 0; opacity: .14; background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px); background-size: 42px 42px; pointer-events: none; }
.family-brand-row { position: relative; z-index: 2; display: flex; align-items: center; gap: 22px; }
.family-logo { width: 115px; height: auto; display: block; }
.family-brand-divider { width: 1px; height: 28px; background: rgba(255,255,255,.28); }
.family-brand-label { font: 700 12px/1 "Nunito", sans-serif; letter-spacing: .14em; }
.family-story-copy { position: relative; z-index: 2; max-width: 610px; margin-top: 70px; }
.family-eyebrow { display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px; border: 1px solid rgba(8, 199, 244, .38); border-radius: 999px; color: var(--family-cyan); background: rgba(29, 68, 152, .24); font: 800 12px/1 "Nunito", sans-serif; letter-spacing: .12em; }
.family-eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--family-yellow); box-shadow: 0 0 14px rgba(255, 214, 64, .85); }
.family-eyebrow-soft { color: #c8aaff; border-color: rgba(176, 124, 255, .4); background: rgba(77, 39, 145, .25); }
.family-story-copy h1 { margin: 20px 0 14px; font: 700 clamp(45px, 4.1vw, 76px)/.98 "Fredoka", sans-serif; letter-spacing: -.035em; }
.family-story-copy h1 em { color: var(--family-yellow); font-style: normal; }
.family-story-copy p { max-width: 580px; margin: 0; color: #d3d3e9; font-size: clamp(17px, 1.2vw, 21px); font-weight: 700; line-height: 1.5; }

.family-robot-stage { position: absolute; z-index: 1; width: 380px; height: 300px; right: 12%; bottom: 126px; display: grid; place-items: center; }
.family-robot-stage::after { content: ""; position: absolute; z-index: -2; width: 330px; height: 120px; bottom: 15px; border-radius: 50%; background: rgba(26, 139, 255, .22); filter: blur(30px); }
.family-robot { width: 235px; max-height: 285px; object-fit: contain; filter: drop-shadow(0 22px 25px rgba(3,4,38,.48)); animation: family-float 4.8s ease-in-out infinite; }
.family-orbit { position: absolute; z-index: -1; border: 1px solid rgba(56, 198, 255, .18); border-radius: 50%; transform: rotate(-12deg); }
.family-orbit-one { width: 360px; height: 170px; }
.family-orbit-two { width: 285px; height: 280px; border-color: rgba(146, 91, 255, .19); }
@keyframes family-float { 50% { transform: translateY(-10px) rotate(1deg); } }

.family-value-strip { position: absolute; z-index: 2; left: 5.5vw; right: 5vw; bottom: 38px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.family-value-strip div { min-height: 68px; padding: 14px 18px; border: 1px solid var(--family-border); border-radius: 17px; background: rgba(8, 9, 42, .52); backdrop-filter: blur(14px); }
.family-value-strip b, .family-value-strip span { display: block; }
.family-value-strip b { color: var(--family-cyan); font: 700 14px "Fredoka", sans-serif; }
.family-value-strip div:nth-child(2) b { color: var(--family-yellow); }
.family-value-strip div:nth-child(3) b { color: var(--family-green); }
.family-value-strip span { margin-top: 4px; color: #c3c5df; font-size: 12px; }

.family-login-panel { display: grid; place-items: center; padding: 42px clamp(28px, 4vw, 72px); background: rgba(3, 5, 30, .5); }
.family-login-card { width: min(100%, 445px); }
.family-access-icon { display: block; width: 68px; height: 68px; padding: 8px; object-fit: contain; border: 1px solid rgba(8,199,244,.35); border-radius: 20px; background: linear-gradient(145deg, rgba(113,37,223,.34), rgba(8,199,244,.12)); }
.family-login-card .family-eyebrow { margin-top: 12px; }
.family-login-card h2 { margin: 22px 0 4px; font: 700 42px/1.1 "Fredoka", sans-serif; }
.family-login-intro { margin: 0 0 26px; color: var(--family-muted); font-size: 15px; font-weight: 700; }
.family-alert, .family-setup-note { margin: 0 0 20px; padding: 14px 16px; border-radius: 14px; font-size: 14px; }
.family-alert { border: 1px solid rgba(255, 159, 108, .35); color: #ffd5c0; background: rgba(137, 49, 45, .24); }
.family-setup-note { display: grid; gap: 3px; border: 1px solid rgba(255,214,64,.35); color: #fff4bd; background: rgba(110, 85, 20, .23); }
.family-setup-note span { color: #d7d0ac; }
.family-login-form { display: grid; gap: 10px; }
.family-login-form label { margin-top: 5px; font-size: 13px; font-weight: 800; }
.family-login-form > input, .family-password-field input { width: 100%; height: 57px; padding: 0 18px; border: 2px solid transparent; border-radius: 15px; outline: none; color: #151634; background: #eef4ff; transition: border-color .18s, box-shadow .18s; }
.family-login-form input:focus { border-color: var(--family-cyan); box-shadow: 0 0 0 5px rgba(8,199,244,.13); }
.family-password-field { position: relative; }
.family-password-field input { padding-right: 65px; }
.family-password-field button { position: absolute; top: 0; right: 7px; height: 57px; padding: 0 12px; border: 0; color: #008fca; background: transparent; font-weight: 800; }
.family-primary-button { height: 60px; margin-top: 10px; padding: 0 22px; display: flex; align-items: center; justify-content: center; gap: 13px; border: 0; border-radius: 17px; color: #27204f; background: linear-gradient(105deg, var(--family-yellow), #ffaf45); box-shadow: 0 12px 26px rgba(255, 180, 56, .2); font: 700 16px "Fredoka", sans-serif; transition: transform .18s, box-shadow .18s; }
.family-primary-button:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(255,180,56,.28); }
.family-primary-button:disabled, .family-login-form input:disabled { cursor: not-allowed; opacity: .55; }
.family-primary-button b { font-size: 22px; }
.family-help { margin: 26px 0 22px; padding-top: 23px; border-top: 1px solid var(--family-border); color: var(--family-muted); text-align: center; font-size: 13px; }
.family-help span { display: block; margin-top: 3px; color: #d5d6e9; font-weight: 700; }
.family-secure-note { color: #72779f; text-align: center; font-size: 11px; }

/* Aplicación interna */
.family-app-page { background: #090b2d; }
.family-app-header { position: sticky; z-index: 20; top: 0; min-height: 78px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--family-border); background: rgba(8, 10, 42, .9); backdrop-filter: blur(18px); }
.family-app-brand { display: flex; align-items: center; gap: 16px; }
.family-app-brand img { width: 90px; }
.family-app-brand span { padding-left: 16px; border-left: 1px solid rgba(255,255,255,.24); color: var(--family-cyan); font-size: 11px; font-weight: 900; letter-spacing: .18em; }
.family-header-actions { display: flex; align-items: center; gap: 12px; }
.family-child-switcher { display: flex; align-items: center; gap: 9px; }
.family-child-switcher label { color: var(--family-muted); font-size: 12px; font-weight: 800; }
.family-child-switcher select { height: 40px; min-width: 150px; padding: 0 35px 0 13px; border: 1px solid var(--family-border); border-radius: 12px; color: white; background: #161846; }
.family-current-child { display: flex; align-items: center; gap: 8px; }
.family-current-child span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #25164e; background: var(--family-cyan); font: 700 16px "Fredoka", sans-serif; }
.family-current-child b { font-size: 13px; }
.family-install-button, .family-logout { height: 38px; padding: 0 14px; border-radius: 11px; font-size: 12px; font-weight: 800; }
.family-install-button { border: 1px solid rgba(255,214,64,.5); color: #fff2a5; background: rgba(255,214,64,.1); }
.family-logout { border: 1px solid var(--family-border); color: var(--family-muted); background: transparent; }

.family-app-layout { display: grid; grid-template-columns: 225px minmax(0, 1fr); min-height: calc(100vh - 78px); }
.family-side-nav { position: sticky; top: 78px; height: calc(100vh - 78px); padding: 28px 18px; display: flex; flex-direction: column; gap: 7px; border-right: 1px solid var(--family-border); background: #0d0f35; }
.family-side-nav > a, .family-side-nav > span { position: relative; min-height: 48px; padding: 0 13px; display: flex; align-items: center; gap: 12px; border-radius: 13px; color: #9297bd; font-size: 13px; font-weight: 800; }
.family-side-nav > a > span, .family-side-nav > span > span { width: 23px; color: #737aa8; font-size: 18px; text-align: center; }
.family-side-nav > a.active { color: white; background: linear-gradient(110deg, rgba(113,37,223,.5), rgba(38,26,106,.35)); }
.family-side-nav > a.active::before { content: ""; position: absolute; width: 4px; height: 22px; left: -18px; border-radius: 0 8px 8px 0; background: var(--family-cyan); box-shadow: 0 0 15px rgba(8,199,244,.55); }
.family-side-nav small { display: none; }
.family-side-nav > span { cursor: default; opacity: .58; }
.family-side-support { margin-top: auto; padding: 18px 14px; border: 1px solid var(--family-border); border-radius: 18px; background: linear-gradient(145deg, rgba(113,37,223,.17), rgba(8,199,244,.05)); }
.family-side-support img { width: 64px; height: 68px; object-fit: contain; float: right; margin: -12px -4px 4px 5px; }
.family-side-support b { font: 600 13px "Fredoka", sans-serif; }
.family-side-support p { clear: both; margin: 8px 0 0; color: #8e93bb; font-size: 11px; line-height: 1.45; }
.family-dashboard { width: 100%; max-width: 1450px; margin: 0 auto; padding: 30px clamp(24px, 3vw, 48px) 52px; }

.family-welcome-card { position: relative; min-height: 242px; padding: 34px 290px 32px 38px; display: flex; align-items: center; gap: 38px; overflow: hidden; border: 1px solid rgba(131,86,225,.38); border-radius: 25px; background: radial-gradient(circle at 75% 50%, rgba(8,199,244,.16), transparent 21rem), linear-gradient(120deg, #21105a, #111440 75%); box-shadow: var(--family-shadow); }
.family-welcome-card::after { content: ""; position: absolute; width: 410px; height: 410px; right: -180px; top: -195px; border: 1px solid rgba(8,199,244,.18); border-radius: 50%; box-shadow: 0 0 0 45px rgba(113,37,223,.05), 0 0 0 90px rgba(8,199,244,.035); }
.family-welcome-card > div:first-child { position: relative; z-index: 2; flex: 1; }
.family-welcome-card h1 { margin: 14px 0 4px; font: 700 clamp(32px, 3vw, 46px) "Fredoka", sans-serif; }
.family-welcome-card p { max-width: 560px; margin: 0; color: #c1c3de; line-height: 1.5; }
.family-welcome-card p strong { color: white; }
.family-summary-pills { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.family-summary-pills span { padding: 9px 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; color: #afb3d3; background: rgba(5,7,35,.28); font-size: 12px; }
.family-summary-pills b { margin-right: 5px; color: var(--family-cyan); font-size: 14px; }
.family-progress-orb { --value: calc(var(--progress) * 3.6deg); position: relative; z-index: 3; flex: 0 0 116px; width: 116px; height: 116px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--family-cyan) var(--value), rgba(255,255,255,.1) 0); box-shadow: 0 0 34px rgba(8,199,244,.16); }
.family-progress-orb::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #171445; }
.family-progress-orb span { position: relative; display: grid; color: #969bc0; text-align: center; font-size: 10px; }
.family-progress-orb b { color: white; font: 700 27px "Fredoka", sans-serif; }
.family-welcome-robot { position: absolute; z-index: 3; width: 150px; height: 185px; right: 30px; bottom: -5px; object-fit: contain; filter: drop-shadow(0 18px 20px rgba(0,0,0,.4)); }

.family-dashboard-grid { margin-top: 22px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 20px; align-items: start; }
.family-card { padding: 24px; border: 1px solid var(--family-border); border-radius: 22px; background: linear-gradient(145deg, rgba(24,27,75,.96), rgba(14,16,54,.96)); box-shadow: 0 14px 35px rgba(2,3,24,.2); }
.family-card-heading { min-height: 36px; margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.family-card-heading > div { display: flex; align-items: center; gap: 11px; }
.family-card-heading h2 { margin: 0; font: 600 19px "Fredoka", sans-serif; }
.family-card-heading > span { padding: 6px 9px; border-radius: 9px; color: #8f94bd; background: rgba(255,255,255,.045); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.family-card-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font-weight: 900; }
.family-card-icon-cyan { color: var(--family-cyan); background: rgba(8,199,244,.11); }
.family-card-icon-yellow { color: var(--family-yellow); background: rgba(255,214,64,.11); }
.family-card-icon-purple { color: #ba8cff; background: rgba(159,103,255,.13); }
.family-card-icon-green { color: var(--family-green); background: rgba(91,228,108,.12); }
.family-courses-card { grid-row: span 2; }
.family-course-list { display: grid; gap: 8px; }
.family-course-row { padding: 14px; display: flex; gap: 15px; border: 1px solid rgba(255,255,255,.06); border-radius: 15px; background: rgba(6,8,39,.3); }
.family-course-badge { flex: 0 0 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: #111236; font: 700 20px "Fredoka", sans-serif; }
.family-course-badge-1 { background: linear-gradient(145deg, var(--family-cyan), #66e4ff); }
.family-course-badge-2 { background: linear-gradient(145deg, var(--family-yellow), #ffab42); }
.family-course-badge-3 { background: linear-gradient(145deg, #ad76ff, #7750f5); color: white; }
.family-course-data { min-width: 0; flex: 1; }
.family-course-data > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.family-course-data h3 { overflow: hidden; margin: 0; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.family-course-data b { color: var(--family-cyan); font-size: 12px; }
.family-progress-track { height: 7px; margin: 9px 0 5px; overflow: hidden; border-radius: 10px; background: rgba(255,255,255,.08); }
.family-progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7125df, var(--family-cyan)); }
.family-course-data p { margin: 0; color: #858ab1; font-size: 10px; }
.family-empty-state { min-height: 88px; display: grid; place-content: center; text-align: center; }
.family-empty-state b { font: 600 15px "Fredoka", sans-serif; }
.family-empty-state p { max-width: 330px; margin: 5px 0 0; color: #888db5; font-size: 12px; }
.family-empty-positive b { color: var(--family-green); }
.family-next-date { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.family-next-date b { font: 600 21px "Fredoka", sans-serif; }
.family-next-date span { color: var(--family-yellow); font-size: 14px; font-weight: 900; }
.family-next-card > p { margin: 9px 0 0; color: #9297bd; font-size: 12px; }
.family-achievement-label { color: #b58aff; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.family-achievement-card h3 { margin: 7px 0 4px; font: 600 19px "Fredoka", sans-serif; }
.family-achievement-card > p { margin: 0; color: #8d92b8; font-size: 12px; }
.family-payment-card > p { margin: 0; color: #9297bd; font-size: 11px; }
.family-payment-amount { margin: 4px 0 3px; display: flex; align-items: baseline; gap: 7px; }
.family-payment-amount b { font: 700 30px "Fredoka", sans-serif; }
.family-payment-amount span { color: #7f85ad; font-size: 10px; font-weight: 900; }
.family-payment-due { color: #c3c5df; font-size: 12px; }
.family-secondary-button { width: 100%; min-height: 40px; margin-top: 15px; border: 1px solid rgba(255,214,64,.28); border-radius: 12px; color: #9c9571; background: rgba(255,214,64,.06); font-size: 11px; font-weight: 800; cursor: not-allowed; }
.family-mobile-nav { display: none; }

@media (max-width: 1050px) {
    .family-login-shell { grid-template-columns: 56% 44%; }
    .family-robot-stage { right: 4%; }
    .family-welcome-card { padding-right: 190px; }
    .family-progress-orb { display: none; }
}

@media (max-width: 820px) {
    .family-login-shell { display: block; }
    .family-login-story { min-height: 420px; padding: 30px 28px; border-right: 0; border-bottom: 1px solid var(--family-border); }
    .family-story-copy { margin-top: 42px; max-width: 68%; }
    .family-story-copy h1 { font-size: 46px; }
    .family-robot-stage { width: 250px; height: 245px; right: 0; bottom: 26px; }
    .family-robot { width: 170px; }
    .family-orbit-one { width: 240px; height: 120px; }
    .family-orbit-two { width: 190px; height: 200px; }
    .family-value-strip { display: none; }
    .family-login-panel { min-height: 600px; }
    .family-side-nav { display: none; }
    .family-app-layout { display: block; }
    .family-app-header { padding: 0 18px; }
    .family-app-brand span, .family-child-switcher label { display: none; }
    .family-dashboard { padding: 22px 18px 100px; }
    .family-dashboard-grid { grid-template-columns: 1fr; }
    .family-courses-card { grid-row: auto; }
    .family-mobile-nav { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); height: 68px; padding: 8px 4px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--family-border); border-radius: 20px; background: rgba(14,16,54,.94); box-shadow: 0 14px 40px rgba(0,0,0,.4); backdrop-filter: blur(20px); }
    .family-mobile-nav a, .family-mobile-nav > span { display: grid; place-content: center; gap: 2px; color: #7f84ad; text-align: center; font-size: 9px; font-weight: 800; }
    .family-mobile-nav a span, .family-mobile-nav > span span { font-size: 18px; }
    .family-mobile-nav .active { color: var(--family-cyan); }
}

@media (max-width: 600px) {
    .family-login-story { min-height: 390px; padding: 25px 20px; }
    .family-logo { width: 92px; }
    .family-brand-label { font-size: 9px; }
    .family-story-copy { max-width: 76%; margin-top: 38px; }
    .family-story-copy h1 { margin-top: 14px; font-size: 36px; }
    .family-story-copy p { font-size: 14px; }
    .family-eyebrow { padding: 7px 10px; font-size: 9px; }
    .family-robot-stage { width: 180px; right: -35px; bottom: 3px; }
    .family-robot { width: 128px; }
    .family-orbit { display: none; }
    .family-login-panel { min-height: 570px; padding: 35px 20px; }
    .family-access-icon { width: 54px; height: 54px; }
    .family-login-card h2 { font-size: 35px; }
    .family-app-header { min-height: 68px; }
    .family-app-brand img { width: 76px; }
    .family-current-child b, .family-logout { display: none; }
    .family-child-switcher select { min-width: 122px; max-width: 150px; }
    .family-welcome-card { min-height: 290px; padding: 28px 24px 110px; }
    .family-welcome-card h1 { font-size: 31px; }
    .family-welcome-robot { width: 120px; height: 130px; right: 14px; }
    .family-summary-pills { margin-top: 18px; }
    .family-summary-pills span { padding: 7px 9px; font-size: 10px; }
    .family-card { padding: 19px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
