/* ==========================================================================
   LANDING PAGE
   Публичная страница — светлая тема, адаптивная от 320px до 1920px+
   ========================================================================== */

/* --- Переменные (на public-layout, чтобы модал-overlay тоже наследовал) --- */
.public-layout {
    --l-bg: #FDFCFA;
    --l-bg-alt: #F7F5F2;
    --l-text: #18181B;
    --l-text-sub: #71717A;
    --l-text-muted: #A1A1AA;
    --l-purple: #3B82F6;
    --l-purple-deep: #2563EB;
    --l-purple-light: #60A5FA;
    --l-green: #14B8A6;
    --l-pink: #F472B6;
    --l-amber: #F59E0B;
    --l-blue: #3B82F6;
    --l-red: #EF4444;
    --l-radius: 14px;
    --l-radius-lg: 20px;
    --l-radius-xl: 24px;
    --l-font-heading: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    --l-font-body: 'Inter', system-ui, sans-serif;
}

/* --- Базовый класс иконок --- */
.l-icon {
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==========================================================================
   AUTH MODAL (регистрация / логин)
   ========================================================================== */

.l-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #00000050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.l-modal {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: 0 16px 48px #00000030;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.l-modal__close {
    display: flex;
    justify-content: flex-end;
}

.l-modal__close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--l-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.l-modal__close-btn:hover {
    color: var(--l-text);
}

.l-modal__close-icon {
    width: 24px;
    height: 24px;
}

.l-modal__title {
    font-family: var(--l-font-heading);
    font-weight: 800;
    font-size: 28px;
    color: var(--l-text);
    text-align: center;
}

.l-modal__sub {
    font-size: 15px;
    color: var(--l-text-sub);
    text-align: center;
}

/* Поля формы */
.l-modal__fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.l-modal__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.l-modal__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--l-text);
}

.l-modal__input-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--l-bg-alt);
    border: 1px solid #E4E4E7;
    border-radius: 12px;
    transition: border-color 0.15s, background 0.15s;
}

.l-modal__input-wrap:focus-within {
    border-color: var(--l-purple);
    background: var(--l-bg);
}

.l-modal__input-wrap--error {
    background: #FEF2F2;
    border-color: var(--l-red);
}

.l-modal__input-wrap--error:focus-within {
    border-color: var(--l-red);
    background: #FEF2F2;
}

.l-modal__input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--l-font-body);
    font-size: 15px;
    color: var(--l-text);
    outline: none;
}

.l-modal__input::placeholder {
    color: var(--l-text-muted);
}

.l-modal__eye-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--l-text-muted);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 8px;
}

.l-modal__eye-icon {
    width: 20px;
    height: 20px;
}

.l-modal__error {
    display: flex;
    align-items: center;
    gap: 6px;
}

.l-modal__error-icon {
    width: 14px;
    height: 14px;
    stroke: var(--l-red);
    flex-shrink: 0;
}

.l-modal__error-text {
    font-size: 13px;
    color: var(--l-red);
}

/* Поля кода подтверждения */
.l-modal__code-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.l-modal__code-digit {
    width: 48px;
    height: 56px;
    border: 1px solid #E4E4E7;
    border-radius: 12px;
    background: var(--l-bg-alt);
    font-family: var(--l-font-body);
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: var(--l-text);
    outline: none;
    transition: border-color 0.15s;
}

.l-modal__code-digit:focus {
    border-color: var(--l-purple);
    background: var(--l-bg);
}

/* Кнопка submit */
.l-modal__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    background: var(--l-purple);
    color: #fff;
    font-family: var(--l-font-body);
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.l-modal__submit:hover {
    background: var(--l-purple-deep);
}

/* Разделитель «или» */
.l-modal__divider {
    display: flex;
    align-items: center;
    gap: 12px;
}

.l-modal__divider-line {
    flex: 1;
    height: 1px;
    background: #E4E4E7;
}

.l-modal__divider-text {
    font-size: 13px;
    color: var(--l-text-muted);
}

/* Соцкнопки */
.l-modal__socials {
    display: flex;
    gap: 12px;
}

.l-modal__social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: 12px;
    font-family: var(--l-font-body);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
}

.l-modal__social-btn:hover {
    opacity: 0.9;
}

.l-modal__social-btn--google {
    background: #fff;
    color: var(--l-text);
    border: 1px solid #E4E4E7;
}

.l-modal__social-btn--google .l-modal__social-icon {
    color: #4285F4;
    font-weight: 700;
    font-size: 18px;
}

.l-modal__social-btn--facebook {
    background: #1877F2;
    color: #fff;
}

.l-modal__social-btn--facebook .l-modal__social-icon {
    font-weight: 700;
    font-size: 18px;
}

