@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
    --page-bg: #F7F5F0;
    --surface: #FFFFFF;
    --ink: #2D2A26;
    --ink-soft: #6B6560;
    --line: rgba(45, 42, 38, 0.10);
    --field-bg: #FBFAF7;
    --divider: rgba(45, 42, 38, 0.08);
    --panel-border: rgba(45, 42, 38, 0.08);
    --panel-shadow: rgba(45, 42, 38, 0.10);
    --placeholder: #A8A29B;
    --accent: #5B7B6A;
    --accent-dark: #4A6A58;
    --accent-soft: #E8EDE9;
    --accent-warm: #C4A77D;
    --success: #5B7B6A;
    --danger: #C75B4A;
    --toggle-off-bg: #A8A29B;
    --hero-bg: #F2EFE8;
    --hero-shape: #E8EDE9;
    --hero-ink: #2D2A26;
    --hero-soft: #6B6560;
    --radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--page-bg); }

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--page-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.page-shell {
    display: grid;
    min-height: 100svh;
    padding: 16px;
    place-items: center;
}

.home-main {
    display: grid;
    width: min(100%, 1180px);
    min-height: min(720px, calc(100svh - 32px));
    grid-template-columns: minmax(0, 1.05fr) minmax(440px, 0.95fr);
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: 28px;
    background: var(--surface);
    box-shadow: 0 20px 60px var(--panel-shadow);
}

/* ===== ЛЕВАЯ КОЛОНКА ===== */
.product-intro {
    position: relative;
    display: flex;
    min-width: 0;
    padding: clamp(40px, 5vw, 64px);
    overflow: hidden;
    flex-direction: column;
    color: var(--hero-ink);
    background: var(--hero-bg);
    isolation: isolate;
}

.product-intro::after {
    position: absolute;
    z-index: -1;
    top: 0;
    right: -1px;
    width: 70%;
    height: 100%;
    background: var(--hero-shape);
    clip-path: polygon(78% 0, 100% 0, 100% 100%, 0 100%);
    opacity: 0.6;
    content: '';
}

