:root {
    --navy-950: #071628;
    --navy-900: #0b2139;
    --navy-800: #12324f;
    --blue-600: #1676d2;
    --blue-500: #258be8;
    --teal-400: #39d2bd;
    --slate-900: #172435;
    --slate-600: #607084;
    --slate-400: #94a2b4;
    --slate-200: #dbe3ec;
    --slate-100: #edf2f7;
    --white: #ffffff;
    --danger: #ba2f38;
    --danger-bg: #fff1f2;
    --focus: rgba(37, 139, 232, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    color: var(--slate-900);
    background: var(--white);
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
}

button,
input {
    font: inherit;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(420px, 46%) 1fr;
}

.brand-panel {
    position: relative;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 48px clamp(36px, 5vw, 76px) 34px;
    color: var(--white);
    background:
        radial-gradient(circle at 15% 7%, rgba(37, 139, 232, 0.26), transparent 34%),
        radial-gradient(circle at 92% 77%, rgba(57, 210, 189, 0.17), transparent 31%),
        linear-gradient(145deg, var(--navy-950), var(--navy-800));
}

.brand-panel::before,
.brand-panel::after {
    position: absolute;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 50%;
}

.brand-panel::before {
    width: 440px;
    height: 440px;
    right: -260px;
    top: -170px;
}

.brand-panel::after {
    width: 300px;
    height: 300px;
    left: -180px;
    bottom: -120px;
}

.brand-content,
.brand-footer {
    position: relative;
    z-index: 1;
}

.brand,
.mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    font-size: 25px;
    font-weight: 750;
    letter-spacing: -0.7px;
    text-decoration: none;
}

.brand > span:last-child > span,
.mobile-brand > span:last-child > span {
    color: var(--teal-400);
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--blue-500), #1b65b6);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.brand-mark svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: var(--white);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.8;
}

.brand-mark .accent {
    stroke: var(--teal-400);
}

.brand-copy {
    max-width: 590px;
    margin-top: clamp(80px, 12vh, 140px);
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--teal-400);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.brand-copy h1 {
    max-width: 570px;
    margin: 0;
    font-size: clamp(38px, 4.4vw, 62px);
    font-weight: 720;
    letter-spacing: -0.055em;
    line-height: 1.03;
}

.brand-description {
    max-width: 510px;
    margin: 24px 0 0;
    color: #b9c9d9;
    font-size: 17px;
    line-height: 1.65;
}

.pipeline-preview {
    max-width: 520px;
    margin-top: clamp(48px, 8vh, 90px);
    padding: 22px 24px 25px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.055);
    box-shadow: 0 22px 45px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(8px);
}

.preview-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #d6e0eb;
    font-size: 13px;
    font-weight: 650;
}

.preview-live {
    color: #a8eadf;
    font-size: 11px;
    text-transform: uppercase;
}

.preview-live i {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    background: var(--teal-400);
    box-shadow: 0 0 0 4px rgba(57, 210, 189, 0.12);
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 22px;
}

.metric-row div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.metric-row strong {
    font-size: 20px;
}

.metric-row span {
    color: #91a8bd;
    font-size: 11px;
}

.progress-track {
    display: grid;
    height: 5px;
    margin-top: 22px;
    grid-template-columns: 33fr 28fr 22fr 17fr;
    gap: 4px;
}

.progress-track span {
    border-radius: 999px;
    background: var(--blue-500);
}

.progress-track span:nth-child(2) {
    background: #369fdc;
}

.progress-track span:nth-child(3) {
    background: #38b7ce;
}

.progress-track span:nth-child(4) {
    background: var(--teal-400);
}

.brand-footer {
    margin: 38px 0 0;
    color: #7590a8;
    font-size: 12px;
}