/* Ссылка переключения */
.l-modal__switch {
    font-size: 14px;
    color: var(--l-purple);
    text-align: center;
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--l-font-body);
}

.l-modal__switch:hover {
    text-decoration: underline;
}

/* Мобильная адаптация модала */
@media (max-width: 480px) {
    .l-modal {
        padding: 24px;
        gap: 20px;
        border-radius: 16px;
    }

    .l-modal__title {
        font-size: 24px;
    }

    .l-modal__socials {
        flex-direction: column;
    }
}

/* --- Public layout: сброс ограничений #app (600px max-width, тёмный фон) --- */
#app:has(.public-layout) {
    max-width: none;
    background: #FDFCFA;
    overflow: visible;
}

body:has(.public-layout) {
    background: #FDFCFA;
}

.public-layout {
    background: #FDFCFA;
    min-height: 100vh;
    width: 100%;
}

/* --- Контейнер --- */
.landing {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--l-bg);
    color: var(--l-text);
    font-family: var(--l-font-body);
    overflow-x: hidden;
}

/* --- Секция --- */
.l-section {
    padding: 48px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.l-section--alt {
    background: var(--l-bg-alt);
}

/* --- Типография --- */
.l-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #F3F0FF;
    border: 1px solid #E9E5FF;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: var(--l-purple);
}

.l-badge__emoji {
    font-style: normal;
}

.l-title {
    font-family: var(--l-font-heading);
    font-weight: 800;
    font-size: 32px;
    line-height: 1.15;
    text-align: center;
    color: var(--l-text);
}

.l-subtitle {
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
    color: var(--l-text-sub);
    max-width: 600px;
}

.l-section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--l-radius-lg);
    flex-shrink: 0;
}

.l-section-title {
    font-family: var(--l-font-heading);
    font-weight: 800;
    font-size: 24px;
    line-height: 1.2;
    text-align: center;
    color: var(--l-text);
}

.l-section-desc {
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
    color: var(--l-text-sub);
}

/* --- CTA кнопка --- */
.l-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--l-purple);
    color: #fff;
    border-radius: var(--l-radius);
    font-family: var(--l-font-body);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.l-cta:hover {
    background: var(--l-purple-deep);
    transform: translateY(-1px);
}

.l-cta--white {
    background: #fff;
    color: var(--l-purple);
}

.l-cta--white:hover {
    background: #F3F0FF;
}

.l-cta__arrow {
    width: 20px;
    height: 20px;
}

/* --- Hero --- */
.l-hero {
    padding: 48px 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: var(--l-bg);
}

.l-hero__text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.l-cta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.l-cta-sub {
    display: none;
}

/* --- Карточки слов (визуал) --- */
.l-words-visual {
    position: relative;
    width: 100%;
    height: 240px;
}

.l-word-card {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 16px;
    min-width: 130px;
}

.l-word-card__word {
    font-family: var(--l-font-heading);
    font-size: 18px;
    font-weight: 700;
}

.l-word-card__trans {
    font-size: 13px;
    color: var(--l-text-sub);
}

.l-word-card--1 { left: 5%; top: 15px;  box-shadow: 0 4px 12px #60A5FA20; }
.l-word-card--1 .l-word-card__word { color: var(--l-purple-light); }

.l-word-card--2 { right: 5%; top: 0; box-shadow: 0 4px 12px #14B8A620; }
.l-word-card--2 .l-word-card__word { color: var(--l-green); }

.l-word-card--3 { left: 8%; top: 120px; box-shadow: 0 4px 12px #F472B620; }
.l-word-card--3 .l-word-card__word { color: var(--l-pink); }

.l-word-card--4 { right: 5%; top: 105px; box-shadow: 0 4px 12px #F59E0B20; }
.l-word-card--4 .l-word-card__word { color: var(--l-amber); }

/* 5-я карточка — только на десктопе */
.l-word-card--5 { display: none; box-shadow: 0 4px 12px #3B82F620; }
.l-word-card--5 .l-word-card__word { color: var(--l-blue); }

.l-flag-circle {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(180deg, #C6363C 33%, #21357E 33% 66%, #FFFFFF 66%);
    box-shadow: 0 4px 16px #60A5FA40;
}

/* --- Секционная картинка --- */
.l-section-img {
    width: 100%;
    border-radius: var(--l-radius-lg);
    object-fit: cover;
    display: block;
    height: auto;
}

/* --- Feature карточки (обучение в игре) --- */
.l-feature-cards {
    display: flex;
    gap: 12px;
    width: 100%;
}

.l-feature-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: #fff;
    border-radius: 16px;
    text-align: center;
}

.l-feature-card__icon {
    width: 32px;
    height: 32px;
}

.l-feature-card__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--l-text);
}

/* --- Feature items (книги, шаги) --- */
.l-feature-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.l-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--l-radius);
    background: #F3F1EE;
}

.l-feature-item__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.l-feature-item__text {
    font-size: 14px;
    font-weight: 500;
    color: var(--l-text);
}

/* --- Шаги (персональная программа) --- */
.l-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.l-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-radius: var(--l-radius);
}

