/* Кастомні стилі лендінгу (доповнюють Tailwind CDN).
   Написано на чистому CSS, бо Tailwind Play CDN не обробляє @apply у зовнішніх файлах.

   Теми: кольори задані змінними. Темна тема — за замовчуванням (:root),
   світла вмикається атрибутом <html data-theme="light"> (див. перемикач у шапці та main.js).
   Колір «ink» у tailwind.config посилається на канали --ink-* (rgb), тому утиліти
   bg-ink-*, from-ink-* тощо автоматично змінюються разом із темою. */

:root {
    color-scheme: dark;

    /* канали rgb для Tailwind */
    --ink-950: 7 8 10;
    --ink-900: 12 14 18;
    --ink-800: 19 22 28;
    --ink-700: 28 32 40;
    --ink-600: 42 47 58;

    --accent: #c6ff3d;
    --accent-600: #a8e01f;
    --accent-ink: #07080a;      /* текст на акцентному фоні */
    --accent-text: #c6ff3d;     /* акцент як колір тексту */

    --text-strong: #ffffff;
    --text: #d4d4d8;
    --muted: #a1a1aa;
    --placeholder: #52525b;

    --border: rgba(255, 255, 255, 0.08);
    --btn-border: rgba(255, 255, 255, .15);
    --btn-border-hover: rgba(255, 255, 255, .35);
    --fill-hover: rgba(255, 255, 255, .04);
    --input-border: rgba(255, 255, 255, .1);
    --card-a: rgba(255, 255, 255, .035);
    --card-b: rgba(255, 255, 255, .01);
    --badge-bg: rgba(19, 22, 28, .85);
    --glow: rgba(198, 255, 61, .14);
    --stripe: rgba(255, 255, 255, .015);
}

html[data-theme="light"] {
    color-scheme: light;

    --ink-950: 246 247 249;
    --ink-900: 255 255 255;
    --ink-800: 238 240 243;
    --ink-700: 226 229 234;
    --ink-600: 207 212 220;

    --accent-600: #a8e01f;
    --accent-text: #4a7a00;

    --text-strong: #0c0e12;
    --text: #3f3f46;
    --muted: #52525b;
    --placeholder: #9ca3af;

    --border: rgba(12, 14, 18, 0.1);
    --btn-border: rgba(12, 14, 18, .18);
    --btn-border-hover: rgba(12, 14, 18, .4);
    --fill-hover: rgba(12, 14, 18, .04);
    --input-border: rgba(12, 14, 18, .14);
    --card-a: rgba(255, 255, 255, .95);
    --card-b: rgba(255, 255, 255, .6);
    --badge-bg: rgba(255, 255, 255, .9);
    --glow: rgba(150, 210, 20, .22);
    --stripe: rgba(12, 14, 18, .025);
}

body { transition: background-color .25s ease, color .25s ease; }

/* ---------- Світла тема: перевизначення жорстко заданих утиліт Tailwind ----------
   Специфічність html[data-theme] .class вища за одиночний клас Tailwind CDN,
   тому порядок підключення стилів не важливий. */
