/*
 * Homepage and invited-account login contract.
 * Sources:
 * - /Users/ericliu/Downloads/design-system_5.html
 * - /Users/ericliu/Downloads/landing-page_2.html
 *
 * Scoped to #loginScreen so the authenticated application remains a separate
 * implementation slice.
 */

#loginScreen {
    --landing-red-700: #7C0C1E;
    --landing-red-600: #9E0F26;
    --landing-red-500: #BE132D;
    --landing-red-400: #CE3F52;
    --landing-red-300: #E2717F;
    --landing-red-50: #FCECEE;
    --landing-teal-500: #0E8074;
    --landing-teal-300: #5FBBAA;
    --landing-slate-500: #46536B;
    --landing-warn: #B8720B;
    --landing-bg: #F5F6FB;
    --landing-surface: #FFFFFF;
    --landing-ink: #14161F;
    --landing-ink-700: #3F4350;
    --landing-ink-500: #6B7280;
    --landing-ink-300: #9CA3AF;
    --landing-line: #EDEEF3;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    overflow-x: hidden;
    color: var(--landing-ink);
    background: var(--landing-bg);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

#loginScreen::before {
    display: none;
}

#loginScreen button,
#loginScreen input {
    font: inherit;
}

#loginScreen button:focus-visible,
#loginScreen input:focus-visible {
    outline: 3px solid rgba(190, 19, 45, .24);
    outline-offset: 2px;
}

#loginScreen .kepler-home {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    margin: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#loginScreen .kepler-home-nav {
    width: 100%;
    height: auto;
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 26px 64px;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#loginScreen .kepler-home-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--landing-ink);
}

#loginScreen .kepler-home-mark,
#loginScreen .login-modal-brand > span {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--landing-surface);
}

#loginScreen .kepler-brand-glyph {
    width: 78%;
    height: 78%;
    fill: none;
    stroke: var(--landing-red-500);
    stroke-width: 7.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#loginScreen .kepler-brand-glyph .accent {
    fill: var(--landing-teal-500);
    stroke: none;
}

#loginScreen .kepler-home-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
}

#loginScreen .kepler-home-brand strong {
    color: var(--landing-ink);
    font-size: 14.5px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .02em;
}

#loginScreen .kepler-home-nav-action,
#loginScreen .kepler-home-primary {
    border: 1px solid transparent;
    border-radius: 30px;
    color: #fff;
    background: linear-gradient(135deg, var(--landing-red-600), var(--landing-red-400));
    font-weight: 600;
    cursor: pointer;
}

#loginScreen .kepler-home-nav-action {
    height: auto;
    padding: 10px 22px;
    font-size: 13px;
}

#loginScreen .kepler-home-hero {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    padding: 40px 64px;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

#loginScreen .kepler-home-hero::before,
#loginScreen .kepler-home-hero::after {
    display: none;
}

#loginScreen .kepler-home-copy {
    min-height: 0;
    display: block;
    max-width: 560px;
    position: relative;
    z-index: 3;
}

#loginScreen .kepler-home-eyebrow {
    display: block;
    margin: 0 0 18px;
    color: var(--landing-red-600);
    font-size: 11px;
    line-height: 1.6;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

#loginScreen .kepler-home-copy h1 {
    max-width: none;
    margin: 0 0 24px;
    color: var(--landing-ink);
    font-family: inherit;
    font-size: clamp(48px, 4vw, 56px);
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -.01em;
}

#loginScreen .kepler-title-line {
    white-space: nowrap;
}

#loginScreen .kepler-title-red {
    color: var(--landing-red-500);
}

#loginScreen .kepler-title-teal {
    color: var(--landing-teal-500);
}

#loginScreen .kepler-home-lead {
    max-width: 420px;
    margin: 0 0 34px;
    color: var(--landing-ink-500);
    font-size: 17px;
    line-height: 1.7;
}

#loginScreen .kepler-home-actions {
    display: flex;
    justify-content: flex-start;
}

#loginScreen .kepler-home-primary {
    width: auto;
    height: auto;
    padding: 13px 26px;
    box-shadow: 0 14px 30px -14px rgba(190, 19, 45, .6);
    font-size: 13.5px;
    font-weight: 700;
}

#loginScreen .kepler-home-art {
    height: 560px;
    position: relative;
    z-index: 1;
}

