/* ── Auth split pages (login + register) — shared design tokens ── */
.auth-page--login,
.auth-page--register {
    --dm-primary: #2b5491;
    --dm-primary-hover: #234876;
    --dm-input-bg: #eef1f6;
    --dm-illustration-bg: #eef2f8;
    --dm-text-heading: #1f2937;
    --dm-text-muted: #6b7280;
    --dm-text-light: #9ca3af;
    --dm-text-link: #2b5491;
    --dm-icon-muted: #9ca3af;
    --dm-form-max-width: 680px;
    --dm-input-min-height: 52px;
    --dm-input-radius: 10px;
    --dm-btn-radius: 10px;
    --dm-panel-radius: 40px;
    --dm-illustration-padding: 40px;
    --auth-form-inset: 72px;
    --auth-column-gap: 28px;
}

/* intl-tel-input */
.dm-phone-combined {
    padding: 0 1rem 0 0;
}

.dm-phone-combined .dm-phone-field {
    flex: 1;
    min-width: 0;
}

.dm-phone-combined .iti {
    width: 100%;
    display: block;
}

.dm-phone-combined .iti input {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    min-height: var(--dm-input-min-height);
    padding: 0.875rem 0.75rem 0.875rem 0;
    font-size: 0.9375rem;
    color: var(--dm-text);
    outline: none;
    box-shadow: none;
}

.dm-phone-combined .iti input::placeholder {
    color: var(--dm-text-light);
}

.dm-phone-combined .iti input:focus {
    border-color: transparent;
    box-shadow: none;
}

.dm-combined-input.is-invalid,
.dm-phone-combined.is-invalid {
    border-color: #dc3545 !important;
}

.dm-combined-input.is-invalid:focus-within,
.dm-phone-combined.is-invalid:focus-within {
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.15);
}

.iti--separate-dial-code .iti__selected-country {
    background: transparent;
    border: none;
    border-right: 1px solid var(--dm-divider);
    border-radius: 0;
    padding-left: 0;
    padding-right: 0.625rem;
    margin-right: 0.625rem;
}

.iti--separate-dial-code .iti__selected-country-primary {
    padding-left: 0;
    padding-right: 0.35rem;
}

.iti--separate-dial-code .iti__flag,
.iti--separate-dial-code .iti__globe {
    display: none !important;
}

.iti--separate-dial-code .iti__selected-dial-code {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--dm-text);
    margin-left: 0;
}

.iti--separate-dial-code .iti__arrow {
    margin-left: 0.25rem;
    border-top-color: var(--dm-text-muted);
}

.iti__country-list {
    z-index: 1065;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 240px;
}

.iti__country-list .iti__country-name {
    font-size: 0.875rem;
}

[data-phone-client-error].invalid-feedback,
[data-server-error].invalid-feedback {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #dc3545;
}

/* ── Grid: form left (~56%), illustration right (~44%) ── */
@media (min-width: 992px) {
    .auth-page--login .auth-row,
    .auth-page--register .auth-row {
        grid-template-columns: minmax(0, 56fr) minmax(0, 44fr);
        column-gap: var(--auth-column-gap);
    }

    .auth-page--login .auth-form-column,
    .auth-page--register .auth-form-column {
        order: 1;
        padding: var(--dm-illustration-padding) 0;
    }

    .auth-page--login .auth-illustration-column,
    .auth-page--register .auth-illustration-column {
        order: 2;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        box-sizing: border-box;
        padding: var(--dm-illustration-padding) var(--auth-form-inset) var(--dm-illustration-padding) 0;
        overflow: hidden;
        min-height: 0;
    }
}

/* ── Left column layout ── */
.auth-page--login .auth-form-column,
.auth-page--register .auth-form-column {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: var(--dm-illustration-padding) 0;
    background: #ffffff;
}

.auth-page--login .auth-column-top,
.auth-page--register .auth-column-top {
    position: absolute;
    top: var(--dm-illustration-padding);
    left: var(--auth-form-inset);
    margin-bottom: 0;
    z-index: 1;
}

