/* Šriftas – iš savo serverio (be Google Fonts užklausų ir slapukų) */
@font-face { font-family: "Nunito"; src: url("../fonts/Nunito-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/Nunito-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --bg: #fbf7f0;
  --surface: #ffffff;
  --text: #1d2433;
  --muted: #5d6677;
  --accent: #b3262e;
  --accent-text: #ffffff;
  --border: #e6dfd3;
  --ok: #1f7a4d;
  --warn-bg: #fff4d6;
  --err-bg: #fde8e8;
  --day-open: #1f7a4d;
  --day-preview: #3d6fb6;
  --day-sleeping: #8a6d3b;
  --day-early: #c9ccd3;
  --snow: #b8c4d6;
  --primary: #2f55d4;
  --primary-text: #ffffff;
  --page-bg: #ffffff;
  --soft: #f4f5f8;
  --radius: 16px;
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1626; --surface: #18213a; --text: #eef1f7; --muted: #a7b0c3;
    --accent: #ff6b6b; --accent-text: #10131c; --border: #2a3553; --ok: #5fd39a;
    --warn-bg: #3a3218; --err-bg: #3d1c22; --day-open: #3fb37a; --day-preview: #6f9be0;
    --day-sleeping: #c49a52; --day-early: #3a4563; --snow: #ffffff;
    --primary: #7d9bff; --primary-text: #0f1626; --page-bg: #0f1626; --soft: #18213a;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1626; --surface: #18213a; --text: #eef1f7; --muted: #a7b0c3;
  --accent: #ff6b6b; --accent-text: #10131c; --border: #2a3553; --ok: #5fd39a;
  --warn-bg: #3a3218; --err-bg: #3d1c22; --day-open: #3fb37a; --day-preview: #6f9be0;
  --day-sleeping: #c49a52; --day-early: #3a4563; --snow: #ffffff;
   --primary: #7d9bff; --primary-text: #0f1626; --page-bg: #0f1626; --soft: #18213a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.6; }
a { color: var(--accent); }
h1, h2 { line-height: 1.25; font-weight: 800; }
img { max-width: 100%; height: auto; }

.dev-banner { position: sticky; top: 0; z-index: 50; background: #ffd400; color: #000; text-align: center; font-size: .85rem; padding: 4px; }
.dev-note { font-size: .85rem; color: var(--muted); }
.dev-banner ~ .kid-toolbar { top: 34px; }

/* Mygtukai */
.btn { display: inline-block; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-text);
       font: 800 1rem var(--font); padding: .75rem 1.4rem; text-decoration: none; cursor: pointer; }
.btn-big { font-size: 1.2rem; padding: 1rem 1.8rem; }
.btn:focus-visible, .icon-btn:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.icon-btn { background: transparent; border: 0; font-size: 1.4rem; cursor: pointer; padding: .4rem; border-radius: 50%; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- Vaiko ekranai ---------- */
.kid { font-size: 1.3rem; }
.kid-toolbar { position: fixed; top: max(8px, env(safe-area-inset-top)); right: 8px; z-index: 20; display: flex; gap: 4px; }
.kid-main { position: relative; z-index: 10; max-width: 40rem; margin: 0 auto; padding: 3.5rem 16px 3rem; }
.story h1 { font-size: 2rem; margin: .2rem 0 1rem; }
.story-day { margin: 0; color: var(--muted); font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.story-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--surface); }
.story-text { font-size: 1.35rem; line-height: 1.75; }
.story-text p { margin: 1rem 0; }
.note { background: var(--surface); border-radius: var(--radius); padding: .8rem 1rem; font-size: 1rem; color: var(--muted); }
.good-night { text-align: center; font-size: 1.8rem; font-weight: 800; margin: 2.5rem 0 1rem; }
.santa { text-align: center; background: var(--surface); border-radius: var(--radius); padding: 1.2rem; margin: 2rem 0; }
.santa-title { font-weight: 800; margin-top: 0; }
.santa-video { width: 100%; border-radius: 12px; background: #000; }

.screen { text-align: center; padding-top: 12vh; }
.screen h1 { font-size: 2rem; }
.screen-emoji { font-size: 4.5rem; line-height: 1; }
.moon { animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.countdown { font-size: 1.6rem; font-weight: 800; margin-top: 1.5rem; }
.countdown-label { display: block; font-size: 1rem; color: var(--muted); font-weight: 400; }

/* Sniegas */
.snow { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.flake { position: absolute; top: -10px; border-radius: 50%; background: var(--snow); opacity: .8;
         animation: fall linear infinite; }
@keyframes fall { to { transform: translate3d(var(--drift, 20px), 105vh, 0); } }
@media (prefers-reduced-motion: reduce) {
  .snow { display: none; }
  .moon { animation: none; }
}

/* ---------- Tėvų / bendri puslapiai ---------- */
.page { font-size: 1.05rem; }
.site-header { display: flex; justify-content: space-between; align-items: center; max-width: 46rem; margin: 0 auto; padding: 12px 16px; }
.brand { font-weight: 800; text-decoration: none; color: var(--text); }
.page-main { max-width: 46rem; margin: 0 auto; padding: 0 16px 2rem; }
.site-footer { text-align: center; color: var(--muted); font-size: .9rem; padding: 2rem 16px; }
.site-footer a { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; margin: 1rem 0; }
.card.highlight { border: 2px solid var(--accent); }
.hero { text-align: center; padding: 2rem 0 1rem; }
.lead { font-size: 1.2rem; }
.price { font-weight: 800; }
.steps li { margin: .4rem 0; }
.sample .story-text { font-size: 1.1rem; }

.flash { border-radius: 12px; padding: .7rem 1rem; }
.flash ul { margin: 0; padding-left: 1.2rem; }
.flash-error { background: var(--err-bg); }
.flash-ok { background: var(--surface); border: 1px solid var(--ok); color: var(--ok); }
.warn { background: var(--warn-bg); border-radius: 8px; padding: .5rem .8rem; }
.ok { color: var(--ok); font-weight: 800; }

.form .field { display: block; margin: 1rem 0; }
.form .field > span { display: block; font-weight: 800; margin-bottom: .3rem; }
.form small { color: var(--muted); }
input[type="text"], input[type="email"] {
  width: 100%; font: inherit; font-size: 1.1rem; padding: .65rem .8rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.check { display: flex; gap: .6rem; align-items: flex-start; margin: .7rem 0; }
.check input { margin-top: .35rem; width: 1.2rem; height: 1.2rem; flex: none; }
.child { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; background: var(--surface); }
.child legend { font-weight: 800; font-size: 1.2rem; padding: 0 .4rem; }
.gender { display: flex; gap: 1.2rem; margin: .5rem 0 1rem; }
.cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .6rem 1rem; }
.case span { display: block; font-size: .85rem; color: var(--muted); }
.gate-words { display: block; font-size: 1.4rem; margin: .4rem 0 .8rem; }
.gate input { max-width: 8rem; font-size: 1.5rem; text-align: center; }

.copy-row { display: flex; gap: .5rem; }
.copy-row input { flex: 1; min-width: 0; font-size: .95rem; }

.days { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.day { border-radius: 10px; text-align: center; padding: .5rem 0; font-weight: 800; color: #fff; }
.day-open { background: var(--day-open); }
.day-preview { background: var(--day-preview); }
.day-sleeping { background: var(--day-sleeping); }
.day-too_early, .day-season_over { background: var(--day-early); color: var(--text); }
.legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .9rem; }
.swatch { display: inline-block; width: 1rem; height: 1rem; padding: 0; vertical-align: middle; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.logout { text-align: center; }

@media (max-width: 420px) {
  .kid { font-size: 1.2rem; }
  .story h1 { font-size: 1.7rem; }
  .story-text { font-size: 1.25rem; }
  .days { grid-template-columns: repeat(4, 1fr); }
}

/* Mokėjimo pasiūlymas (tik tėvams) */
.offer .benefits { padding-left: 1.2rem; }
.offer .benefits li { margin: .4rem 0; }

/* „Miega“ ekranas: vaikas pakviečia tėvelius */
.wake { margin-top: 2rem; }
.wake-hint { text-align: center; background: var(--surface); border-radius: var(--radius); padding: 1.2rem; margin: 1rem 0 2rem; font-size: 1.1rem; }
.wake-hint p { margin-top: 0; }

/* ================= Produkto ir užsakymo puslapiai ================= */
.page { background: var(--page-bg); }
.page .site-header { max-width: 72rem; border-bottom: 1px solid var(--border); }
.page-wide .page-main { max-width: 72rem; }
.muted { color: var(--muted); }
.center { text-align: center; }

.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); font-weight: 600; }
.btn-ghost { background: transparent; color: var(--muted); font-weight: 600; }
.btn-block { display: block; width: 100%; text-align: center; margin-top: .7rem; }

/* Produkto viršus: galerija + informacija */
.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; padding: 1.5rem 0 2rem; }
.gallery-main { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.gallery-main img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ribbon { position: absolute; top: 14px; left: 14px; background: var(--accent); color: #fff; font-weight: 800; font-size: .85rem; padding: .3rem .8rem; border-radius: 999px; }
.gallery-thumbs { display: flex; gap: .6rem; margin-top: .7rem; overflow-x: auto; }
.thumb { flex: none; width: 84px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: none; cursor: pointer; opacity: .7; }
.thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.thumb.active, .thumb:hover { border-color: var(--primary); opacity: 1; }
.product-info h1 { font-size: 2.1rem; margin: 0 0 .6rem; }
.features { list-style: none; padding: 0; margin: 1.2rem 0; }
.features li { padding: .35rem 0; }
.price-box { background: var(--soft); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0 .4rem; }
.badge { display: inline-block; background: var(--ok); color: #fff; font-weight: 800; font-size: .85rem; padding: .2rem .7rem; border-radius: 999px; }
.price-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: .5rem; }
.price-big { font-size: 2rem; font-weight: 800; color: var(--accent); }

.how { text-align: center; padding: 2rem 0; }
.how-steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.how-steps li { background: var(--soft); border-radius: var(--radius); padding: 1.2rem; }
.how-n { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--primary); color: var(--primary-text); font-weight: 800; }

/* Užsakymas */
.order { max-width: 44rem; margin: 0 auto; }
.order-title { text-align: center; font-size: 2rem; margin: 1.2rem 0 1rem; }
.order-card { background: var(--soft); border-radius: 20px; padding: 1.5rem; }
.order-card h2 { margin-top: 0; }
.order-actions { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.order-summary { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.name-chip { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .2rem .8rem; font-weight: 800; }

.stepper { list-style: none; padding: 0; margin: 0 0 1.2rem; display: flex; justify-content: center; gap: .5rem; counter-reset: s; }
.stepper li { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .95rem; }
.stepper li + li::before { content: ""; width: 1.6rem; height: 2px; background: var(--border); margin-right: .2rem; }
.stepper-n { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 2px solid var(--border); font-weight: 800; font-size: .85rem; }
.stepper .current { color: var(--text); font-weight: 800; }
.stepper .current .stepper-n { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.stepper .done .stepper-n { background: var(--ok); border-color: var(--ok); color: #fff; }

.child-cards { display: grid; gap: .8rem; margin: 1rem 0; }
.child-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.child-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.child-card-n { font-weight: 800; }
.child-card input[type="text"] { margin-bottom: .7rem; }
.js .child-card[data-optional] { display: none; }
.pills { display: flex; gap: .5rem; flex-wrap: wrap; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; }
.pill span { display: inline-block; padding: .45rem 1rem; border: 1.5px solid var(--border); border-radius: 999px; cursor: pointer; font-weight: 600; background: var(--page-bg); }
.pill input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.pill input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.order .child { background: var(--surface); }

@media (max-width: 760px) {
  .product { grid-template-columns: 1fr; gap: 1.2rem; padding-top: .5rem; }
  .product-info h1 { font-size: 1.6rem; }
  .how-steps { grid-template-columns: 1fr; }
  .order-card { padding: 1rem; }
  .stepper-label { display: none; }
  .stepper .current .stepper-label { display: inline; }
}
.page input[type="text"], .page input[type="email"] { background: var(--page-bg); border-width: 1.5px; }
.page input[type="text"]:focus, .page input[type="email"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

/* ================= Admin ================= */
.admin-header { flex-wrap: wrap; gap: .5rem; }
.admin-nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.admin-nav form { margin: 0; }
.admin-main { max-width: 64rem; }
.admin-login { max-width: 24rem; margin: 3rem auto; }
.admin-login input[type="password"] { width: 100%; font: inherit; padding: .65rem .8rem; border-radius: 10px; border: 1.5px solid var(--border); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; margin: 1rem 0; }
.kpi { background: var(--soft); border-radius: var(--radius); padding: 1rem; }
.kpi span { display: block; color: var(--muted); font-size: .9rem; }
.kpi strong { font-size: 1.8rem; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--border); }
.table .num { text-align: right; white-space: nowrap; }
.bars progress { width: 100%; height: .9rem; accent-color: var(--primary); }
.tag { padding: .1rem .55rem; border-radius: 999px; font-size: .85rem; font-weight: 800; }
.tag-paid { background: var(--ok); color: #fff; }
.tag-trial { background: var(--soft); border: 1px solid var(--border); }
.admin-search { display: flex; gap: .5rem; margin: 1rem 0; }
.admin-search input { flex: 1; }
.admin-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.bars td:first-child, .bars td:last-child { width: 3.5rem; }
/* Tėvų / užsakymo / admin puslapiuose – vienoda pagrindinė spalva (vaiko ekranuose lieka šventinė) */
.page .btn:not(.btn-ghost):not(.btn-outline) { background: var(--primary); color: var(--primary-text); }

/* Tėvų puslapis: atrakintos dienos – nuorodos į pasaką */
.day-link { display: block; color: inherit; text-decoration: none; border-radius: 10px; }
.day-link:hover .day-n { text-decoration: underline; }
.day-link:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