.l-step__num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--l-radius);
    background: var(--l-purple-light);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.l-step__text {
    font-size: 14px;
    font-weight: 500;
    color: var(--l-text);
}

/* --- SM-2 карточки демо --- */
.l-sm2-visual {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
}

.l-sm2-main {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 18px;
    background: #fff;
    border-radius: var(--l-radius-lg);
    box-shadow: 0 6px 24px #60A5FA30;
    width: 200px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.l-sm2-main__word {
    font-family: var(--l-font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--l-purple-light);
    text-align: center;
}

.l-sm2-main__trans {
    font-size: 16px;
    color: var(--l-text-sub);
    text-align: center;
}

.l-sm2-main__badge {
    display: inline-flex;
    padding: 4px 12px;
    background: #E8FFF0;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: #22C55E;
}

.l-sm2-float {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    background: #fff;
    border-radius: var(--l-radius);
    z-index: 1;
}

.l-sm2-float__word {
    font-family: var(--l-font-heading);
    font-size: 15px;
    font-weight: 700;
}

.l-sm2-float__trans {
    font-size: 11px;
    color: var(--l-text-sub);
}

.l-sm2-float__badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 600;
    width: fit-content;
}

.l-sm2-float--1 { left: 3%;  top: 10px;  box-shadow: 0 4px 14px #F472B620; }
.l-sm2-float--1 .l-sm2-float__word { color: var(--l-pink); }
.l-sm2-float--1 .l-sm2-float__badge { background: #FFF0F6; color: var(--l-pink); }

.l-sm2-float--2 { right: 3%; top: 5px;   box-shadow: 0 4px 14px #14B8A620; }
.l-sm2-float--2 .l-sm2-float__word { color: var(--l-green); }
.l-sm2-float--2 .l-sm2-float__badge { background: #E8FFF0; color: var(--l-green); }

.l-sm2-float--3 { left: 2%;  bottom: 40px; box-shadow: 0 4px 14px #3B82F620; }
.l-sm2-float--3 .l-sm2-float__word { color: var(--l-blue); }
.l-sm2-float--3 .l-sm2-float__badge { background: #DBEAFE; color: var(--l-blue); }

.l-sm2-float--4 { right: 2%; bottom: 30px; box-shadow: 0 4px 14px #F59E0B20; }
.l-sm2-float--4 .l-sm2-float__word { color: var(--l-amber); }
.l-sm2-float--4 .l-sm2-float__badge { background: #FFF7ED; color: var(--l-amber); }

.l-sm2-float--5 { left: 25%; bottom: 0;    box-shadow: 0 4px 14px #EF444420; }
.l-sm2-float--5 .l-sm2-float__word { color: var(--l-red); }
.l-sm2-float--5 .l-sm2-float__badge { background: #FEE2E2; color: var(--l-red); }

/* --- Footer CTA --- */
.l-footer-cta {
    padding: 60px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: linear-gradient(180deg, #60A5FA 0%, #2563EB 100%);
    text-align: center;
}

.l-footer-cta__title {
    font-family: var(--l-font-heading);
    font-weight: 800;
    font-size: 28px;
    line-height: 1.2;
    color: #fff;
}

.l-footer-cta__sub {
    font-size: 14px;
    line-height: 1.5;
    color: #FFFFFFCC;
    max-width: 500px;
}

.l-footer-cta__copy {
    font-size: 12px;
    color: #FFFFFF99;
}

/* --- Двухколоночный layout (текст + визуал) --- */
.l-two-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

/* Мобильный: текст всегда первый, визуал второй (как в Pencil-макете) */
.l-two-col__text {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    order: 1;
}

.l-two-col__visual {
    width: 100%;
    order: 2;
}

/* ==========================================================================
   TABLET (≥ 768px)
   ========================================================================== */
@media (min-width: 768px) {
    .l-section {
        padding: 64px 48px;
        gap: 24px;
    }

    .l-hero {
        padding: 64px 48px 48px;
        gap: 24px;
    }

    .l-title {
        font-size: 42px;
    }

    .l-subtitle {
        font-size: 17px;
    }

    .l-section-title {
        font-size: 30px;
    }

    .l-section-desc {
        font-size: 16px;
    }

    .l-words-visual {
        height: 340px;
        max-width: 600px;
        margin: 0 auto;
    }

    .l-word-card {
        padding: 14px 18px;
    }

    .l-word-card__word { font-size: 20px; }

    .l-word-card--1 { top: 30px; }
    .l-word-card--2 { top: 10px; }
    .l-word-card--3 { top: 160px; }
    .l-word-card--4 { top: 140px; }

    .l-flag-circle {
        width: 70px;
        height: 70px;
        top: 110px;
    }

    .l-sm2-visual {
        height: 420px;
        max-width: 600px;
        margin: 0 auto;
    }

    .l-sm2-main {
        width: 240px;
        padding: 24px 22px;
    }

    .l-sm2-main__word { font-size: 32px; }

    .l-footer-cta {
        padding: 80px 48px;
        gap: 24px;
    }

    .l-footer-cta__title {
        font-size: 36px;
    }

    .l-footer-cta__sub {
        font-size: 16px;
    }

    .l-section-img {
        max-height: 320px;
    }
}

/* ==========================================================================
   DESKTOP (≥ 1024px)
   ========================================================================== */
@media (min-width: 1024px) {
    .l-section {
        padding: 80px 120px;
        gap: 32px;
    }

    .l-hero {
        flex-direction: row;
        align-items: center;
        padding: 0 120px;
        min-height: 700px;
        gap: 80px;
    }

    .l-hero .l-hero__text {
        text-align: left;
        align-items: flex-start;
    }

    .l-title {
        font-size: 56px;
        text-align: left;
    }

    .l-hero .l-subtitle {
        text-align: left;
        font-size: 18px;
    }

    .l-hero .l-cta-row {
        justify-content: flex-start;
    }

    .l-cta-sub {
        display: inline;
    }

    .l-hero__text {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 28px;
    }

    .l-hero__visual {
        flex: 0 0 600px;
        width: 600px;
    }

    /* Сброс мобильного order */
    .l-two-col__text { order: unset; }
    .l-two-col__visual { order: unset; }

    .l-words-visual {
        height: 500px;
        max-width: none;
    }

    .l-word-card {
        padding: 16px 20px;
        border-radius: var(--l-radius-lg);
        min-width: 160px;
    }

    .l-word-card__word { font-size: 24px; }
    .l-word-card__trans { font-size: 15px; }

    .l-word-card--1 { left: 30px;  top: 40px; }
    .l-word-card--2 { right: 30px; top: 20px; }
    .l-word-card--3 { left: 60px;  top: 200px; }
    .l-word-card--4 { right: 50px; top: 180px; }
    .l-word-card--5 { display: flex; left: 50%; transform: translateX(-50%); top: 340px; }

    .l-flag-circle {
        width: 70px;
        height: 70px;
        top: 130px;
        border: 4px solid #fff;
        box-shadow: 0 4px 16px #00000020;
    }

    /* Двухколоночные секции */
    .l-two-col {
        flex-direction: row;
        gap: 80px;
        align-items: center;
    }

    .l-two-col--reverse {
        flex-direction: row-reverse;
    }

    .l-two-col__text {
        flex: 1;
        align-items: flex-start;
    }

    .l-two-col__text .l-section-title,
    .l-two-col__text .l-section-desc {
        text-align: left;
    }

    .l-two-col__visual {
        flex: 0 0 500px;
        width: 500px;
    }

    .l-section-title {
        font-size: 36px;
    }

    .l-section-desc {
        font-size: 17px;
        line-height: 1.7;
    }

    .l-section-img {
        max-height: 400px;
        border-radius: var(--l-radius-xl);
    }

    .l-feature-cards {
        gap: 16px;
    }

    .l-feature-card {
        padding: 20px;
        gap: 10px;
    }

    .l-feature-item {
        padding: 14px 18px;
    }

    .l-step {
        padding: 14px 18px;
        gap: 14px;
    }

    .l-sm2-visual {
        height: 480px;
        max-width: none;
    }

    .l-sm2-main {
        width: 360px;
        padding: 32px 28px;
    }

    .l-sm2-main__word { font-size: 42px; }
    .l-sm2-main__trans { font-size: 22px; }

    .l-sm2-float {
        padding: 12px 16px;
        border-radius: 16px;
    }

    .l-sm2-float__word { font-size: 18px; }
    .l-sm2-float__trans { font-size: 13px; }

    .l-sm2-float--1 { left: 10px;  top: 10px; }
    .l-sm2-float--2 { right: 0;    top: 5px; }
    .l-sm2-float--3 { left: 0;     bottom: 60px; }
    .l-sm2-float--4 { right: 0;    bottom: 50px; }
    .l-sm2-float--5 { left: 190px; bottom: 10px; }

    .l-footer-cta {
        padding: 80px 120px;
    }

    .l-footer-cta__title {
        font-size: 42px;
    }

    .l-footer-cta__sub {
        font-size: 18px;
        max-width: 600px;
    }

    .l-cta-row {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .l-cta-sub {
        font-size: 14px;
        color: var(--l-text-muted);
    }
}