.auth-page--login .auth-form-stack,
.auth-page--register .auth-form-stack {
    width: 100%;
    max-width: min(var(--dm-form-max-width), calc(100% - var(--auth-form-inset)));
    min-height: auto;
    margin: 0 0 0 var(--auth-form-inset);
    justify-content: center;
}

.auth-page--login .auth-form-inner,
.auth-page--register .auth-form-inner {
    padding: 0;
    flex: 0 0 auto;
    justify-content: flex-start;
}

.auth-page--login .auth-column-bottom--fixed,
.auth-page--register .auth-column-bottom--fixed {
    position: absolute;
    bottom: var(--dm-illustration-padding);
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding-top: 0;
}

/* ── Brand ── */
.auth-page--login .dm-brand--auth,
.auth-page--register .dm-brand--auth {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
}

.auth-page--login .dm-brand-logo,
.auth-page--register .dm-brand-logo {
    height: 40px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.auth-page--login .dm-brand__icon,
.auth-page--register .dm-brand__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--dm-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.auth-page--login .dm-brand__wordmark,
.auth-page--register .dm-brand__wordmark {
    font-size: 1.25rem;
    font-weight: 800;
    font-style: italic;
    color: var(--dm-primary);
    letter-spacing: 0.02em;
    line-height: 1;
}

/* ── Typography ── */
.auth-page--login .dm-title,
.auth-page--register .dm-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--dm-text-heading);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.auth-page--login .dm-subtitle,
.auth-page--register .dm-subtitle {
    font-size: 0.9375rem;
    color: var(--dm-text-muted);
    margin: 0 0 40px;
    line-height: 1.5;
}

/* ── Fields ── */
.auth-page--login .dm-label,
.auth-page--register .dm-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.auth-page--login .dm-field,
.auth-page--register .dm-field {
    margin-bottom: 24px;
}

.auth-page--login .dm-input-field,
.auth-page--register .dm-input-field {
    font-size: 0.9375rem;
    padding: 0.875rem 1rem;
    min-height: var(--dm-input-min-height);
    border-radius: var(--dm-input-radius);
    border-color: transparent;
}

.auth-page--login .dm-combined-input,
.auth-page--register .dm-combined-input {
    gap: 0.5rem;
    padding: 0 15px;
    min-height: var(--dm-input-min-height);
    border-radius: var(--dm-input-radius);
    border-color: transparent;
}

.auth-page--login .dm-combined-input input,
.auth-page--register .dm-combined-input input {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9375rem;
    padding: 15px 0;
}

.auth-page--login .dm-password-wrap input,
.auth-page--register .dm-password-wrap input {
    font-size: 0.9375rem;
    padding: 15px 2.75rem 15px 15px;
    min-height: var(--dm-input-min-height);
    border-radius: var(--dm-input-radius);
    border-color: transparent;
}

.auth-page--login .dm-toggle-btn,
.auth-page--login .dm-eye-btn,
.auth-page--register .dm-toggle-btn,
.auth-page--register .dm-eye-btn {
    color: var(--dm-icon-muted);
}

.auth-page--login .dm-toggle-btn:hover,
.auth-page--login .dm-eye-btn:hover,
.auth-page--register .dm-toggle-btn:hover,
.auth-page--register .dm-eye-btn:hover {
    color: #6b7280;
}

.auth-page--login .dm-toggle-btn i,
.auth-page--login .dm-eye-btn i,
.auth-page--register .dm-toggle-btn i,
.auth-page--register .dm-eye-btn i {
    font-size: 1rem;
}

.auth-page--login .dm-eye-btn,
.auth-page--register .dm-eye-btn {
    right: 0.875rem;
}

/* ── Options row ── */
.auth-page--login .dm-form-options,
.auth-page--register .dm-form-options {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-bottom: 30px;
    margin-top: 0;
}

.auth-page--login .dm-form-options .form-check-label,
.auth-page--register .dm-form-options .form-check-label {
    font-size: 0.875rem;
    color: var(--dm-text-muted);
}

