@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Georgian:wght@500;700;900&display=swap");

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
  background: #390099;
  color: #FFFFFF;
  font-family: "Noto Sans Georgian", "BPG Nino Mtavruli", "Sylfaen", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 5% 64px;
  gap: 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar .back { margin-right: auto; }

.login {
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  background: #FFBD00;
  color: #390099;
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  min-height: 44px;
  cursor: pointer;
}
.login:hover, .login:focus-visible { background: #FFFFFF; outline: none; }

.back {
  font-weight: 700;
  font-size: 16px;
  color: #FFBD00;
  text-decoration: none;
  padding: 10px 4px;
}
.back:hover, .back:focus-visible { color: #FFFFFF; outline: none; }

.hero { text-align: center; display: flex; flex-direction: column; gap: 10px; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); font-weight: 900; line-height: 1.2; }
.hero p { font-size: 18px; font-weight: 500; color: #FFBD00; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1180px; }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.tile {
  font: inherit;
  border: none;
  cursor: pointer;
  border-radius: 28px;
  padding: 28px 20px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  text-decoration: none;
  transition: transform .15s;
}
.tile svg { width: 56px; height: 56px; flex-shrink: 0; }
.tile span { font-weight: 900; font-size: 24px; line-height: 1.3; }
.tile small { font-weight: 700; font-size: 16px; opacity: .9; }
.tile:hover, .tile:focus-visible { transform: translateY(-6px); outline: none; }
.tile:focus-visible { box-shadow: 0 0 0 4px #FFFFFF; }
.tile.wiggle { animation: wiggle .4s; }

.c-raspberry { background: #9E0059; color: #FFFFFF; }
.c-fuchsia   { background: #FF0054; color: #FFFFFF; }
.c-orange    { background: #FF5400; color: #FFFFFF; }
.c-amber     { background: #FFBD00; color: #390099; }

@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  opacity: 0;
  background: #FFBD00;
  color: #390099;
  font-weight: 900;
  padding: 12px 24px;
  border-radius: 999px;
  transition: transform .25s, opacity .25s;
  z-index: 10;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 720px) {
  body { gap: 32px; padding-bottom: 40px; }
  .grid, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .tile { min-height: 140px; padding: 18px 10px; border-radius: 22px; }
  .tile svg { width: 44px; height: 44px; }
  .tile span { font-size: 17px; }
  .tile small { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile, .toast { transition: none; }
  .tile.wiggle { animation: none; }
}

/* ---------- accounts: forms, panels, modal ---------- */
.login { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
[hidden] { display: none !important; }

.panel {
  width: 100%; max-width: 480px; margin: 0 auto;
  background: #FFFFFF; color: #390099; border-radius: 28px;
  padding: 28px 26px; display: flex; flex-direction: column; gap: 18px;
}
.panel.wide { max-width: 760px; }
.panel h2 { font-size: 24px; font-weight: 900; }
.panel p, .panel li { font-size: 16px; line-height: 1.55; }
.panel a { color: #9E0059; font-weight: 700; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: #F1EAFB; border-radius: 18px; padding: 6px; }
.tabs button {
  font: inherit; font-weight: 900; font-size: 18px; border: none; border-radius: 14px;
  padding: 12px; min-height: 48px; cursor: pointer; background: transparent; color: #390099;
}
.tabs button[aria-selected="true"] { background: #390099; color: #FFBD00; }

form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: 15px; }
.field input, .field select {
  font: inherit; font-size: 18px; color: #390099; background: #FFFFFF;
  border: 3px solid #390099; border-radius: 14px; padding: 10px 14px; min-height: 50px; width: 100%;
}
.field input:focus, .field select:focus { outline: 4px solid #FFBD00; outline-offset: 1px; }
.field input.pin { font-size: 32px; letter-spacing: 14px; text-align: center; font-weight: 900; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.5; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: #390099; flex-shrink: 0; }

.btn {
  font: inherit; font-weight: 900; font-size: 18px; cursor: pointer; text-decoration: none; text-align: center;
  background: #FF0054; color: #FFFFFF; border: none; border-radius: 999px; padding: 13px 24px; min-height: 50px;
}
.btn:hover, .btn:focus-visible { background: #9E0059; outline: none; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.light { background: #F1EAFB; color: #390099; }
.btn.light:hover, .btn.light:focus-visible { background: #E2D4F7; }
.btn.small { font-size: 15px; padding: 8px 16px; min-height: 44px; }
.btn.danger { background: #FFFFFF; color: #C00040; border: 3px solid #C00040; }
.btn.danger:hover, .btn.danger:focus-visible { background: #C00040; color: #FFFFFF; }

.err { background: #FFE3EC; color: #9E0059; border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 15px; }
.ok  { background: #FFF4CC; color: #390099; border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 15px; }
.muted { color: #6B5A8E; font-size: 15px; }

.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.kid { border: 3px solid #390099; border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.kid h3 { font-size: 22px; font-weight: 900; }
.kid .pinbox { background: #390099; color: #FFBD00; border-radius: 14px; padding: 8px; text-align: center; }
.kid .pinbox b { display: block; font-size: 32px; letter-spacing: 10px; font-weight: 900; }
.kid .row { display: flex; gap: 8px; flex-wrap: wrap; }
.howto { background: #FFF4CC; border-radius: 16px; padding: 14px 16px; }
.howto ol { padding-left: 22px; }

.chip { font: inherit; font-weight: 900; font-size: 16px; background: #FFBD00; color: #390099; border: none; border-radius: 999px; padding: 10px 20px; min-height: 44px; cursor: pointer; }

.modal { position: fixed; inset: 0; background: rgba(20, 0, 60, .7); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 30; }
.modal .panel { animation: rise .2s ease-out; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 720px) {
  .panel { padding: 22px 18px; border-radius: 22px; }
}
.panel section { display: flex; flex-direction: column; gap: 12px; }
.panel section + section { border-top: 2px solid #F1EAFB; padding-top: 18px; }
/* A child sees four tiles: lay them out 2 × 2. */
html[data-role="child"] .grid:not(.grid-4) { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 740px; }