#loginScreen .kepler-home-art > svg {
    width: 640px;
    height: 640px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-46%, -50%);
}

#loginScreen .kepler-home-spark {
    position: absolute;
    display: block;
    border-radius: 50%;
    background: var(--landing-red-400);
    opacity: .5;
}

#loginScreen .spark-a { width: 4px; height: 4px; top: 14%; left: 62%; }
#loginScreen .spark-b { width: 3px; height: 3px; top: 70%; left: 20%; }
#loginScreen .spark-c { width: 5px; height: 5px; top: 30%; left: 80%; }
#loginScreen .spark-d { width: 3px; height: 3px; top: 82%; left: 55%; }
#loginScreen .spark-e { width: 3px; height: 3px; top: 22%; left: 22%; }

#loginScreen .kepler-home-footer {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 64px;
    margin: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--landing-ink-500);
    font-size: 12px;
    line-height: 1.6;
}

#loginScreen .login-panel-shell {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    background: rgba(20, 10, 12, .55);
    backdrop-filter: blur(6px);
    transition: opacity .2s ease, visibility 0s linear .2s;
}

#loginScreen .login-panel-shell.open {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transition-delay: 0s;
}

#loginScreen .login-panel-shell.hidden {
    display: none;
}

#loginScreen .login-panel {
    width: 392px;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    position: relative;
    padding: 0 34px 32px;
    border: 0;
    border-radius: 24px;
    color: var(--landing-ink);
    background: var(--landing-surface);
    box-shadow: 0 40px 80px -24px rgba(30, 5, 10, .45);
    opacity: 0;
    transform: translateY(14px) scale(.97);
    transition:
        transform .22s cubic-bezier(.2, .9, .3, 1.2),
        opacity .2s ease;
}

#loginScreen .login-panel-shell.open .login-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
}

#loginScreen .login-modal-topbar {
    height: 6px;
    margin: 0 -34px 26px;
    background: linear-gradient(90deg, var(--landing-red-600), var(--landing-red-400) 55%, var(--landing-teal-500));
}

#loginScreen .login-modal-glow {
    width: 220px;
    height: 220px;
    position: absolute;
    top: -90px;
    right: -70px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(190, 19, 45, .1), transparent 70%);
}

#loginScreen .login-modal-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 22px;
    position: relative;
    z-index: 1;
}

#loginScreen .login-modal-brand > span {
    width: 40px;
    height: 40px;
    border-radius: 11px;
}

#loginScreen .login-modal-brand strong {
    font-size: 13px;
    font-weight: 700;
}

#loginScreen .login-panel-head {
    display: block;
    margin-bottom: 22px;
}

#loginScreen .login-panel-title {
    color: var(--landing-ink);
    font-family: inherit;
    font-size: 19px;
    line-height: 1.3;
    font-weight: 800;
}

#loginScreen .login-panel-subtitle {
    margin-top: 5px;
    color: var(--landing-ink-500);
    font-size: 12px;
    line-height: 1.6;
    font-weight: 400;
}

#loginScreen .login-panel-close {
    width: 30px;
    height: 30px;
    position: absolute;
    top: 20px;
    right: 18px;
    z-index: 2;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: var(--landing-ink-500);
    background: var(--landing-bg);
}

#loginScreen .login-panel-close svg {
    width: 15px;
    height: 15px;
}

#loginScreen .login-mode-label {
    margin-bottom: 22px;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--landing-ink);
    background: var(--landing-surface);
    box-shadow: 0 1px 2px rgba(20, 10, 10, .08);
    outline: 4px solid var(--landing-bg);
    font-size: 12px;
    line-height: 1.6;
    font-weight: 700;
    text-align: center;
}

#loginScreen .login-field {
    margin-bottom: 14px;
}

#loginScreen .login-form label {
    margin: 0 0 6px;
    color: var(--landing-ink-500);
    font-size: 11px;
    line-height: 1.5;
    font-weight: 500;
}

#loginScreen .login-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border: 1px solid var(--landing-line);
    border-radius: 11px;
    background: #fff;
}

#loginScreen .login-input-wrap:focus-within {
    border-color: var(--landing-red-500);
}