.auth-page--login .dm-link,
.auth-page--register .dm-link {
    font-size: 0.875rem;
    color: var(--dm-text-link);
}

/* ── Button ── */
.auth-page--login .dm-btn,
.auth-page--register .dm-btn {
    font-size: 1rem;
    font-weight: 600;
    min-height: var(--dm-input-min-height);
    border-radius: var(--dm-btn-radius);
}

.auth-page--login .dm-auth-footer-text,
.auth-page--register .dm-auth-footer-text {
    font-size: 0.875rem;
    margin-top: 20px;
    color: var(--dm-text-muted);
    text-align: center;
}

.auth-page--login .dm-auth-footer-text .dm-link,
.auth-page--register .dm-auth-footer-text .dm-link {
    font-weight: 600;
}

/* ── Powered by ── */
.auth-page--login .dm-powered-by-text,
.auth-page--register .dm-powered-by-text {
    font-size: 0.6875rem;
    color: var(--dm-text-muted);
}

.auth-page--login .dm-powered-by-logo,
.auth-page--register .dm-powered-by-logo {
    height: 26px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

/* ── Right column: illustration (image only, no wrapper) ── */
.auth-page--login .auth-illustration-column,
.auth-page--register .auth-illustration-column {
    background: #ffffff;
}

.auth-page--login .auth-illustration-column img,
.auth-page--register .auth-illustration-column img {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
    border-radius: var(--dm-panel-radius);
}

.auth-page--login .dm-alert,
.auth-page--register .dm-alert {
    font-size: 0.875rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
    html:has(.auth-page--login),
    html:has(.auth-page--login) body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .auth-page--login,
    .auth-page--register {
        height: auto;
        min-height: 100vh;
        max-height: none;
        overflow: visible;
    }

    .auth-page--login .auth-container,
    .auth-page--register .auth-container,
    .auth-page--login .auth-row,
    .auth-page--register .auth-row {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .auth-page--login .auth-form-column,
    .auth-page--register .auth-form-column {
        height: auto;
        min-height: 100vh;
        max-height: none;
        overflow: visible;
        padding: 1.75rem 1.5rem 6rem;
        align-items: stretch;
    }

    .auth-page--login .auth-column-top,
    .auth-page--register .auth-column-top {
        position: static;
        left: auto;
        width: 100%;
        margin-bottom: 1.75rem;
    }

    .auth-page--login .auth-form-stack,
    .auth-page--register .auth-form-stack {
        margin-left: 0;
        max-width: 100%;
        width: 100%;
    }

    .auth-page--login .auth-column-bottom--fixed,
    .auth-page--register .auth-column-bottom--fixed {
        bottom: 1.25rem;
    }

    .auth-page--login .dm-brand-logo,
    .auth-page--register .dm-brand-logo {
        height: 36px;
    }

    .auth-page--login .dm-title,
    .auth-page--register .dm-title {
        font-size: 1.75rem;
    }

    .auth-page--login .dm-subtitle,
    .auth-page--register .dm-subtitle {
        margin-bottom: 1.75rem;
    }
}

@media (max-width: 575.98px) {
    .auth-page--login .auth-form-column,
    .auth-page--register .auth-form-column {
        padding: 1.5rem 1.25rem 5.75rem;
    }

    .auth-page--login .dm-field,
    .auth-page--register .dm-field {
        margin-bottom: 1.25rem;
    }

    .auth-page--login .dm-form-options,
    .auth-page--register .dm-form-options {
        margin-bottom: 1.5rem;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .auth-page--login,
    .auth-page--register {
        --auth-form-inset: 48px;
        --dm-form-max-width: 580px;
        --dm-illustration-padding: 32px;
        --auth-column-gap: 24px;
    }
}

@media (min-width: 1400px) {
    .auth-page--login,
    .auth-page--register {
        --auth-form-inset: 88px;
        --dm-form-max-width: 760px;
        --dm-illustration-padding: 48px;
        --auth-column-gap: 32px;
    }
}
