@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
    color-scheme: light;
    --page-bg: #f4f1eb;
    --surface: #ffffff;
    --ink: #17181b;
    --ink-soft: #64666d;
    --line: #d9d6cf;
    --field-bg: #f8f7f4;
    --grid-line: rgba(23, 24, 27, 0.035);
    --divider: rgba(23, 24, 27, 0.12);
    --panel-border: rgba(23, 24, 27, 0.14);
    --panel-shadow: rgba(23, 24, 27, 0.12);
    --placeholder: #98999f;
    --accent: #315cf5;
    --accent-dark: #2448cc;
    --success: #16865c;
    --danger: #d94343;
    --toggle-off-bg: #64666d;
    --hero-bg: #f4f1eb;
    --hero-shape: #e7e9ef;
    --hero-ink: #17181b;
    --hero-soft: #64666d;
    --radius: 8px;
}

:root[data-theme='dark'] {
    color-scheme: dark;
    --page-bg: #151617;
    --surface: #202124;
    --ink: #f4f1eb;
    --ink-soft: #adaeb3;
    --line: #414247;
    --field-bg: #161719;
    --grid-line: rgba(255, 255, 255, 0.035);
    --divider: rgba(255, 255, 255, 0.12);
    --panel-border: rgba(255, 255, 255, 0.13);
    --panel-shadow: rgba(0, 0, 0, 0.32);
    --placeholder: #85878d;
    --accent: #7391ff;
    --accent-dark: #5d7cf1;
    --success: #4bc795;
    --danger: #ff7272;
    --toggle-off-bg: #55585e;
    --hero-bg: #0f1012;
    --hero-shape: #151b25;
    --hero-ink: #f8f7f4;
    --hero-soft: #adaeb3;
}

* {
    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:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px), var(--page-bg);
    background-size: 48px 48px;
    font-family: 'DM Sans', sans-serif;
    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}
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%, 1280px);
    min-height: min(760px, calc(100svh - 32px));
    grid-template-columns: minmax(0, 1.08fr) minmax(460px, 0.92fr);
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 28px 70px var(--panel-shadow);
}

.product-intro {
    position: relative;
    display: flex;
    min-width: 0;
    padding: clamp(42px, 5vw, 68px);
    overflow: hidden;
    flex-direction: column;
    color: var(--hero-ink);
    background: var(--hero-bg);
    isolation: isolate;
    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}
.product-intro::after {
    position: absolute;
    z-index: -1;
    top: 0;
    right: -1px;
    width: 64%;
    height: 100%;
    background: var(--hero-shape);
    clip-path: polygon(78% 0, 100% 0, 100% 100%, 0 100%);
    content: '';
    transition: background-color 0.2s ease;
}
.brand {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 11px;
    color: var(--hero-ink);
    font-family: 'Manrope', sans-serif;
    font-size: 0.94rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
}
.brand img {
    width: 34px;
    height: 34px;
}
.brand strong {
    color: var(--accent);
    font-weight: 800;
}
.intro-copy {
    position: relative;
    z-index: 1;
    display: flex;
    max-width: 610px;
    margin: auto 0;
    padding: 54px 0;
    flex-direction: column;
    justify-content: center;
}
.eyebrow,
.step-label {
    margin: 0;
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
}
.eyebrow span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 5px rgba(49, 92, 245, 0.16);
}
.intro-copy h1 {
    max-width: 570px;
    margin: 24px 0 0;
    font-family: 'Manrope', sans-serif;
    font-size: clamp(3.65rem, 5vw, 5.2rem);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: 0;
}
.intro-text {
    max-width: 520px;
    margin: 26px 0 0;
    color: var(--hero-soft);
    font-size: 1rem;
    line-height: 1.7;
}
.trust-row {
    display: flex;
    margin-top: 30px;
    gap: 26px;
    color: var(--hero-ink);
    font-size: 0.75rem;
    font-weight: 600;
}
.trust-row span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}
.trust-row i {
    color: var(--accent);
}
.intro-footer {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 22px;
    color: var(--hero-soft);
    font-size: 0.72rem;
}
.copyright-label,
.privacy-link {
    padding: 0;
    color: inherit;
    text-decoration: none;
}
.privacy-link {
    cursor: pointer;
}
.privacy-link:hover {
    color: var(--accent);
}