.brand {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 12px;
    color: var(--hero-ink);
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.brand img { width: 40px; height: 40px; object-fit: contain; }
.brand strong { color: var(--accent); font-weight: 600; }

.intro-copy {
    position: relative;
    z-index: 1;
    display: flex;
    max-width: 560px;
    margin: auto 0;
    padding: 48px 0;
    flex-direction: column;
    justify-content: center;
}

.eyebrow, .step-label {
    margin: 0;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow span {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.intro-copy h1 {
    max-width: 520px;
    margin: 22px 0 0;
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 5vw, 4.6rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--hero-ink);
}

.intro-copy h1 em {
    font-style: italic;
    color: var(--accent);
}

.intro-text {
    max-width: 480px;
    margin: 24px 0 0;
    color: var(--hero-soft);
    font-size: 1rem;
    line-height: 1.7;
}

.trust-row {
    display: flex;
    margin-top: 34px;
    gap: 20px 26px;
    flex-wrap: wrap;
    color: var(--hero-ink);
    font-size: 0.82rem;
    font-weight: 500;
}

.trust-row span { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.trust-row i { color: var(--accent); font-size: 0.85rem; }

.intro-footer {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 22px;
    color: var(--hero-soft);
    font-size: 0.75rem;
}

.copyright-label, .privacy-link { padding: 0; color: inherit; text-decoration: none; }
.privacy-link { cursor: pointer; transition: color 0.2s ease; }
.privacy-link:hover { color: var(--accent); }

/* ===== ПРАВАЯ ПАНЕЛЬ ===== */
.join-panel {
    display: flex;
    min-width: 0;
    padding: clamp(32px, 4vw, 52px);
    flex-direction: column;
    background: var(--surface);
}

.panel-topbar {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.privacy-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 0.75rem;
    font-weight: 500;
}
.privacy-status i { color: var(--accent); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.topbar-btn {
    display: inline-grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink-soft);
    background: var(--field-bg);
    cursor: pointer;
    font-size: 0.82rem;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.topbar-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.panel-content {
    width: 100%;
    max-width: 500px;
    margin: auto;
    padding: 30px 0 10px;
}

.form-header { margin-bottom: 26px; }
.step-label { margin-bottom: 10px; }

.form-header h2 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 2.4vw, 2.2rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.form-header > p:last-child {
    margin: 10px 0 0;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.join-form { width: 100%; }
.input-group { margin-bottom: 20px; }

.input-group label, .media-settings legend {
    display: block;
    margin-bottom: 8px;
    color: var(--ink-soft);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.input-group label i { width: 18px; color: var(--accent); text-align: center; }

.input-container {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--field-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-container:focus-within {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-group input {
    width: 100%;
    height: 52px;
    padding: 0 52px 0 16px;
    border: 0;
    outline: none;
    color: var(--ink);
    background: transparent;
    font-size: 0.92rem;
}
.input-group input::placeholder { color: var(--placeholder); }

.input-btn {
    position: absolute;
    right: 5px;
    display: inline-grid;
    width: 40px;
    height: 40px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 10px;
    color: var(--ink-soft);
    background: transparent;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}
.input-btn:hover { color: var(--accent); background: var(--accent-soft); }
.input-group input.shuffle-active { color: var(--accent); }

.media-settings { min-width: 0; margin: 4px 0 24px; padding: 0; border: 0; }
.media-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.media-toggle-btn {
    display: grid;
    min-width: 0;
    min-height: 72px;
    padding: 10px 14px;
    grid-template-columns: 46px minmax(0, 1fr) 64px;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: var(--field-bg);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.media-toggle-btn:not(.off) { border-color: rgba(91, 123, 106, 0.35); }
.media-toggle-btn:not(.off) .media-icon { color: var(--success); background: var(--accent-soft); }
.media-toggle-btn:hover { transform: translateY(-1px); }
.media-toggle-btn:not(.off):hover { border-color: var(--success); }
.media-toggle-btn.off:hover { border-color: var(--danger); }

.media-icon, .action-icon {
    display: inline-grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 12px;
    color: var(--accent);
    background: var(--accent-soft);
    font-size: 1.05rem;
}

.toggle-state {
    position: relative;
    display: flex;
    width: 64px;
    height: 30px;
    box-sizing: border-box;
    padding: 0 32px 0 9px;
    align-items: center;
    overflow: hidden;
    border-radius: 999px;
    color: #ffffff;
    background: var(--success);
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: 0 4px 12px rgba(91, 123, 106, 0.25);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.toggle-state::after {
    position: absolute;
    top: 3px; right: 3px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    content: '';
    transition: transform 0.2s ease;
}

.media-toggle-btn.off {
    border-color: rgba(199, 91, 74, 0.25);
    background: rgba(199, 91, 74, 0.04);
}
.media-toggle-btn.off .media-icon { color: var(--danger); background: rgba(199, 91, 74, 0.1); }
.media-toggle-btn.off .toggle-state {
    padding: 0 8px 0 32px;
    justify-content: flex-end;
    background: var(--toggle-off-bg);
    box-shadow: none;
}
.media-toggle-btn.off .toggle-state::after { transform: translateX(-34px); }

.join-action {
    display: flex;
    padding: 20px 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
}

.join-action-copy { display: flex; min-width: 0; align-items: center; gap: 12px; }
.join-action-copy > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.join-action-copy strong { font-size: 0.85rem; font-weight: 600; }
.join-action-copy small {
    margin-top: 3px;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.join-button {
    display: flex;
    min-width: 148px;
    height: 44px;
    padding: 0 22px;
    align-items: center;
    justify-content: center;
    gap: 11px;
    border: 0;
    border-radius: 100px;
    color: #ffffff;
    background: var(--accent);
    box-shadow: 0 6px 16px rgba(91, 123, 106, 0.28);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.join-button:hover {
    background: var(--accent-dark);
    box-shadow: 0 10px 22px rgba(91, 123, 106, 0.35);
    transform: translateY(-1px);
}

.form-note {
    margin: 15px 0 0;
    color: var(--ink-soft);
    font-size: 0.72rem;
    line-height: 1.5;
    text-align: center;
}
.form-note i { margin-right: 5px; color: var(--accent); }

.input-btn:focus-visible,
.media-toggle-btn:focus-visible,
.join-button:focus-visible,
.topbar-btn:focus-visible,
a:focus-visible {
    outline: 3px solid var(--accent-soft);
    outline-offset: 2px;
}

@media (max-width: 980px) {
    .page-shell { padding: 0; }
    .home-main {
        width: 100%;
        min-height: 100svh;
        grid-template-columns: minmax(0, 0.9fr) minmax(430px, 1.1fr);
        border: 0;
        border-radius: 0;
    }
    .product-intro, .join-panel { padding: 40px; }
    .intro-copy h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
    .trust-row { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 760px) {
    .home-main { display: flex; flex-direction: column; }
    .product-intro { display: none; }
    .join-panel { min-height: 100svh; padding: 30px 28px 42px; }
}

@media (max-width: 480px) {
    .join-panel { padding: 26px 20px 36px; }
    .panel-content { padding-top: 34px; }
    .form-header h2 { font-size: 1.7rem; }
    .media-toggle-btn {
        min-height: 64px;
        padding: 8px 10px;
        grid-template-columns: 38px minmax(0, 1fr) 64px;
        gap: 8px;
        font-size: 0.84rem;
    }
    .media-icon { width: 38px; height: 38px; }
    .join-action { flex-direction: column; align-items: stretch; }
    .join-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
    }
}