/* ==========================================================================
   Splash / login screen
   The first thing anyone sees. It has to read instantly as "for children"
   while still looking like software a parent would trust with their family.
   The colour and motion carry the first message; the typography and spacing
   carry the second.
   ========================================================================== */

.splash {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, #f3f7ff 0%, #fdf2f8 55%, #fff8ec 100%);
}

/* ---- floating background shapes ---- */

.blobs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(46px); opacity: .5;
  animation: drift 22s ease-in-out infinite;
}
.blob-1 { width: 460px; height: 460px; background: #7fc4ff; top: -160px; left: -120px; }
.blob-2 { width: 400px; height: 400px; background: #f5a3d0; bottom: -150px; right: -90px; animation-delay: -7s; }
.blob-3 { width: 320px; height: 320px; background: #ffd98a; top: 42%; right: 16%; animation-delay: -13s; }
.blob-4 { width: 300px; height: 300px; background: #a6e6c3; bottom: 12%; left: 12%; animation-delay: -18s; }

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(34px, -26px) scale(1.07); }
  66%      { transform: translate(-24px, 20px) scale(.95); }
}

/* ---- top bar: the parent and admin doors, deliberately off to the side ---- */

.splash-top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.brand span { background: linear-gradient(92deg, #2f7fd4, #7c4dd6 55%, #d63b83);
  -webkit-background-clip: text; background-clip: text; color: transparent; }

.splash-top .doors { display: flex; align-items: center; gap: 8px; }
.door {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 18px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .8); border: 1.5px solid rgba(27, 29, 35, .09);
  color: var(--ink-soft); font-weight: 600; font-size: .92rem; text-decoration: none;
  backdrop-filter: blur(8px);
  transition: background var(--speed), color var(--speed), border-color var(--speed), transform var(--speed);
}
.door:hover { background: #fff; color: var(--ink); border-color: rgba(27,29,35,.2); transform: translateY(-1px); }

/* ---- centre stage ---- */

.splash-main {
  position: relative; z-index: 2; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px 24px 40px; text-align: center;
}

.splash-mark {
  width: 108px; height: 108px; border-radius: 30px;
  box-shadow: 0 18px 40px rgba(90, 60, 160, .22);
  margin-bottom: 26px;
  animation: pop-in 700ms var(--ease) both, bob 4.5s ease-in-out 700ms infinite;
}
@keyframes pop-in { from { opacity: 0; transform: scale(.6) rotate(-9deg); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

.splash-title {
  font-size: clamp(2.4rem, 7vw, 3.9rem); font-weight: 800; letter-spacing: -.035em;
  margin-bottom: 12px;
  background: linear-gradient(96deg, #2f7fd4, #7c4dd6 46%, #d63b83);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rise 620ms var(--ease) 120ms both;
}
.splash-tagline {
  font-size: clamp(1.02rem, 2.4vw, 1.22rem); color: #45506b; font-weight: 500;
  max-width: 34ch; margin: 0 auto 38px;
  animation: rise 620ms var(--ease) 220ms both;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* The kid button. Big, obvious, and the only thing competing for attention. */
.kid-button {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 20px 44px 20px 26px; border: none; border-radius: var(--r-pill);
  background: linear-gradient(96deg, #3d9bf0, #7c4dd6 52%, #d63b83);
  color: #fff; font-size: clamp(1.15rem, 3vw, 1.45rem); font-weight: 800; letter-spacing: -.01em;
  box-shadow: 0 12px 30px rgba(110, 70, 190, .34);
  animation: rise 620ms var(--ease) 320ms both;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), filter 200ms;
  position: relative;
}
.kid-button:hover { transform: translateY(-3px) scale(1.025); box-shadow: 0 18px 42px rgba(110, 70, 190, .42); filter: saturate(1.1); }
.kid-button:active { transform: translateY(0) scale(.99); }
.kid-button .bubble {
  width: 54px; height: 54px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .22);
  display: grid; place-items: center; font-size: 1.5rem;
  animation: wiggle 3.4s ease-in-out infinite;
}
@keyframes wiggle {
  0%, 72%, 100% { transform: rotate(0); }
  78% { transform: rotate(-11deg); }
  84% { transform: rotate(9deg); }
  90% { transform: rotate(-5deg); }
}

.kid-button-sub {
  margin-top: 16px; font-size: .95rem; color: #5a6478;
  animation: rise 620ms var(--ease) 420ms both;
}

.splash-foot {
  position: relative; z-index: 2; padding: 18px 28px 26px;
  display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;
  font-size: .84rem; color: #6b7488;
}
.splash-foot a { color: inherit; text-decoration: none; }
.splash-foot a:hover { color: var(--ink); text-decoration: underline; }

/* ---- login panels ---- */

.panel-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(24, 22, 46, .42); backdrop-filter: blur(5px);
  display: grid; place-items: center; padding: 20px;
  animation: fade-in 200ms var(--ease);
}
.panel {
  width: min(460px, 100%); background: var(--surface);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  overflow: hidden; animation: modal-in 260ms var(--ease);
  max-height: 92dvh; display: flex; flex-direction: column;
}
.panel-head {
  padding: 26px 28px 18px; text-align: center; position: relative;
  background: linear-gradient(180deg, var(--accent-tint), transparent);
}
.panel-head .crest {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 20px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 1.6rem;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 38%, transparent);
}
.panel-head h2 { font-size: 1.4rem; }
.panel-head p { color: var(--ink-faint); font-size: .93rem; margin: 6px 0 0; }
.panel-close { position: absolute; top: 14px; right: 14px; }
.panel-body { padding: 8px 28px 26px; overflow-y: auto; }
.panel-foot { padding: 16px 28px; background: var(--surface-2); border-top: 1px solid var(--line-soft); text-align: center; font-size: .88rem; }

/* ---- the kid passcode keypad ---- */

.pin-display { display: flex; justify-content: center; gap: 12px; margin: 6px 0 20px; }
.pin-dot {
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--surface-3); border: 2px solid var(--line);
  transition: transform 160ms var(--ease), background 160ms, border-color 160ms;
}
.pin-dot.is-filled { background: var(--accent); border-color: var(--accent); transform: scale(1.16); }
.pin-display.is-wrong { animation: shake 420ms var(--ease); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.key {
  aspect-ratio: 1.45; border: 1.5px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); font-size: 1.5rem; font-weight: 700; color: var(--ink);
  display: grid; place-items: center;
  transition: transform 120ms var(--ease), background 120ms, border-color 120ms, box-shadow 120ms;
}
.key:hover:not(:disabled) { background: var(--accent-tint); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.key:active:not(:disabled) { transform: scale(.94); background: var(--accent); color: var(--on-accent); }
.key-action { font-size: 1.1rem; color: var(--ink-faint); background: var(--surface-2); }
.key-go { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.key-go:hover:not(:disabled) { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--on-accent); }
.key:disabled { opacity: .35; }

@media (max-width: 560px) {
  .splash-top { padding: 14px 16px; }
  .door span { display: none; }
  .door { padding: 10px 13px; }
}
