:root {
    --bg: #f4f7fb;
    --ink: #172033;
    --muted: #667085;
    --line: #d8e0ea;
    --primary: #1266f1;
    --primary-dark: #0d4fc0;
    --panel: rgba(255, 255, 255, 0.82);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", system-ui, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 14% 18%, rgba(27, 74, 126, 0.22), transparent 26%),
        radial-gradient(circle at 86% 12%, rgba(20, 184, 166, 0.14), transparent 24%),
        linear-gradient(135deg, #dfe8f4 0%, #eef3f8 45%, #f8fafc 100%);
}

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px clamp(28px, 7vw, 190px) 24px;
}

.auth-hero {
    min-height: calc(100vh - 152px);
    display: grid;
    grid-template-columns: minmax(440px, 0.92fr) minmax(620px, 1.08fr);
    align-items: start;
    gap: clamp(54px, 6vw, 104px);
    padding-top: clamp(18px, 3vh, 42px);
}

.auth-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0;
    color: var(--ink);
    text-decoration: none;
    font-size: 22px;
    transform: translateY(-22px);
}

.auth-brand span,
.modal-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    background: #172033;
    color: #fff;
}

.auth-brand span {
    width: 430px;
    height: 148px;
    overflow: visible;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.auth-brand strong {
    color: #111827;
    max-width: 180px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.05;
}

.auth-brand span img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    transform: none;
}

.auth-nav-actions,
.auth-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

button {
    font: inherit;
}

.ghost-button,
.primary-button,
.submit-button {
    border: 0;
    cursor: pointer;
    border-radius: 14px;
    font-weight: 800;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ghost-button {
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    border: 1px solid rgba(23, 32, 51, 0.09);
}

.outline-button {
    padding: 13px 24px;
    border: 2px solid #111827;
    border-radius: 14px;
    color: #111827;
    background: rgba(255, 255, 255, 0.36);
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease;
}

.outline-button:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.72);
}

.primary-button,
.submit-button {
    padding: 12px 18px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 16px 32px rgba(18, 102, 241, 0.24);
}

.primary-button:hover,
.submit-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.large {
    padding: 15px 22px;
}

.auth-copy {
    max-width: 820px;
    padding: clamp(4px, 1.2vh, 18px) 0 0;
}

.auth-eyebrow {
    display: inline-flex;
    color: #05070b;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 23px;
    letter-spacing: 0;
}

.auth-copy h1 {
    margin: 22px 0 18px;
    font-size: clamp(48px, 4.4vw, 82px);
    line-height: 1.08;
    font-weight: 500;
    letter-spacing: 0;
}

.auth-copy h1 strong {
    font-weight: 900;
}

.auth-copy p {
    margin: 0 0 24px;
    max-width: 740px;
    color: #111827;
    font-size: 21px;
    line-height: 1.35;
}

.auth-art {
    margin: 0;
    position: relative;
    width: min(100%, 820px);
    justify-self: end;
    border-radius: 28px;
    overflow: hidden;
    background: #bbff14;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.20);
}

.auth-art::before {
    content: none;
}

.auth-carousel {
    position: relative;
    width: 100%;
    max-height: min(48vh, 520px);
    aspect-ratio: 1.42 / 1;
}

.auth-carousel-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: top center;
    opacity: 0;
    transition: opacity 1100ms ease-in-out;
}

.auth-carousel-slide.active {
    opacity: 1;
}

.auth-modal-layer {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    padding: 22px;
    z-index: 50;
}

.auth-modal-layer.active {
    display: grid;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(10px);
}

.auth-modal {
    position: relative;
    z-index: 2;
    display: none;
    width: min(100%, 460px);
    max-height: calc(100vh - 44px);
    overflow: auto;
    padding: 28px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.74);
    box-shadow: 0 34px 90px rgba(15, 23, 42, 0.28);
}

.auth-modal.wide {
    width: min(100%, 720px);
}

.auth-modal.active {
    display: block;
    animation: modalIn 180ms ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: #eef3f8;
    color: var(--ink);
    cursor: pointer;
}

.auth-modal header {
    margin-bottom: 22px;
}

.auth-modal h2 {
    margin: 16px 0 6px;
    font-size: 30px;
}

.auth-modal p {
    margin: 0;
    color: var(--muted);
}

.auth-error {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff1f2;
    color: #b42318;
    border: 1px solid #fecdd3;
    font-weight: 700;
}

.auth-success {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
    font-weight: 700;
}

form {
    display: grid;
    gap: 14px;
}

.register-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
    display: grid;
    gap: 8px;
    color: #344054;
    font-weight: 700;
    font-size: 14px;
}

.wide-field {
    grid-column: 1 / -1;
}

input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    padding: 0 14px;
    outline: none;
}

input:focus {
    border-color: rgba(18, 102, 241, 0.7);
    box-shadow: 0 0 0 4px rgba(18, 102, 241, 0.12);
}

.password-field {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.password-field:focus-within {
    border-color: rgba(18, 102, 241, 0.7);
    box-shadow: 0 0 0 4px rgba(18, 102, 241, 0.12);
}

.password-field input {
    border: 0;
    box-shadow: none;
}

.password-field button {
    width: 46px;
    height: 46px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.password-hint {
    color: var(--muted);
    font-weight: 600;
}

.forgot-link {
    width: fit-content;
    border: 0;
    padding: 0;
    color: var(--primary);
    background: transparent;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.forgot-link:hover {
    color: var(--primary-dark);
}

.submit-button {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-button.loading {
    opacity: 0.72;
    cursor: wait;
}

@media (max-width: 860px) {
    .auth-page {
        padding: 16px;
    }

    .auth-nav {
        align-items: center;
        gap: 10px;
    }

    .auth-brand {
        flex: 0 0 auto;
        gap: 0;
        transform: none;
    }

    .auth-brand span {
        width: 112px;
        height: 82px;
        border-radius: 18px;
    }

    .auth-brand span img {
        transform: scale(1.52);
    }

    .auth-brand strong {
        display: none;
    }

    .auth-nav-actions {
        display: grid;
        grid-template-columns: minmax(82px, 1fr) minmax(112px, 1fr);
        gap: 8px;
        flex: 1 1 auto;
        justify-content: stretch;
        min-width: 0;
    }

    .auth-nav-actions .outline-button,
    .auth-nav-actions .primary-button {
        width: 100%;
        min-height: 48px;
        padding: 10px 12px;
        border-radius: 16px;
        font-size: 15px;
        line-height: 1.05;
        white-space: normal;
    }

    .auth-nav-actions .primary-button {
        gap: 6px;
    }

    .auth-hero {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 28px;
        padding-top: 0;
    }

    .auth-copy {
        padding: 5vh 0 0;
    }

    .auth-copy h1 {
        font-size: 46px;
    }

    .auth-copy p {
        font-size: 17px;
    }
    .register-grid {
        grid-template-columns: 1fr;
    }

    .auth-art {
        border-radius: 20px;
        justify-self: stretch;
    }

    .auth-carousel {
        max-height: 42vh;
        aspect-ratio: 1.42 / 1;
    }
}
