:root {
    --bg: #ffffff;
    --bg-soft: #f7f7f6;
    --ink: #1a1a1a;
    --ink-soft: #6b6864;
    --rule: #e3e3df;
    --accent: #146EB4;
    --accent-soft: rgba(20, 110, 180, 0.08);
    --danger-bg: #fff1ef;
    --danger-line: #efb5ac;
    --danger-text: #8a2a22;
    --success-bg: #eaf6ee;
    --success-line: #b3d9be;
    --success-text: #1f5135;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
    overflow: hidden;
}

em {
    font-style: italic;
}

a {
    color: inherit;
}

.page {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 56px;
    border-bottom: 1px solid var(--rule);
    flex: 0 0 auto;
}

.top-nav .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
}

.top-nav .logo img {
    height: 32px;
    display: block;
    mix-blend-mode: multiply;
}

.top-nav .partner-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--ink-soft);
    letter-spacing: 0.1em;
}

.top-nav .partner-tag .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
    animation: pulse 1.4s ease-in-out infinite;
}

main {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    min-height: 0;
    overflow: hidden;
}

.editorial {
    padding: 64px 64px 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--rule);
    min-height: 0;
    overflow: hidden;
}

.kicker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 22px;
}

.editorial h1 {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(56px, 7.2vw, 104px);
    line-height: 1.0;
    font-weight: 400;
    margin: 0;
    letter-spacing: -0.03em;
    text-wrap: pretty;
}

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

.editorial .lede {
    max-width: 560px;
    margin-top: 22px;
    font-size: 18px;
    line-height: 1.55;
    color: var(--ink-soft);
}

.editorial .lede strong {
    color: var(--ink);
    font-weight: 400;
}

.editorial .lede em {
    color: var(--accent);
    font-style: italic;
}

.value-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--rule);
    align-items: stretch;
}

.value-card {
    padding-left: 24px;
    padding-right: 24px;
    border-right: 1px solid var(--rule);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.value-card:first-child {
    padding-left: 0;
}

.value-card:last-child {
    padding-right: 0;
    border-right: none;
}

.value-card .head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.value-card .head .label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.14em;
    color: var(--accent);
    text-transform: uppercase;
}

.value-card .headline {
    font-family: 'Instrument Serif', serif;
    font-size: 28px;
    line-height: 1.15;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.value-card .headline em {
    color: var(--accent);
    font-style: italic;
}

.value-card .caption {
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.5;
}

.right-col {
    padding: 28px 36px 16px;
    display: flex;
    flex-direction: column;
    background: var(--bg-soft);
    position: relative;
    min-height: 0;
    overflow: hidden;
}

.right-col .inner {
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.right-col h2 {
    font-family: 'Instrument Serif', serif;
    font-size: 52px;
    line-height: 1.0;
    margin: 0 0 12px;
    font-weight: 400;
}

.right-col .subtitle {
    font-size: 15px;
    color: var(--ink-soft);
    margin: 0 0 24px;
    line-height: 1.55;
}

/* Section flip — only one of these is visible at a time.
   flex: 0 0 auto so the form sizes to its own content; the shared
   .insight-block below uses flex: 1 1 0 to absorb the remaining space. */
.auth-section {
    display: none;
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 0;
}

.auth-section.is-active {
    display: flex;
}

.otp-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.field-label {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-family: 'JetBrains Mono', monospace;
}

.field input[type="email"] {
    border: none;
    border-bottom: 1.5px solid var(--ink);
    background: transparent;
    padding: 10px 0;
    font-size: 18px;
    font-family: 'Inter', sans-serif;
    color: var(--ink);
    outline: none;
    width: 100%;
    transition: border-color 0.2s ease;
}

.field input[type="email"]:focus {
    border-bottom-color: var(--accent);
}

.field input[type="email"]::placeholder {
    color: var(--ink-soft);
}

.submit-btn {
    margin-top: 4px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 15px 20px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.02em;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: filter 0.15s ease, opacity 0.2s ease;
    width: 100%;
}

.submit-btn:hover:not(:disabled) {
    filter: brightness(1.06);
}

.submit-btn:disabled {
    opacity: 0.85;
    cursor: not-allowed;
}

.submit-btn .arrow {
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.85;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 10px;
    vertical-align: -2px;
}

.form-hint {
    font-size: 12px;
    color: var(--ink-soft);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.05em;
}

/* OTP-specific */
.email-chip,
.timer {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-width: 100%;
    border: 1px solid var(--rule);
    background: rgba(255, 255, 255, 0.44);
    color: var(--ink-soft);
    padding: 9px 11px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.email-chip {
    margin-bottom: 12px;
}

.email-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timer {
    margin: 0 0 14px;
}

.timer.expired {
    background: var(--danger-bg);
    border-color: var(--danger-line);
    color: var(--danger-text);
}

.timer-value {
    color: var(--accent);
    font-weight: 500;
}

.otp-inputs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.otp-input {
    width: 100%;
    height: 56px;
    border: 1.5px solid var(--ink);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    font-weight: 500;
    outline: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
}

.otp-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.35);
}

.otp-input.filled {
    border-color: var(--accent);
    background: rgba(20, 110, 180, 0.08);
}

.otp-input.error {
    border-color: var(--danger-line);
    background: var(--danger-bg);
    color: var(--danger-text);
    animation: shake 0.25s ease-in-out;
}

.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.action-btn {
    min-height: 44px;
    border: 1px solid var(--rule);
    background: transparent;
    color: var(--ink);
    padding: 11px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.action-btn svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.action-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255, 255, 255, 0.3);
}

