:root {
    --auth-ink: #19324a;
    --auth-ink-soft: #4b647b;
    --auth-panel: rgba(255, 255, 255, 0.78);
    --auth-line: rgba(25, 50, 74, 0.12);
    --auth-accent: #5b79a6;
    --auth-accent-deep: #2e4057;
    --auth-highlight: #d6e4f3;
    --auth-warm: #f5efe4;
    --auth-shadow: 0 28px 80px rgba(22, 37, 57, 0.18);
    --auth-radius-panel: 32px;
    --auth-radius-input: 14px;
    --auth-space-1: 8px;
    --auth-space-2: 12px;
    --auth-space-3: 16px;
    --auth-space-4: 22px;
}

body.auth-page {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(320px, 1.02fr) minmax(460px, 0.98fr);
    background:
        radial-gradient(circle at top left, rgba(214, 228, 243, 0.92), transparent 38%),
        radial-gradient(circle at bottom right, rgba(161, 187, 218, 0.5), transparent 32%),
        linear-gradient(135deg, #f6f0e5 0%, #edf2f7 46%, #d8e4f1 100%);
    color: var(--auth-ink);
}

.left-panel,
.right-panel {
    position: relative;
    min-height: 100vh;
}

.left-panel {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px clamp(28px, 5vw, 72px);
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.22), transparent 20%),
        radial-gradient(circle at 80% 18%, rgba(214, 228, 243, 0.18), transparent 22%),
        linear-gradient(160deg, #27435f 0%, #4d6f98 48%, #6f90bc 100%);
}

.left-panel::before,
.left-panel::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.left-panel::before {
    width: 420px;
    height: 420px;
    top: -160px;
    right: -140px;
    background: rgba(255, 255, 255, 0.08);
}

.left-panel::after {
    width: 320px;
    height: 320px;
    bottom: -120px;
    left: -90px;
    background: rgba(255, 255, 255, 0.08);
}

.logo-box {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    color: #f7fbff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.logo-img {
    width: clamp(180px, 26vw, 280px);
    height: auto;
    display: block;
    filter: drop-shadow(0 20px 36px rgba(14, 25, 38, 0.22));
}

.logo-box h1,
.auth-brand {
    font-family: 'Sora', 'Segoe UI', sans-serif;
}

.auth-brand {
    margin: 16px 0 0;
    font-size: clamp(1.85rem, 3.5vw, 2.45rem);
    font-weight: 700;
    letter-spacing: 0.26em;
    text-transform: uppercase;
}

.right-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px clamp(18px, 4vw, 42px);
}

.right-panel.signup-panel {
    align-items: center;
    padding-top: 24px;
    padding-bottom: 24px;
}

.form-container {
    position: relative;
    width: min(100%, 540px);
    padding: clamp(24px, 3.6vw, 38px);
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: var(--auth-radius-panel);
    background: var(--auth-panel);
    backdrop-filter: blur(18px);
    box-shadow: var(--auth-shadow);
    animation: auth-rise 440ms ease-out both;
}

.form-container::before {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 24px;
    border: 1px solid rgba(91, 121, 166, 0.12);
    pointer-events: none;
}

    .form-container.signup {
        max-height: none;
        overflow: visible;
        display: block;
        flex-direction: unset;
        overscroll-behavior: auto;
        scrollbar-gutter: unset;
    }

.form-container.signup #signupForm {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    scrollbar-gutter: stable;
}

.form-container.signup #signupForm::-webkit-scrollbar {
    width: 10px;
}

.form-container.signup #signupForm::-webkit-scrollbar-track {
    background: #f5f7fa;
    border-radius: 10px;
}

.form-container.signup #signupForm::-webkit-scrollbar-thumb {
    background: var(--auth-accent);
    border-radius: 10px;
    border: 2px solid #f5f7fa;
}

.form-container.signup #signupForm::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6f90bc 0%, var(--auth-accent) 100%);
}

.form-container.signup #signupForm {
    scrollbar-width: thin;
    scrollbar-color: var(--auth-accent) #f5f7fa;
}

.form-container.signup {
    padding-top: clamp(20px, 3.2vw, 32px);
}

