/* === Landing page (start/menu screen) === */

/* Подключаем Inter — современный sans-serif с хорошей кириллицей.
   Файл уже лежит в fonts/backpanel/Inter.woff2 (используется editor.html). */
@font-face {
    font-family: 'LandingFont';
    src: url('../fonts/backpanel/Inter.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === Цветовые токены: светлая тема (по умолчанию) === */
:root {
    --landing-surface: rgba(255, 255, 255, 0.94);
    --landing-surface-border: rgba(0, 0, 0, 0.06);
    --landing-title: #2c2c3a;
    --landing-hint: #6b6b7a;
    --landing-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    --landing-card-hover-bg: rgba(102, 126, 234, 0.08);
    --landing-card-hover-border: rgba(102, 126, 234, 0.5);
    --landing-card-accent: #667eea;
    --landing-card-frame: #1a1a1a;
    --landing-card-frame-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    --landing-card-frame-shadow-hover: 0 8px 22px rgba(0, 0, 0, 0.5);
    --landing-card-frame-shadow-active: 0 2px 6px rgba(0, 0, 0, 0.3);
    --landing-veil: rgba(0, 0, 0, 0.08);
}

/* === Тёмная тема — переопределяем токены === */
@media (prefers-color-scheme: dark) {
    :root {
        --landing-surface: rgba(30, 30, 47, 0.94);
        --landing-surface-border: rgba(255, 255, 255, 0.08);
        --landing-title: #e0e0e0;
        --landing-hint: #a0a0b0;
        --landing-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
        --landing-card-hover-bg: rgba(160, 176, 255, 0.12);
        --landing-card-hover-border: rgba(160, 176, 255, 0.55);
        --landing-card-accent: #a0b0ff;
        --landing-card-frame: #0a0a0a;
        --landing-card-frame-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
        --landing-card-frame-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.75);
        --landing-card-frame-shadow-active: 0 2px 6px rgba(0, 0, 0, 0.55);
        --landing-veil: rgba(0, 0, 0, 0.35);
    }
}

/* === Body: фон как в editor.html — картинка back.png + затемнение === */
.landing {
    font-family: 'LandingFont', 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    background-image: url('../images/back.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

@media (max-width: 768px) {
    .landing {
        background-image: url('../images/back-mobile.png');
    }
}

@media (max-width: 480px) {
    .landing {
        background-image: url('../images/back-mobile-small.png');
    }
}

.landing::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--landing-veil);
    z-index: 0;
    transition: background 0.3s ease;
}

/* === Подложка в стиле .container из main.css === */
.landing__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
    background: var(--landing-surface);
    border: 1px solid var(--landing-surface-border);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 20px;
    box-shadow: var(--landing-shadow);
    padding: 2.5rem 2rem;
    max-width: 560px;
    width: 100%;
    color: var(--landing-title);
}

/* === SVG-плейсхолдер на карточке «Загрузить макет» использует те же
   стили рамки/тени, что и PNG-карточка (.format-card__plate выше).
   Здесь только корректировки, специфичные для inline-SVG.
   viewBox намеренно 486×110 — ровно как у plate-ru.png — соотношение
   сторон совпадает с настоящим номером (≈4.42:1). === */
.format-card--config:hover .format-card__plate--config,
.format-card--config:focus-visible .format-card__plate--config {
    box-shadow: var(--landing-card-frame-shadow-hover);
}
.format-card--config:active .format-card__plate--config {
    box-shadow: var(--landing-card-frame-shadow-active);
}

.landing__title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--landing-title);
    margin: 0;
    line-height: 1.2;
}

.landing__hint {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    color: var(--landing-hint);
    margin: 0;
}

/* === Кнопка «?» для открытия инструкции ===
   На лендинге нет других управляющих элементов, поэтому ставим её
   прямо в правый верхний угол карточки .landing__inner. */
.landing-guide-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--landing-card-frame);
    background: var(--landing-card-frame-shadow);
    color: #f1f5f9;
    font: 700 16px/1 "LandingFont", -apple-system, sans-serif;
    cursor: pointer;
    box-shadow: var(--landing-card-frame-shadow);
    transition: transform 0.1s ease, background-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.landing-guide-btn:hover { background: rgba(40, 50, 70, 0.6); }
.landing-guide-btn:active { transform: scale(0.94); }
.landing-guide-btn:focus-visible {
    outline: 2px solid var(--landing-card-accent);
    outline-offset: 3px;
}

/* === Карточка-кнопка === */
.format-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 0.5rem;
    border-radius: 14px;
    background: transparent;
    border: 2px solid transparent;
    color: inherit;
    text-decoration: none;
    /* Карточка — это и <a> («Номер РФ»), и <button> («Загрузить макет»).
       Для <button> нужны сброс font-family и явный cursor, чтобы дефолтные
       стили UA-кнопки не перебивали стили карточки. */
    font: inherit;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    max-width: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.format-card:hover,
.format-card:focus-visible {
    transform: translateY(-3px);
    background: var(--landing-card-hover-bg);
    border-color: var(--landing-card-hover-border);
}

.format-card:focus-visible {
    outline: 3px solid var(--landing-card-accent);
    outline-offset: 4px;
}

/* Анимация нажатия на тач-устройствах (мобильный). На десктопе hover уже покрывает. */
@media (hover: none) {
    .format-card:active {
        transform: scale(0.96);
        background: var(--landing-card-hover-bg);
        border-color: var(--landing-card-hover-border);
        transition-duration: 0.08s;
    }
}

/* === Рамка-табло вокруг PNG номера === */
.format-card__plate {
    display: block;
    width: clamp(220px, 60vw, 420px);
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    border: 3px solid var(--landing-card-frame);
    border-radius: 8px;
    box-shadow: var(--landing-card-frame-shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    background: #fff;
}

.format-card:hover .format-card__plate,
.format-card:focus-visible .format-card__plate {
    box-shadow: var(--landing-card-frame-shadow-hover);
}

.format-card:active .format-card__plate {
    box-shadow: var(--landing-card-frame-shadow-active);
}

.format-card__label {
    font-size: clamp(1rem, 3vw, 1.15rem);
    font-weight: 600;
    color: var(--landing-title);
}

/* Подсказка под лейблом карточки — два-три предложения с пояснением,
   что именно делает эта опция и в каких случаях подходит (или нет). */
.format-card__hint {
    font-size: 0.82rem;
    line-height: 1.4;
    font-weight: 400;
    color: var(--landing-hint);
    max-width: 36ch;
    text-align: center;
}

@media (max-width: 480px) {
    .landing__inner {
        padding: 1.75rem 1.25rem;
        gap: 1rem;
    }
    .format-card {
        padding: 0.25rem;
    }
}