.action-btn:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.action-btn .spinner {
    border-color: rgba(20, 110, 180, 0.24);
    border-top-color: var(--accent);
}

/* Alerts */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid;
    font-size: 13px;
    line-height: 1.45;
    animation: rise 0.25s ease-out both;
}

.auth-alert.is-danger {
    background: var(--danger-bg);
    border-color: var(--danger-line);
    color: var(--danger-text);
}

.auth-alert.is-success {
    background: var(--success-bg);
    border-color: var(--success-line);
    color: var(--success-text);
}

.auth-alert .title {
    margin: 0 0 2px;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.auth-alert .body {
    flex: 1;
    min-width: 0;
}

.auth-alert .body p {
    margin: 0;
}

.auth-alert .close {
    border: 0;
    background: transparent;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    font-size: 18px;
}

.auth-alert .close:hover {
    opacity: 1;
}

.insight-block {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--rule);
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.insight-block .title {
    font-family: 'Instrument Serif', serif;
    font-size: 22px;
    line-height: 1.2;
    margin-bottom: 10px;
    align-self: flex-start;
}

.insight-block .title em {
    color: var(--accent);
    font-style: italic;
}

.illustration-wrap {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    max-width: 720px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.illustration-wrap svg {
    width: 100%;
    height: 100%;
    max-height: 100%;
}

.illustration-wrap .caption {
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    font-size: 9px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--ink-soft);
    letter-spacing: 0.08em;
}

footer {
    padding: 16px 48px;
    border-top: 1px solid var(--rule);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--ink-soft);
    letter-spacing: 0.05em;
    flex: 0 0 auto;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.4); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

@keyframes ill-pulse-ring {
    0% { transform: scale(0.6); opacity: 0.6; }
    100% { transform: scale(1.6); opacity: 0; }
}

@keyframes ill-orbit-rot {
    to { transform: rotate(360deg); }
}

@keyframes ill-bar-grow {
    0% { transform: scaleY(0.1); }
    50% { transform: scaleY(1); }
    100% { transform: scaleY(0.4); }
}

@keyframes ill-line-draw {
    0%, 20% { stroke-dashoffset: 95; }
    70%, 100% { stroke-dashoffset: 0; }
}

@keyframes ill-dot-slide {
    0%, 20% { transform: translate(0, 0); opacity: 0; }
    35% { opacity: 1; }
    70%, 100% { transform: translate(78px, -34px); opacity: 1; }
}

@keyframes ill-claim-in {
    0% { transform: translate(-100px, 30px); opacity: 0; }
    25% { opacity: 1; }
    70% { transform: translate(0, 0); opacity: 1; }
    90% { opacity: 0; }
    100% { transform: translate(0, 0); opacity: 0; }
}

@keyframes ill-rise {
    0% { transform: translateY(40px) scale(0.6); opacity: 0; }
    30% { opacity: 1; }
    80% { transform: translateY(-50px) scale(1); opacity: 0.5; }
    100% { transform: translateY(-80px) scale(1.1); opacity: 0; }
}

@keyframes ill-sales-arrow {
    0% { transform: translate(0, 60px); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translate(60px, -60px); opacity: 0; }
}

@keyframes ill-blink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@media (max-height: 820px) {
    .editorial { padding: 44px 56px 28px; }
    .right-col { padding: 44px 48px 28px; }
    .editorial h1 { font-size: clamp(48px, 6.4vw, 84px); }
    .editorial .lede { margin-top: 18px; font-size: 16px; }
    .right-col h2 { font-size: 44px; }
    .insight-block { margin-top: 16px; padding-top: 14px; }
    .value-grid { margin-top: 22px; padding-top: 18px; }
    .value-card .headline { font-size: 24px; }
}

@media (max-height: 680px) {
    .editorial { padding: 28px 56px 20px; }
    .right-col { padding: 28px 48px 20px; }
    .editorial h1 { font-size: clamp(40px, 5.4vw, 64px); }
    .right-col h2 { font-size: 36px; }
    .insight-block { display: none; }
}

@media (max-width: 1080px) {
    main {
        grid-template-columns: 1fr;
        overflow: auto;
    }
    .page {
        overflow: auto;
        height: auto;
        min-height: 100vh;
    }
    html, body {
        overflow: auto;
        height: auto;
    }
    .editorial {
        padding: 40px 32px;
        border-right: none;
        border-bottom: 1px solid var(--rule);
        overflow: visible;
    }
    .right-col {
        padding: 40px 32px;
        overflow: visible;
    }
    .insight-block { display: none; }
}

@media (max-width: 720px) {
    .top-nav,
    footer {
        padding: 14px 20px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .editorial,
    .right-col { padding: 32px 20px; }
    .value-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .value-card {
        padding: 0 0 18px;
        border-right: none;
        border-bottom: 1px solid var(--rule);
    }
    .value-card:last-child {
        padding-bottom: 0;
        border-bottom: none;
    }
    .right-col h2 { font-size: 36px; }
    .otp-inputs { gap: 6px; }
    .otp-input { height: 50px; font-size: 19px; }
    .action-row { grid-template-columns: 1fr; }
}