.form-container.signup .auth-eyebrow {
    margin-bottom: 10px;
}

.form-container.signup .auth-subtitle {
    margin-top: 10px;
    margin-bottom: 1.1rem;
}

.form-container.signup .link {
    flex-shrink: 0;
    margin-top: 10px;
}

.auth-eyebrow {
    display: inline-flex;
    width: fit-content;
    max-width: max-content;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(91, 121, 166, 0.1);
    color: var(--auth-accent-deep);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-title {
    margin: 0;
    font-family: 'Sora', 'Segoe UI', sans-serif;
    font-size: clamp(28px, 3.8vw, 42px);
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--auth-ink);
}

.auth-subtitle {
    margin: 12px 0 0;
    max-width: 42ch;
    color: var(--auth-ink-soft);
    font-size: 15px;
    line-height: 1.7;
}

.auth-form-note,
.auth-status-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(91, 121, 166, 0.14);
    background: rgba(214, 228, 243, 0.38);
    color: var(--auth-accent-deep);
    font-size: 12px;
    line-height: 1.6;
}

.auth-status-note {
    margin-top: 0;
    margin-bottom: 18px;
}

.auth-status-note strong,
.auth-form-note strong {
    display: block;
    font-size: 12px;
}

.auth-note-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-top: 2px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--auth-accent);
    border: 1px solid rgba(91, 121, 166, 0.22);
}

.auth-note-icon svg {
    width: 14px;
    height: 14px;
}

.auth-form {
    margin-top: 22px;
    display: grid;
    gap: var(--auth-space-3);
}

.auth-field {
    display: grid;
    gap: var(--auth-space-1);
}

.auth-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    color: #344b62;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-input {
    width: 100%;
    border: 1px solid #d7e0ea;
    border-radius: var(--auth-radius-input);
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 14px;
    min-height: 46px;
    color: #1e3146;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.auth-input.with-toggle {
    padding-right: 44px;
}

.auth-input.with-icon {
    padding-left: 38px;
}

.input-with-toggle {
    position: relative;
}

.password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    width: 42px;
    border: 0;
    background: transparent;
    color: #688098;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: #2e4057;
}

.password-toggle svg {
    width: 16px;
    height: 16px;
}

.auth-alert {
    margin-top: 18px;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
}

.auth-alert-error {
    border: 1px solid rgba(178, 58, 74, 0.38);
    background: rgba(250, 225, 229, 0.9);
    color: #7c2736;
}

.auth-alert-success {
    border: 1px solid rgba(47, 118, 84, 0.34);
    background: rgba(225, 248, 238, 0.92);
    color: #245d42;
}

.auth-alert-title {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 800;
}

.auth-error-list {
    margin: 0;
    padding-left: 16px;
}

.auth-error-list li {
    margin-bottom: 4px;
}

.required-mark {
    color: #b43b4e;
}

.field-note {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.4;
}

.note-success {
    color: #236a49;
}

.note-error {
    color: #a63f4f;
}

.note-neutral {
    color: #53687d;
}

.is-invalid {
    border-color: #c95263 !important;
    box-shadow: 0 0 0 3px rgba(201, 82, 99, 0.14);
}

.hidden {
    display: none !important;
}

.two-factor-panel {
    width: min(100%, 500px);
    padding-top: clamp(24px, 3.2vw, 34px);
    padding-bottom: clamp(24px, 3.2vw, 34px);
}

.two-factor-form {
    margin-top: 18px;
}

.two-factor-code-input {
    width: 100%;
    max-width: 220px;
    margin: 8px auto 0;
    display: block;
    border: 1px solid rgba(25, 50, 74, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    padding: 12px 14px;
    text-align: center;
    letter-spacing: 0.28em;
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--auth-ink);
}

.two-factor-code-input:focus {
    border-color: rgba(91, 121, 166, 0.8);
    box-shadow: 0 0 0 4px rgba(91, 121, 166, 0.14);
}