#loginScreen .login-input-wrap > svg,
#loginScreen .login-password-toggle svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    fill: none;
    stroke: var(--landing-ink-300);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#loginScreen .login-form .login-input-wrap input {
    min-width: 0;
    flex: 1;
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    outline: 0;
    box-shadow: none;
    color: var(--landing-ink);
    background: transparent;
    font-size: 12.5px;
}

#loginScreen .login-form .login-input-wrap input::placeholder {
    color: #B4B8C2;
}

#loginScreen .login-password-toggle {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

#loginScreen .login-password-toggle[aria-pressed="true"] .eye-slash {
    display: none;
}

#loginScreen .login-submit {
    width: 100%;
    height: auto;
    margin-top: 6px;
    padding: 12px 0;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: var(--landing-red-600);
    font-size: 13.5px;
    line-height: 1.4;
    font-weight: 700;
    cursor: pointer;
}

#loginScreen .login-submit:hover {
    background: var(--landing-red-500);
}

#loginScreen .login-submit:disabled {
    cursor: wait;
    opacity: .68;
}

#loginScreen .login-message {
    min-height: 20px;
    margin-top: 12px;
    color: var(--landing-ink-500);
    font-size: 12px;
    line-height: 1.5;
}

#loginScreen .login-message.error { color: var(--landing-red-500); }
#loginScreen .login-message.success,
#loginScreen .login-message.info { color: var(--landing-teal-500); }

#loginScreen .login-note {
    margin-bottom: 16px;
    padding: 10px 12px;
    border: 1px solid rgba(14, 128, 116, .22);
    border-radius: 8px;
    color: var(--landing-teal-500);
    background: rgba(228, 243, 240, .72);
    font-size: 12px;
}

#loginScreen .login-legal {
    margin-top: 14px;
    color: var(--landing-ink-500);
    font-size: 12px;
    line-height: 1.6;
}

#loginScreen .login-legal button {
    color: var(--landing-red-600);
    font-size: 12px;
    font-weight: 600;
}

#loginScreen .login-record {
    margin-top: 8px;
    color: var(--landing-ink-500);
    font-size: 11px;
    line-height: 1.5;
}

@media (max-width: 1000px) {
    #loginScreen .kepler-home-nav,
    #loginScreen .kepler-home-hero,
    #loginScreen .kepler-home-footer {
        padding-left: 32px;
        padding-right: 32px;
    }

    #loginScreen .kepler-home-copy h1 {
        font-size: clamp(42px, 5.4vw, 56px);
    }

    #loginScreen .kepler-title-line {
        white-space: normal;
    }

    #loginScreen .kepler-home-art > svg {
        width: min(640px, 58vw);
        height: min(640px, 58vw);
    }
}

@media (max-width: 700px) {
    #loginScreen .kepler-home-nav {
        min-height: 72px;
        padding: 20px;
    }

    #loginScreen .kepler-home-hero {
        grid-template-columns: minmax(0, 1fr);
        align-content: center;
        gap: 8px;
        padding: 28px 20px 16px;
    }

    #loginScreen .kepler-home-copy {
        max-width: 100%;
    }

    #loginScreen .kepler-home-eyebrow {
        margin-bottom: 12px;
    }

    #loginScreen .kepler-home-copy h1 {
        margin-bottom: 16px;
        font-size: clamp(38px, 12vw, 48px);
        line-height: 1.12;
    }

    #loginScreen .kepler-home-lead {
        margin-bottom: 22px;
        font-size: 15px;
    }

    #loginScreen .kepler-home-art {
        height: 238px;
        overflow: hidden;
    }

    #loginScreen .kepler-home-art > svg {
        width: 300px;
        height: 300px;
        transform: translate(-50%, -50%);
    }

    #loginScreen .kepler-home-footer {
        min-height: 68px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
        padding: 16px 20px;
    }

    #loginScreen .login-panel-shell {
        align-items: center;
        padding: 20px;
    }

    #loginScreen .login-panel {
        width: 100%;
        max-height: calc(100dvh - 40px);
        overflow-y: auto;
        padding-right: 24px;
        padding-bottom: 26px;
        padding-left: 24px;
    }

    #loginScreen .login-modal-topbar {
        margin-right: -24px;
        margin-left: -24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #loginScreen .login-panel-shell,
    #loginScreen .login-panel {
        transition: none;
    }
}