html[data-theme="light"] .text-white { color: var(--text-strong); }
html[data-theme="light"] .text-zinc-200 { color: #27272a; }
html[data-theme="light"] .text-zinc-300 { color: #3f3f46; }
html[data-theme="light"] .text-zinc-400 { color: #52525b; }
html[data-theme="light"] .text-zinc-500 { color: #71717a; }
html[data-theme="light"] .text-zinc-600 { color: #a1a1aa; }
html[data-theme="light"] .text-accent { color: var(--accent-text); }
html[data-theme="light"] .text-accent\/20 { color: rgba(106, 168, 0, .3); }
html[data-theme="light"] .text-red-300 { color: #b91c1c; }
html[data-theme="light"] .text-amber-400 { color: #d97706; }
html[data-theme="light"] .border-white\/5,
html[data-theme="light"] .border-white\/10 { border-color: var(--border); }
html[data-theme="light"] .bg-white\/5 { background-color: rgba(12, 14, 18, .05); }
html[data-theme="light"] .divide-white\/5 > :not([hidden]) ~ :not([hidden]) { border-color: var(--border); }
html[data-theme="light"] .shadow-black\/50 { --tw-shadow-color: rgba(12, 14, 18, .15); --tw-shadow: var(--tw-shadow-colored); }
html[data-theme="light"] .hover\:text-white:hover { color: var(--accent-text); }

/* Текст на акцентному фоні завжди темний (ink-950 у світлій темі — світлий колір) */
html .text-ink-950 { color: var(--accent-ink); }
html .selection\:text-ink-950 ::selection,
html .selection\:text-ink-950::selection { color: var(--accent-ink); }

/* ---------- Кнопки ---------- */
.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 1.75rem;
    border-radius: 0.875rem;
    font-weight: 700;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
    text-align: center;
}
.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 10px 30px -10px rgba(198, 255, 61, .55);
}
html[data-theme="light"] .btn-primary { box-shadow: 0 10px 30px -10px rgba(110, 170, 0, .6); }
.btn-primary:hover {
    background: var(--accent-600);
    transform: translateY(-2px);
    box-shadow: 0 16px 40px -12px rgba(198, 255, 61, .7);
}
html[data-theme="light"] .btn-primary:hover { box-shadow: 0 16px 40px -12px rgba(110, 170, 0, .75); }
.btn-primary:active { transform: translateY(0); }
.btn-primary[disabled] { opacity: .6; pointer-events: none; }

.btn-ghost {
    border: 1px solid var(--btn-border);
    color: var(--text-strong);
}
.btn-ghost:hover { border-color: var(--btn-border-hover); background: var(--fill-hover); }

/* ---------- Перемикач теми ---------- */
.theme-toggle {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: .75rem;
    border: 1px solid var(--btn-border);
    color: var(--text-strong);
    transition: border-color .2s ease, background-color .2s ease;
}
.theme-toggle:hover { border-color: var(--btn-border-hover); background: var(--fill-hover); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { grid-area: 1 / 1; width: 1.25rem; height: 1.25rem; transition: transform .35s ease, opacity .25s ease; }
/* У темній темі показуємо сонце (перейти на світлу), у світлій — місяць */
.theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg) scale(.5); }
html[data-theme="light"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg) scale(.5); }
html[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: none; }

/* ---------- Типографіка секцій ---------- */
.eyebrow {
    color: var(--accent-text);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: .75rem;
}
.section-title {
    color: var(--text-strong);
    font-size: clamp(1.9rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

/* ---------- Картки ---------- */
.card {
    position: relative;
    padding: 1.75rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--card-a), var(--card-b));
    transition: border-color .3s ease, transform .3s ease;
}
.card:hover {
    border-color: rgba(198, 255, 61, .3);
    transform: translateY(-4px);
}
html[data-theme="light"] .card:hover { border-color: rgba(106, 168, 0, .5); }

.trust-item { display: flex; align-items: center; gap: .6rem; }

.check-item {
    position: relative;
    padding-left: 2rem;
    color: var(--text);
}
.check-item::before {
    content: "";
    position: absolute;
    left: 0; top: .1rem;
    width: 1.35rem; height: 1.35rem;
    border-radius: 999px;
    background: rgba(198, 255, 61, .15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c6ff3d' stroke-width='3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / 60% no-repeat;
}
html[data-theme="light"] .check-item::before {
    background: rgba(106, 168, 0, .15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a7a00' stroke-width='3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / 60% no-repeat;
}

/* ---------- Заповнювачі зображень ----------
   Використання: <div class="img-placeholder aspect-square" data-label="Опис · розмір"></div>
   Після додавання реальних фото — видаліть div і вставте <img>. */
.img-placeholder {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    overflow: hidden;
    border: 1.5px dashed var(--btn-border);
    background:
        radial-gradient(circle at 30% 20%, rgba(198, 255, 61, .08), transparent 60%),
        repeating-linear-gradient(45deg, var(--stripe) 0 12px, transparent 12px 24px),
        rgb(var(--ink-800));
    color: #71717a;
}
.img-placeholder::before {
    content: "";
    width: 2.75rem;
    height: 2.75rem;
    max-width: 45%;
    max-height: 45%;
    opacity: .55;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='1.5'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E") center / contain no-repeat;
}
.img-placeholder::after {
    content: attr(data-label);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-align: center;
    padding: 0 1rem;
}
.img-placeholder[data-label=""]::after { display: none; }

/* ---------- Hero ---------- */
.hero-glow {
    position: absolute;
    inset: -20% -10% auto auto;
    width: 60rem;
    height: 60rem;
    max-width: 120vw;
    background: radial-gradient(circle, var(--glow) 0%, transparent 60%);
    filter: blur(20px);
    pointer-events: none;
}

.float-badge {
    position: absolute;
    display: flex;
    flex-direction: column;
    padding: .8rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    background: var(--badge-bg);
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 40px -15px rgba(0,0,0,.6);
    animation: float 5s ease-in-out infinite;
}
html[data-theme="light"] .float-badge { box-shadow: 0 20px 40px -15px rgba(12, 14, 18, .25); }
@media (max-width: 640px) {
    .float-badge { transform: scale(.85); }
    .float-badge.-left-4 { left: 0; }
}
@keyframes float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -10px; }
}

/* ---------- Галерея ---------- */
.thumb {
    aspect-ratio: 1 / 1;
    border-radius: .9rem;
    padding: 2px;
    border: 2px solid transparent;
    transition: border-color .2s ease, opacity .2s ease;
    opacity: .6;
}
.thumb:hover { opacity: 1; }
.thumb.is-active { border-color: var(--accent-text); opacity: 1; }
.thumb .img-placeholder { border-style: solid; }
.thumb .img-placeholder::before { width: 1.25rem; height: 1.25rem; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: .7rem; }

/* ---------- Форма ---------- */
.label {
    display: block;
    margin-bottom: .5rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
}
.input {
    width: 100%;
    height: 3rem;
    padding: 0 1rem;
    border-radius: .75rem;
    border: 1px solid var(--input-border);
    background: rgb(var(--ink-800));
    color: var(--text-strong);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .25s ease;
}
.input::placeholder { color: var(--placeholder); }
.input:focus {
    border-color: var(--accent-text);
    box-shadow: 0 0 0 4px rgba(198, 255, 61, .12);
}
html[data-theme="light"] .input:focus { box-shadow: 0 0 0 4px rgba(106, 168, 0, .18); }
select.input.select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2371717a' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}
select.input.select:invalid { color: var(--placeholder); }
select.input.select option { color: #111; }
.input.is-invalid { border-color: #ef4444; }
.input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(239, 68, 68, .15); }
.error-text { margin-top: .4rem; font-size: .8rem; color: #f87171; }
html[data-theme="light"] .error-text { color: #dc2626; }

.qty-btn {
    width: 2.75rem;
    height: 100%;
    font-size: 1.25rem;
    color: var(--muted);
    transition: color .2s ease;
}
.qty-btn:hover { color: var(--accent-text); }

.timer-box {
    display: flex;
    flex-direction: column;
    padding: .75rem .25rem;
    border-radius: .875rem;
    border: 1px solid var(--border);
    background: rgb(var(--ink-950));
}
.timer-box span {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.timer-box small { font-size: .7rem; color: #71717a; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- FAQ ---------- */
.faq {
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--fill-hover);
    transition: border-color .2s ease;
}
.faq[open] { border-color: rgba(198, 255, 61, .25); }
html[data-theme="light"] .faq { background: rgba(255, 255, 255, .7); }
html[data-theme="light"] .faq[open] { border-color: rgba(106, 168, 0, .45); }
.faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    font-weight: 600;
    color: var(--text-strong);
    cursor: pointer;
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq p { padding: 0 1.35rem 1.25rem; color: var(--muted); line-height: 1.65; }

/* ---------- Анімація появи при скролі ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s ease, transform .7s ease, border-color .3s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }
.card.reveal.is-visible:hover { transform: translateY(-4px); }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .float-badge { animation: none; }
    body, .theme-toggle svg { transition: none; }
}