.form-panel {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px clamp(28px, 7vw, 100px) 28px;
    background:
        radial-gradient(circle at 100% 0, #f0f7fd, transparent 31%),
        var(--white);
}

.form-wrap {
    width: min(100%, 430px);
    margin: auto 0;
}

.mobile-brand {
    display: none;
    margin-bottom: 52px;
    color: var(--navy-900);
}

.form-heading {
    margin-bottom: 34px;
}

.form-heading h2 {
    margin: 0;
    color: var(--navy-950);
    font-size: clamp(29px, 3vw, 38px);
    font-weight: 720;
    letter-spacing: -0.04em;
}

.form-heading > p:last-child {
    margin: 12px 0 0;
    color: var(--slate-600);
    font-size: 15px;
    line-height: 1.55;
}

.field {
    margin-bottom: 22px;
}

.field label {
    display: block;
    margin-bottom: 9px;
    color: #29384a;
    font-size: 13px;
    font-weight: 680;
}

.field input {
    width: 100%;
    height: 52px;
    padding: 0 15px;
    border: 1px solid #ccd6e1;
    border-radius: 9px;
    outline: none;
    color: var(--slate-900);
    background: var(--white);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input:hover {
    border-color: #a9b9c9;
}

.field input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px var(--focus);
}

.field input.invalid {
    border-color: var(--danger);
}

.field input.invalid:focus {
    box-shadow: 0 0 0 4px rgba(186, 47, 56, 0.12);
}

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 51px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 9px;
    display: grid;
    width: 36px;
    height: 36px;
    padding: 0;
    transform: translateY(-50%);
    place-items: center;
    border: 0;
    border-radius: 7px;
    color: var(--slate-600);
    background: transparent;
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--blue-600);
    background: var(--slate-100);
}

.password-toggle:focus-visible {
    outline: 3px solid var(--focus);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.password-toggle .eye-closed {
    display: none;
}

.password-toggle[aria-pressed="true"] .eye-open {
    display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
    display: block;
}

.field-error {
    display: block;
    min-height: 17px;
    margin-top: 5px;
    color: var(--danger);
    font-size: 12px;
}

.submit-button {
    display: flex;
    width: 100%;
    height: 52px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    border: 0;
    border-radius: 9px;
    color: var(--white);
    background: linear-gradient(135deg, var(--blue-600), #1266b4);
    box-shadow: 0 10px 24px rgba(22, 118, 210, 0.22);
    font-weight: 700;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.submit-button:hover:not(:disabled) {
    box-shadow: 0 13px 28px rgba(22, 118, 210, 0.3);
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.submit-button:focus-visible {
    outline: 4px solid var(--focus);
    outline-offset: 2px;
}

.submit-button:disabled {
    cursor: wait;
    opacity: 0.76;
}

.spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.submit-button.loading .spinner {
    display: block;
}

.alert {
    margin: -9px 0 25px;
    padding: 12px 14px;
    border: 1px solid #f2c4c8;
    border-radius: 8px;
    color: #8e2028;
    background: var(--danger-bg);
    font-size: 13px;
    line-height: 1.45;
}

.support-copy {
    margin: 28px 0 0;
    color: var(--slate-600);
    font-size: 13px;
    text-align: center;
}

.support-copy a {
    color: var(--blue-600);
    font-weight: 650;
    text-decoration: none;
}

.support-copy a:hover {
    text-decoration: underline;
}

.legal {
    margin: auto 0 0;
    padding-top: 40px;
    color: var(--slate-400);
    font-size: 11px;
    text-align: center;
}

.app-footer {
    padding: 18px;
    color: var(--slate-400);
    font-size: 11px;
    text-align: center;
}

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

@media (max-width: 880px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        display: none;
    }

    .form-panel {
        padding: 35px 24px 24px;
    }

    .mobile-brand {
        display: inline-flex;
    }
}

@media (max-width: 480px) {
    .form-panel {
        justify-content: flex-start;
    }

    .form-wrap {
        margin-top: 0;
    }

    .mobile-brand {
        margin-bottom: 58px;
    }

    .form-heading {
        margin-bottom: 29px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
