@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: #fff;
    --ink: #17181b;
    --ink-soft: #64666d;
    --line: #d9d6cf;
    --field-bg: #f8f7f4;
    --grid-line: rgb(23 24 27 / 3.5%);
    --panel-border: rgb(23 24 27 / 14%);
    --panel-shadow: rgb(23 24 27 / 12%);
    --accent: #315cf5;
    --accent-hover: #2448cc;
    --success: #16865c;
    --hero-bg: #f4f1eb;
    --hero-shape: #e7e9ef;
}

:root[data-theme='dark'] {
    color-scheme: dark;
    --page-bg: #151617;
    --surface: #202124;
    --ink: #f4f1eb;
    --ink-soft: #adaeb3;
    --line: #414247;
    --field-bg: #161719;
    --grid-line: rgb(255 255 255 / 3.5%);
    --panel-border: rgb(255 255 255 / 13%);
    --panel-shadow: rgb(0 0 0 / 32%);
    --accent: #7391ff;
    --accent-hover: #5d7cf1;
    --success: #4bc795;
    --hero-bg: #0f1012;
    --hero-shape: #151b25;
}

* {
    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;
}
button,
input {
    font: inherit;
}
button,
a {
    -webkit-tap-highlight-color: transparent;
}
button {
    cursor: pointer;
}
button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}
.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(440px, 0.92fr);
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 28px 70px var(--panel-shadow);
}
.product-intro {
    position: relative;
    display: flex;
    min-width: 0;
    padding: clamp(36px, 5vw, 68px);
    flex-direction: column;
    overflow: hidden;
    isolation: isolate;
    background: var(--hero-bg);
}
.product-intro::after {
    position: absolute;
    z-index: -1;
    inset: 0 -1px 0 auto;
    width: 64%;
    background: var(--hero-shape);
    clip-path: polygon(78% 0, 100% 0, 100% 100%, 0 100%);
    content: '';
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    width: fit-content;
    color: var(--ink);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.04em;
}
.brand strong {
    font-weight: 800;
}
.brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: brightness(0.12);
}
:root[data-theme='dark'] .brand img {
    filter: none;
}
.intro-copy {
    margin: auto 0;
    padding: 64px 0;
}
.eyebrow,
.step-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}
.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-soft);
}
.eyebrow span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgb(22 134 92 / 10%);
}
h1 {
    margin: 24px 0 22px;
    font-family: Manrope, sans-serif;
    font-size: clamp(3rem, 5.2vw, 4.55rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.065em;
}
.intro-text {
    max-width: 340px;
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.94rem;
    line-height: 1.75;
}
.trust-row {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 27px;
    font-size: 0.7rem;
    font-weight: 600;
}
.trust-row span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.trust-row i {
    color: var(--ink-soft);
}
.intro-footer {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--ink-soft);
    font-size: 0.68rem;
}
.app-version {
    padding-left: 8px;
    border-left: 1px solid var(--line);
}
.app-version:empty {
    display: none;
}
.join-panel {
    display: flex;
    flex-direction: column;
    padding: 30px clamp(28px, 3.8vw, 50px) 40px;
    background: var(--surface);
}
.panel-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.privacy-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 0.68rem;
}
.privacy-status i {
    font-size: 5px;
    color: var(--success);
}
.topbar-actions {
    display: flex;
    gap: 6px;
}
.topbar-btn {
    display: grid;
    width: 32px;
    height: 32px;
    padding: 0;
    place-items: center;
    color: var(--ink-soft);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: 0.85rem;
}
.topbar-btn:hover {
    color: var(--ink);
    background: var(--field-bg);
    border-color: var(--line);
}
.panel-content {
    margin: auto 0;
    padding: 44px 0 18px;
}
.step-label {
    margin: 0 0 13px;
    color: var(--accent);
}
h2 {
    margin: 0;
    font-family: Manrope, sans-serif;
    font-size: clamp(1.5rem, 2.2vw, 1.9rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.05em;
}
.form-header > p:last-child {
    margin: 12px 0 0;
    color: var(--ink-soft);
    font-size: 0.8rem;
    line-height: 1.6;
}
.join-form {
    display: grid;
    gap: 20px;
    margin-top: 32px;
}
.input-group {
    display: grid;
    gap: 9px;
}
.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 600;
}
.input-group label i {
    width: 12px;
    color: var(--ink-soft);
    font-size: 0.68rem;
}
.input-container {
    display: flex;
    min-width: 0;
    align-items: center;
    background: var(--field-bg);
    border: 1px solid var(--line);
    border-radius: 5px;
}
.input-container:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(49 92 245 / 9%);
}
.input-container input {
    width: 100%;
    min-width: 0;
    height: 47px;
    padding: 0 14px;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: none;
    font-size: 0.8rem;
    text-overflow: ellipsis;
}
.input-container input::placeholder {
    color: var(--ink-soft);
    opacity: 0.8;
}
.input-btn {
    display: grid;
    flex: 0 0 36px;
    height: 36px;
    margin-right: 5px;
    padding: 0;
    place-items: center;
    color: var(--ink-soft);
    background: transparent;
    border: 0;
    border-radius: 4px;
    font-size: 0.76rem;
}
.input-btn:hover {
    color: var(--accent);
    background: var(--surface);
}
.input-btn.is-spinning i {
    animation: spin 0.6s linear infinite;
}
.input-container:has(.is-generated) {
    border-color: var(--success);
}
.join-actions {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}
.join-button {
    display: flex;
    width: 100%;
    min-height: 67px;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 5px;
    text-align: left;
    transition: background-color 0.15s ease;
}
.primary-action {
    color: #fff;
    background: #315cf5;
}
.primary-action:hover {
    background: #2448cc;
}
.secondary-action {
    color: var(--ink);
    background: var(--field-bg);
    border-color: var(--line);
}
.secondary-action:hover {
    background: var(--hero-shape);
}
.action-icon {
    display: grid;
    flex: 0 0 31px;
    height: 31px;
    place-items: center;
    border-radius: 5px;
    background: rgb(255 255 255 / 14%);
    font-size: 0.9rem;
}
.secondary-action .action-icon {
    color: var(--ink-soft);
    background: var(--surface);
}
.action-copy {
    display: grid;
    flex: 1;
    gap: 4px;
}
.action-copy strong {
    font-size: 0.78rem;
    font-weight: 700;
}
.action-copy small {
    font-size: 0.64rem;
    opacity: 0.75;
}
.join-button > i {
    font-size: 0.8rem;
}
.form-note {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    margin: 22px 0 0;
    color: var(--ink-soft);
    font-size: 0.65rem;
    line-height: 1.6;
    text-align: center;
}
.source-badge {
    display: none;
    width: fit-content;
    padding: 6px 9px;
    border-radius: 4px;
    color: var(--success);
    background: rgb(22 134 92 / 10%);
    font-size: 0.68rem;
}
.source-badge.active {
    display: inline-flex;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
@media (max-width: 960px) {
    .home-main {
        grid-template-columns: minmax(0, 1fr) minmax(390px, 1fr);
    }
    .product-intro {
        padding: 40px 32px;
    }
    h1 {
        font-size: 3.25rem;
    }
    .trust-row {
        gap: 14px;
    }
}
@media (max-width: 760px) {
    .page-shell {
        padding: 12px;
    }
    .home-main {
        min-height: auto;
        grid-template-columns: 1fr;
    }
    .product-intro {
        padding: 28px;
    }
    .brand {
        font-size: 1.1rem;
    }
    .brand img {
        width: 34px;
        height: 34px;
    }
    .intro-copy {
        padding: 30px 0;
    }
    h1 {
        margin: 18px 0;
        font-size: clamp(2.6rem, 9vw, 3.5rem);
    }
    h1 br:last-of-type {
        display: none;
    }
    .intro-text {
        max-width: 440px;
    }
    .trust-row {
        margin-top: 20px;
    }
    .intro-footer {
        display: none;
    }
    .join-panel {
        padding: 20px 28px 30px;
    }
    .panel-content {
        padding: 26px 0 0;
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