.join-panel {
    display: flex;
    min-width: 0;
    padding: clamp(34px, 4vw, 56px);
    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.72rem;
    font-weight: 600;
}
.privacy-status i {
    color: var(--success);
}
.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: var(--radius);
    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: 520px;
    margin: auto;
    padding: 34px 0 10px;
}
.form-header {
    margin-bottom: 28px;
}
.step-label {
    margin-bottom: 9px;
}
.form-header h2 {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    font-size: clamp(2rem, 3vw, 2.7rem);
    line-height: 1.12;
    letter-spacing: 0;
}
.form-header > p:last-child {
    margin: 9px 0 0;
    color: var(--ink-soft);
    font-size: 0.88rem;
}
.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.74rem;
    font-weight: 700;
    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 rgba(49, 92, 245, 0.12);
}
.input-group input {
    width: 100%;
    height: 52px;
    padding: 0 52px 0 15px;
    border: 0;
    outline: none;
    color: var(--ink);
    background: transparent;
    font-size: 0.9rem;
}
.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: 6px;
    color: var(--ink-soft);
    background: transparent;
    cursor: pointer;
}
.input-btn:hover {
    color: var(--accent);
    background: rgba(49, 92, 245, 0.09);
}
.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(240px, 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: 700;
    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(22, 163, 74, 0.38);
}
.media-toggle-btn:not(.off) .media-icon {
    color: var(--success);
    background: rgba(22, 163, 74, 0.1);
}
.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: 8px;
    color: var(--accent);
    background: rgba(49, 92, 245, 0.1);
    font-size: 1.1rem;
}
.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.65rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.28);
    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(15, 23, 42, 0.3);
    content: '';
    transition: transform 0.2s ease;
}
.media-toggle-btn.off {
    border-color: rgba(217, 67, 67, 0.28);
    background: rgba(217, 67, 67, 0.04);
}
.media-toggle-btn.off .media-icon {
    color: var(--danger);
    background: rgba(217, 67, 67, 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.82rem;
}
.join-action-copy small {
    margin-top: 3px;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.join-button {
    display: flex;
    min-width: 148px;
    height: 44px;
    padding: 0 15px;
    align-items: center;
    justify-content: center;
    gap: 11px;
    border: 0;
    border-radius: var(--radius);
    color: #ffffff;
    background: var(--accent);
    box-shadow: 0 8px 18px rgba(49, 92, 245, 0.2);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    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(49, 92, 245, 0.28);
    transform: translateY(-1px);
}
.form-note {
    margin: 15px 0 0;
    color: var(--ink-soft);
    font-size: 0.7rem;
    line-height: 1.45;
    text-align: center;
}
.form-note i {
    margin-right: 5px;
    color: var(--success);
}
.input-btn:focus-visible,
.media-toggle-btn:focus-visible,
.join-button:focus-visible,
.topbar-btn:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(49, 92, 245, 0.28);
    outline-offset: 2px;
}

@media (max-width: 980px) {
    .page-shell {
        padding: 0;
    }
    .home-main {
        width: 100%;
        min-height: 100svh;
        grid-template-columns: minmax(0, 0.92fr) minmax(430px, 1.08fr);
        border: 0;
        border-radius: 0;
    }
    .product-intro,
    .join-panel {
        padding: 40px;
    }
    .intro-copy h1 {
        font-size: clamp(3rem, 6vw, 4.4rem);
    }
    .trust-row {
        align-items: flex-start;
        flex-direction: column;
        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: 2rem;
    }
    .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 {
        align-items: stretch;
        flex-direction: column;
    }
    .join-button {
        width: 100%;
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