.two-factor-submit-btn,
.two-factor-secondary-btn {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    border-radius: 14px;
    background: var(--auth-accent-deep);
    padding: 11px 16px;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(28, 45, 68, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.two-factor-submit-btn:hover,
.two-factor-submit-btn:focus-visible,
.two-factor-secondary-btn:hover,
.two-factor-secondary-btn:focus-visible {
    background: #223851;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(28, 45, 68, 0.24);
}

.two-factor-resend-copy {
    margin: 16px 0 0;
    text-align: center;
    color: #6a7988;
    font-size: 0.86rem;
}

.two-factor-resend-link {
    color: var(--auth-accent-deep);
    font-weight: 700;
    text-decoration: none;
}

.two-factor-resend-link:hover,
.two-factor-resend-link:focus-visible {
    text-decoration: underline;
}

.two-factor-expired-action {
    margin: 14px 0 0;
}

.auth-grid {
    display: grid;
    gap: 14px;
}

.auth-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legal-links-wrapper {
    margin-top: 0.75rem;
}

.legal-links {
    display: inline-flex;
    white-space: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    color: #5b79a6;
}

.legal-links a {
    color: #5b79a6;
    text-decoration: underline;
    font-weight: 700;
}

.legal-links span {
    color: #64748b;
}

.form-container.signup .auth-subtitle {
    margin-bottom: 1.5rem;
}

.field-error {
    margin: 0;
    min-height: 17px;
    color: #a63f4f;
    font-size: 12px;
    line-height: 1.4;
}

.field-error-single-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.auth-page.auth-signup #passwordClientError,
body.auth-page.auth-signup #passwordConfirmClientError {
    line-height: 3;
}

.link {
    margin-top: 0;
    color: var(--auth-ink-soft);
    text-align: center;
    font-size: 13px;
}

.link a {
    color: var(--auth-accent-deep);
    font-weight: 800;
    text-decoration: none;
}

.link a:hover,
.link a:focus-visible {
    text-decoration: underline;
}

.auth-foot-link {
    margin-top: 10px;
}

.auth-page button,
.auth-page input,
.auth-page select {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
}

.auth-page button {
    border: none;
}

.auth-page button:focus-visible {
    outline: none;
}

.auth-page input,
.auth-page select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-page input::placeholder {
    color: #71849a;
}

.auth-page input:focus,
.auth-page select:focus {
    background-color: rgba(255, 255, 255, 0.98);
}

.auth-input:focus,
.auth-input:focus-visible,
.two-factor-code-input:focus,
.consent-checkbox:focus-visible {
    outline: none;
    border-color: rgba(91, 121, 166, 0.84);
    box-shadow: 0 0 0 4px rgba(91, 121, 166, 0.16);
}

.auth-submit:focus-visible,
.password-toggle:focus-visible,
.link a:focus-visible {
    outline: 2px solid rgba(91, 121, 166, 0.62);
    outline-offset: 2px;
}

.auth-submit {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-submit::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.auth-submit:hover::after,
.auth-submit:focus-visible::after {
    transform: translateX(100%);
}

.auth-features {
    margin-top: 30px;
    display: grid;
    gap: 14px;
}

.auth-feature-card {
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-feature-card h3 {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
}

.auth-feature-card p {
    margin: 0;
    color: rgba(247, 251, 255, 0.84);
    font-size: 12px;
    line-height: 1.65;
}

.auth-metric-row {
    display: flex;
    gap: 14px;
    margin-top: 22px;
}

.auth-metric {
    flex: 1;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-metric strong {
    display: block;
    margin-bottom: 4px;
    font-size: 20px;
    color: #ffffff;
}

.auth-metric span {
    font-size: 11px;
    line-height: 1.5;
    color: rgba(247, 251, 255, 0.82);
}

.auth-modal-surface {
    border: 1px solid rgba(91, 121, 166, 0.14);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 30px 90px rgba(20, 33, 51, 0.26);
}

.auth-modal-backdrop {
    backdrop-filter: blur(10px);
}

@keyframes auth-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1023px) {
    body.auth-page {
        height: auto;
        overflow: auto;
        grid-template-columns: 1fr;
    }

    .left-panel,
    .right-panel {
        min-height: auto;
    }

    .left-panel {
        padding: 42px 22px 28px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .right-panel {
        padding: 12px clamp(18px, 5.5vw, 36px) 30px;
    }

    .logo-box {
        width: min(100%, 620px);
    }

    .logo-placeholder {
        margin-bottom: 12px;
    }

    .auth-brand {
        margin-top: 8px;
        font-size: clamp(1.6rem, 4.2vw, 2rem);
        letter-spacing: 0.2em;
    }

    .form-container,
    .form-container.signup {
        width: min(100%, 560px);
        margin: 0 auto;
        padding: clamp(18px, 2.7vw, 26px);
    }

    .auth-eyebrow {
        font-size: 10px;
        padding: 6px 10px;
    }

    .auth-title {
        font-size: clamp(24px, 3.2vw, 32px);
    }

    .auth-subtitle {
        font-size: 13px;
        line-height: 1.55;
    }

    .auth-form {
        margin-top: 16px;
        gap: 12px;
    }

    .auth-label {
        font-size: 10px;
    }

    .auth-input {
        min-height: 42px;
        padding: 10px 12px;
        font-size: 13px;
    }

    .auth-alert,
    .auth-status-note,
    .auth-form-note,
    .field-error,
    .link {
        font-size: 12px;
    }

    .auth-submit,
    .two-factor-submit-btn,
    .two-factor-secondary-btn {
        font-size: 13px;
    }

    .auth-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .left-panel {
        min-height: 210px;
        overflow: visible;
        padding: 18px 16px 10px;
    }

    .logo-box {
        width: 100%;
        max-width: 460px;
    }

    .logo-img {
        width: clamp(120px, 38vw, 170px);
    }

    .auth-brand {
        margin-top: 4px;
        font-size: 1.42rem !important;
        letter-spacing: 0.14em !important;
    }

    .auth-features {
        margin-top: 16px;
    }

    .auth-feature-card {
        padding: 10px 12px;
        border-radius: 14px;
    }

    .auth-feature-card h3 {
        font-size: 12px;
    }

    .auth-feature-card p {
        font-size: 11px;
        line-height: 1.5;
    }

    .form-container,
    .form-container.signup {
        width: 100%;
        max-height: none;
        overflow: visible;
        border-radius: 24px;
        padding: 16px 14px;
    }

    .auth-title {
        font-size: clamp(21px, 8.1vw, 27px);
    }

    .auth-subtitle {
        font-size: 12px;
        line-height: 1.5;
    }

    .auth-form {
        margin-top: 14px;
        gap: 10px;
    }

    .auth-input {
        min-height: 40px;
        padding: 9px 11px;
        font-size: 12.5px;
    }

    .auth-label {
        font-size: 9.5px;
    }

    .right-panel {
        padding: 8px 14px 22px;
    }

    .right-panel .form-container,
    .right-panel .form-container.signup {
        width: min(100%, 520px);
    }

    .auth-grid.cols-2,
    .auth-features,
    .auth-metric-row {
        grid-template-columns: 1fr;
        display: grid;
    }

    .auth-metric-row {
        gap: 12px;
    }

    .two-factor-code-input {
        max-width: 200px;
        padding: 10px 11px;
        letter-spacing: 0.24em;
        font-size: 0.98rem;
    }

    .left-panel {
        padding-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .left-panel {
        min-height: 180px;
        padding: 14px 12px 8px;
    }

    .logo-placeholder {
        margin-bottom: 7px;
    }

    .auth-brand {
        margin-top: 2px;
        font-size: 1.28rem !important;
        letter-spacing: 0.12em !important;
    }

    .right-panel {
        padding: 8px 10px 18px;
    }

    .right-panel .form-container,
    .right-panel .form-container.signup {
        border-radius: 20px;
        padding: 14px 12px;
    }

    .auth-title {
        font-size: clamp(20px, 7.6vw, 24px);
    }

    .auth-subtitle,
    .auth-alert,
    .auth-status-note,
    .auth-form-note,
    .link,
    .field-error {
        font-size: 11.5px;
    }

    .auth-submit,
    .two-factor-submit-btn,
    .two-factor-secondary-btn {
        min-height: 40px;
        font-size: 12.5px;
    }

    .auth-features,
    .auth-metric-row {
        display: none !important;
    }
}
