/* ==========================================================================
   Welcome screens: landing page (/), kids' sign-in and parents' sign-in.
   Pure CSS animation. Everything calms down for people who prefer reduced motion.
   ========================================================================== */

body.welcome, body.pwelcome { padding-bottom: 0; min-height: 100vh; min-height: 100svh; overflow-x: hidden; }
body.welcome::before { display: none; }
.F { font-family: Fredoka, 'Arial Rounded MT Bold', 'Avenir Next Rounded', 'Avenir Next', system-ui, sans-serif; }

/* ---------- animated sky (landing + kids) ---------- */
.wsky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, #86d0ff 0%, #c4ebff 42%, #fff2d4 80%, #ffe2b4 100%); }
.wsun { position: absolute; top: -70px; right: -50px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, #fff8d2 0 28%, #ffd86b 45%, #ffc83d00 70%); animation: wGlow 6s ease-in-out infinite; }
.whill { position: absolute; left: -20%; right: 25%; bottom: -150px; height: 270px; border-radius: 50%;
  background: linear-gradient(180deg, #8ee6bd, #21c08b); }
.whill.b { left: 35%; right: -30%; bottom: -175px; height: 290px; background: linear-gradient(180deg, #6fd6cf, #0e8fb0); }
.cloud { position: absolute; left: 0; width: 130px; height: 42px; background: #fff; border-radius: 42px; opacity: .92;
  filter: drop-shadow(0 6px 10px #3a1c7112); animation: wDrift var(--d, 80s) linear infinite; animation-delay: var(--dl, 0s); }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 62px; height: 62px; left: 18px; top: -30px; }
.cloud::after { width: 46px; height: 46px; left: 62px; top: -20px; }
.wroute { position: absolute; left: 0; top: 6%; width: 100%; height: 44%; overflow: visible; }
.wroute .rt { fill: none; stroke: #ff5fa2; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 12; opacity: .6; animation: wDash 5s linear infinite; }
.wplane path { fill: #fff; stroke: #3a1c71; stroke-width: .9; stroke-linejoin: round; }
.sticker { position: absolute; display: grid; place-items: center; width: var(--s, 56px); height: var(--s, 56px);
  font-size: calc(var(--s, 56px) * .5); background: #fff; border-radius: 50%; border: 3px dashed #ffc83d;
  box-shadow: 0 6px 0 #3a1c7114, 0 12px 26px #3a1c711f; animation: wBob var(--t, 6s) ease-in-out infinite; animation-delay: var(--dl, 0s); }
@media (max-width: 640px) {
  .sticker { --s: 40px !important; opacity: .85; }
  .sticker.x { display: none; }
  .wsun { width: 200px; height: 200px; }
}

/* ---------- shared pieces ---------- */
.wland, .wauth { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 34px 16px 40px;
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.wbadge { position: relative; width: 112px; height: 112px; border-radius: 50%; background: #fff; display: grid; place-items: center;
  font-size: 4rem; box-shadow: 0 0 0 7px var(--sun), 0 14px 30px #3a1c7133; animation: wPopIn .8s cubic-bezier(.2, 1.4, .4, 1) backwards; }
.wbadge span { display: block; line-height: 1; animation: wSwing 4.5s ease-in-out infinite; transform-origin: 50% 52%; }
.wbadge::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 4px solid #fff; animation: wPing 2.8s ease-out 1s infinite; }
.whome { position: absolute; top: 14px; left: 14px; z-index: 2; background: #ffffffd9; border-radius: 99px; padding: 7px 14px;
  font-weight: 800; font-size: .85rem; color: #3a1c71; text-decoration: none; box-shadow: 0 3px 0 #3a1c7118; transition: transform .2s; }
.whome:hover { transform: translateX(-3px); }

/* ---------- landing page ---------- */
.wtitle { font: 700 clamp(2.5rem, 10vw, 4.4rem)/1 Fredoka, 'Arial Rounded MT Bold', system-ui, sans-serif; color: #fff; margin: 20px 0 0;
  letter-spacing: .02em; text-shadow: 0 4px 0 #3a1c71, 0 10px 22px #3a1c7140; }
.wtitle span { display: inline-block; animation: wDrop .75s cubic-bezier(.2, 1.5, .4, 1) backwards; animation-delay: calc(.3s + var(--i) * .06s); }
.wtitle .gap { width: .28em; }
.wkicker { font: 700 clamp(.95rem, 3.6vw, 1.3rem) Fredoka, 'Arial Rounded MT Bold', system-ui, sans-serif; letter-spacing: .45em; margin: 10px 0 0 .45em;
  color: #3a1c71; animation: wRise .7s .95s backwards; }
.wmotto { font-weight: 800; color: #3a1c71; opacity: .8; margin: 6px 0 0; animation: wRise .7s 1.1s backwards; }
.wask { font: 700 1.2rem Fredoka, 'Arial Rounded MT Bold', system-ui, sans-serif; color: #3a1c71; margin: 28px 0 14px; animation: wRise .7s 1.25s backwards; }
.portals { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; max-width: 640px; }
@media (max-width: 340px) { .portals { grid-template-columns: 1fr; } }
.portal { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px 12px 18px;
  border-radius: 28px; color: #fff; text-decoration: none; box-shadow: 0 8px 0 #0000002a, 0 18px 34px #3a1c7130;
  animation: wRise .8s cubic-bezier(.2, 1.2, .4, 1) backwards; transition: transform .3s cubic-bezier(.2, 1.4, .4, 1), box-shadow .3s; }
.portal.k { animation-delay: 1.35s; background: linear-gradient(140deg, #ffb03d, #ff5fa2 55%, #7b5cff); }
.portal.p { animation-delay: 1.5s; background: linear-gradient(140deg, #19b3c7, #0e7490 50%, #0d2b3e); }
.portal:hover { transform: translateY(-7px) rotate(-1.2deg); box-shadow: 0 14px 0 #0000002a, 0 28px 46px #3a1c7140; }
.portal.p:hover { transform: translateY(-7px) rotate(1.2deg); }
.portal:active { transform: translateY(2px) scale(.98); transition-duration: .08s; }
.portal:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }
.portal::after { content: ""; position: absolute; top: -10%; bottom: -10%; width: 38%; left: -60%;
  background: linear-gradient(100deg, #fff0, #ffffff70, #fff0); transform: skewX(-18deg); pointer-events: none; }
.portal:hover::after { animation: wShine .85s ease; }
.portal .pi { font-size: 3.7rem; line-height: 1.05; filter: drop-shadow(0 6px 0 #0002); animation: wFloat 3.2s ease-in-out infinite; }
.portal.p .pi { animation-delay: -1.6s; }
.portal b { font: 700 1.6rem Fredoka, 'Arial Rounded MT Bold', system-ui, sans-serif; margin-top: 4px; }
.portal small { font-weight: 700; opacity: .93; font-size: .86rem; line-height: 1.3; max-width: 20em; }
.portal .go { margin-top: 10px; background: #ffffff33; border-radius: 99px; padding: 7px 15px; font-weight: 800; font-size: .86rem; white-space: nowrap; }
@media (max-width: 420px) { .portal { padding: 20px 8px 16px; } .portal .go { font-size: .78rem; padding: 6px 11px; } .portal small { font-size: .8rem; } }
.portal .go i { display: inline-block; font-style: normal; transition: transform .25s; }
.portal:hover .go i { transform: translateX(5px); }
.wnote { margin-top: 24px; font-weight: 800; font-size: .84rem; color: #3a1c71; opacity: .7; animation: wRise .7s 1.75s backwards; }

/* ---------- kids' sign-in ---------- */
.wauth .wbadge { width: 96px; height: 96px; font-size: 3.4rem; }
.wh { font: 700 clamp(1.75rem, 7vw, 2.5rem)/1.1 Fredoka, 'Arial Rounded MT Bold', system-ui, sans-serif; color: #fff; margin: 18px 0 4px;
  text-shadow: 0 3px 0 #3a1c71, 0 8px 16px #3a1c7140; animation: wRise .6s .15s backwards; }
.wave { display: inline-block; transform-origin: 70% 80%; animation: wWave 2.6s ease-in-out 1s infinite; }
.wsub { margin: 0; font-weight: 800; color: #3a1c71; opacity: .8; animation: wRise .6s .25s backwards; }
.wcard { width: 100%; max-width: 420px; margin-top: 18px; padding: 20px 18px 16px; text-align: left; background: #fffffff2;
  border: 3px solid #fff; border-radius: 28px; box-shadow: 0 10px 0 #3a1c7116, 0 26px 50px #3a1c712e;
  animation: wRise .7s .35s cubic-bezier(.2, 1.2, .4, 1) backwards; }
.wcard .l { color: #4b3c8a; font-size: .82rem; }
.wcard .who { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0 0 10px; }
.wcard .who button { width: 124px; padding: 12px 8px; transition: transform .25s cubic-bezier(.2, 1.5, .4, 1); }
.wcard .who button:hover { transform: translateY(-4px) rotate(-2deg); }
.wcard .who button.on { outline: 4px solid var(--sun); outline-offset: 2px; animation: wPop .4s cubic-bezier(.2, 1.6, .4, 1); }
.pinwrap { position: relative; margin: 5px 0; }
.pinwrap input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: text; font-size: 16px; }
.pindots { display: flex; justify-content: center; gap: 12px; padding: 15px; border-radius: 16px; border: 2px solid var(--line); background: #fbfaff;
  transition: border-color .2s, box-shadow .2s; }
.pinwrap:focus-within .pindots { border-color: var(--grape); box-shadow: 0 0 0 4px #7b5cff22; }
.pindots i { width: 18px; height: 18px; border-radius: 50%; background: #e4def9; transition: background .15s; }
.pindots i.on { background: linear-gradient(135deg, #ff8a3d, #ff5fa2); box-shadow: 0 2px 0 #c2408066; }
.pindots i.new { animation: wPop .32s cubic-bezier(.2, 1.7, .4, 1); }
.wgo { width: 100%; margin: 16px 0 0 !important; padding: 14px !important; font-size: 1.15rem !important; display: flex; align-items: center; justify-content: center; gap: 8px; }
.wgo .rk { display: inline-block; }
.wgo:hover .rk { animation: wRumble .28s linear infinite; }
.wgo.launch .rk { animation: wLaunch .9s cubic-bezier(.5, 0, .8, .4) forwards; }
.wcard .err, .pcard .err { color: #b4321a; font-weight: 800; min-height: 1.3em; margin: 10px 0 0; }
.wcard .err:not(:empty), .pcard .err:not(:empty) { animation: wRise .3s; }
.wcard.shake, .pcard.shake { animation: wShake .45s; }
.wcard.done, .pcard.done { animation: wOut .45s forwards; }
.wfoot { margin: 16px 0 0; font-weight: 700; font-size: .88rem; color: #3a1c71; animation: wRise .6s .5s backwards; }
.wfoot a { color: #3a1c71; }

/* ---------- parents' sign-in ---------- */
.pauth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; min-height: 100svh; }
.pside { position: relative; overflow: hidden; color: #fff; padding: 48px 46px; display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(150deg, #0d2b3e 0%, #0e4d69 55%, #0e7490 100%); }
.pside > :not(.pmap) { position: relative; }
.pmap { position: absolute; inset: 0; width: 100%; height: 100%; }
.pmap .rt { fill: none; stroke: #ffc83d; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 7 11; opacity: .75; animation: wDash 7s linear infinite; }
.pmap .dot { fill: #ffc83d; }
.pmap .ring { fill: none; stroke: #ffc83d; stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: wPingSvg 3.2s ease-out infinite; }
.pmap .pinpt:nth-of-type(2) .ring { animation-delay: .8s; } .pmap .pinpt:nth-of-type(3) .ring { animation-delay: 1.6s; } .pmap .pinpt:nth-of-type(4) .ring { animation-delay: 2.4s; }
.pmap .mover { fill: #fff; filter: drop-shadow(0 0 6px #fff); }
.pbrand { font: 700 .85rem Fredoka, 'Arial Rounded MT Bold', system-ui, sans-serif; letter-spacing: .16em; opacity: .9; animation: wRise .6s backwards; }
.pside h1 { font: 700 clamp(2rem, 4vw, 3.1rem)/1.05 Fredoka, 'Arial Rounded MT Bold', system-ui, sans-serif; margin: 14px 0 10px; animation: wRise .7s .1s backwards; }
.pside p { margin: 0; max-width: 27em; opacity: .88; font-weight: 700; animation: wRise .7s .2s backwards; }
.pfeat { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; max-width: 26em; }
.pfeat li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; font-weight: 700;
  background: #ffffff12; border: 1px solid #ffffff22; backdrop-filter: blur(2px); animation: wSlide .6s backwards; }
.pfeat li:nth-child(1) { animation-delay: .35s; } .pfeat li:nth-child(2) { animation-delay: .47s; }
.pfeat li:nth-child(3) { animation-delay: .59s; } .pfeat li:nth-child(4) { animation-delay: .71s; }
.pfeat span { font-size: 1.35rem; }
.pmain { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; }
.pcard { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 28px 26px 20px; border: 1px solid #dde3ea;
  box-shadow: 0 1px 2px #0d2b3e14, 0 18px 44px #0d2b3e1f; animation: wRise .6s .15s backwards; }
.pcard h2 { font: 700 1.65rem Fredoka, 'Arial Rounded MT Bold', system-ui, sans-serif; color: #0d2b3e; }
.pcard .m { margin: 4px 0 10px; }
.pcard input { border-radius: 10px; border: 1.5px solid #cfd8e3; background: #fff; transition: border-color .2s, box-shadow .2s; }
.pcard input:focus { border-color: #0e7490; box-shadow: 0 0 0 4px #0e749022; outline: none; }
.pw { position: relative; }
.pw input { padding-right: 52px; }
.pweye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 1.15rem; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.pweye:hover { background: #eef3f7; }
body.par .pcard .pgo { width: 100%; margin: 16px 0 0; padding: 13px; font-size: 1rem; display: flex; align-items: center; justify-content: center; gap: 10px; transition: background .2s, transform .1s; }
body.par .pcard .pgo:hover { background: #0b5f75; }
body.par .pcard .pgo:active { transform: scale(.98); }
.spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid #ffffff55; border-top-color: #fff; animation: wSpin .7s linear infinite; }
.pgo.busy .spin { display: inline-block; }
.plinks { margin: 18px 0 0; font-size: .9rem; animation: wRise .6s .35s backwards; }
.plinks a { color: #0e7490; }
@media (max-width: 860px) {
  .pauth { grid-template-columns: 1fr; min-height: 0; }
  .pside { padding: 30px 22px 34px; }
  .pside h1 { font-size: 1.9rem; }
  .pfeat { display: none; }
  .pmain { padding: 22px 16px 32px; justify-content: flex-start; }
}

/* ---------- keyframes ---------- */
@keyframes wDrift { from { transform: translateX(-30vw); } to { transform: translateX(130vw); } }
@keyframes wBob { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-14px) rotate(calc(var(--r, 0deg) + 8deg)); } }
@keyframes wSwing { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
@keyframes wPing { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.65); opacity: 0; } }
@keyframes wPingSvg { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.8); opacity: 0; } }
@keyframes wPopIn { 0% { transform: scale(0) rotate(-120deg); } 100% { transform: none; } }
@keyframes wDrop { 0% { transform: translateY(-70px) scale(.4); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes wRise { from { transform: translateY(26px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wSlide { from { transform: translateX(-22px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wDash { to { stroke-dashoffset: -140; } }
@keyframes wShine { from { left: -60%; } to { left: 130%; } }
@keyframes wFloat { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-9px) rotate(5deg); } }
@keyframes wGlow { 0%, 100% { transform: scale(1); opacity: .92; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes wShake { 0%, 100% { transform: none; } 20% { transform: translateX(-10px) rotate(-1deg); } 40% { transform: translateX(9px) rotate(1deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@keyframes wPop { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes wWave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(18deg); } 20%, 40% { transform: rotate(-8deg); } }
@keyframes wRumble { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-1px, 1px) rotate(-7deg); } 75% { transform: translate(1px, -1px) rotate(7deg); } }
@keyframes wLaunch { 0% { transform: none; } 20% { transform: translate(-2px, 4px) rotate(-10deg); } 100% { transform: translate(60px, -110vh) rotate(-15deg); } }
@keyframes wOut { to { transform: scale(.94) translateY(-10px); opacity: 0; } }
@keyframes wSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .wsky *, .wland, .wland *, .wauth, .wauth *, .pauth *,
  .wland *::before, .wland *::after, .wauth *::before, .wauth *::after { animation: none !important; transition: none !important; }
  .wplane, .pmap .mover { display: none; }
}
