/* Login layout uses the shared brand tokens from styles.css. */
body.auth-page {
    min-height: 100dvh;
    margin: 0;
    padding: clamp(18px, 3vw, 42px);
    display: grid;
    place-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    background:
        radial-gradient(circle at 12% 14%, rgba(161, 40, 52, 0.08), transparent 28%),
        radial-gradient(circle at 88% 86%, rgba(30, 41, 59, 0.08), transparent 26%),
        #eef2f6;
    color: var(--text-primary);
}

body.auth-page::before {
    display: none;
}

.auth-shell {
    direction: ltr;
    width: min(1180px, 100%);
    min-height: min(700px, calc(100dvh - 84px));
    display: grid;
    grid-template-columns: minmax(390px, 0.9fr) minmax(450px, 1fr);
    grid-template-areas: "visual form";
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.15);
}

.auth-visual-panel,
.auth-form-panel {
    direction: rtl;
    position: relative;
}

.auth-visual-panel {
    grid-area: visual;
    min-height: 100%;
    padding: clamp(42px, 5vw, 72px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(145deg, #1e293b 0%, #111b2d 100%);
}

.auth-visual-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.24;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.auth-visual-panel::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: var(--brand-color);
}

.auth-visual-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(3px);
    pointer-events: none;
}

.auth-visual-glow-one {
    width: 330px;
    height: 330px;
    top: -170px;
    left: -130px;
    background: rgba(161, 40, 52, 0.25);
}

.auth-visual-glow-two {
    width: 260px;
    height: 260px;
    right: -150px;
    bottom: -110px;
    background: rgba(59, 130, 246, 0.08);
}

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

.auth-eyebrow {
    width: fit-content;
    padding: 7px 11px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #e6c2c6;
    background: rgba(161, 40, 52, 0.16);
    border: 1px solid rgba(209, 130, 138, 0.2);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.auth-visual-content h2 {
    margin: 34px 0 18px;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 4vw, 3.45rem);
    line-height: 1.25;
    letter-spacing: -0.04em;
}

.auth-visual-content h2 span {
    color: #d58d95;
}

.auth-visual-content > p {
    max-width: 470px;
    margin: 0;
    color: #b8c4d4;
    font-size: 15px;
    line-height: 1.95;
}

.auth-feature-list {
    margin-top: 44px;
    display: grid;
    gap: 16px;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-feature-item > span {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e4aeb4;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 11px;
}

.auth-feature-item div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-feature-item strong {
    color: #f8fafc;
    font-size: 14px;
    font-weight: 650;
}

.auth-feature-item small {
    color: #94a3b8;
    font-size: 12px;
}

.auth-visual-footer {
    margin: 40px 0 0;
    color: #718198;
    font-size: 12px;
}

.auth-form-panel {
    grid-area: form;
    display: grid;
    place-items: center;
    padding: clamp(38px, 5vw, 76px);
    background: #ffffff;
}

.auth-form-wrap {
    width: min(410px, 100%);
}

.auth-brand-row {
    display: flex;
    align-items: center;
    gap: 13px;
}

.auth-logo-frame {
    flex: 0 0 auto;
    width: 94px;
    height: 52px;
    padding: 7px 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.07);
}

.auth-logo-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-brand-row > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.auth-brand-row strong {
    color: #1e293b;
    font-size: 14px;
    font-weight: 750;
}

.auth-brand-row div span {
    color: #8a98aa;
    font-size: 11px;
}

.auth-heading {
    margin: clamp(48px, 7vh, 70px) 0 28px;
    position: relative;
}

.auth-heading-line {
    width: 38px;
    height: 4px;
    margin-bottom: 17px;
    display: block;
    background: var(--brand-color);
    border-radius: 99px;
}

.auth-heading h1 {
    margin: 0 0 9px;
    color: #172033;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-heading p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.8;
}

.auth-alert {
    margin-bottom: 20px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #9f2632;
    background: #fff5f5;
    border: 1px solid #f4c7cb;
    border-radius: 10px;
    font-size: 13px;
}

.auth-alert i {
    margin-top: 4px;
}

.auth-form {
    display: grid;
    gap: 20px;
}

.auth-field label {
    margin-bottom: 8px;
    display: block;
    color: #334155;
    font-size: 13px;
    font-weight: 650;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap input {
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 0 45px 0 48px;
    color: #172033;
    background: #f8fafc;
    border: 1px solid #d8e0ea;
    border-radius: 10px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.auth-input-wrap input::placeholder {
    color: #9aa7b8;
}

.auth-input-wrap input:focus {
    background: #ffffff;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(161, 40, 52, 0.1);
}

.auth-input-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    color: #8290a3;
    font-size: 15px;
    pointer-events: none;
}

.auth-password-toggle {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 9px;
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    color: #718096;
    background: transparent;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    cursor: pointer;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
    color: var(--brand-color);
    background: rgba(161, 40, 52, 0.07);
    box-shadow: none;
    outline: none;
}

.auth-submit {
    width: 100%;
    height: 52px;
    margin-top: 5px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ffffff;
    background: #243247;
    border: 1px solid #243247;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(30, 41, 59, 0.16);
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-submit:hover {
    background: #172033;
    border-color: #172033;
    box-shadow: 0 10px 22px rgba(30, 41, 59, 0.22);
    transform: translateY(-1px);
}

.auth-submit:focus-visible {
    outline: 3px solid rgba(161, 40, 52, 0.2);
    outline-offset: 2px;
}

.auth-submit:disabled {
    cursor: wait;
    opacity: 0.78;
    transform: none;
}

.auth-submit-spinner {
    display: none;
}

.auth-submit.is-loading .auth-submit-arrow {
    display: none;
}

.auth-submit.is-loading .auth-submit-spinner {
    display: inline-block;
}

.auth-support {
    margin-top: 28px;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #8794a6;
    border-top: 1px solid #edf1f5;
    font-size: 11px;
}

.auth-support span:first-child {
    color: #56657a;
}

.auth-support i {
    margin-left: 5px;
    color: var(--brand-color);
}

.auth-copyright {
    margin: 22px 0 0;
    color: #a0aabc;
    font-size: 10px;
    text-align: center;
}

@media (max-width: 900px) {
    body.auth-page {
        padding: 22px;
    }

    .auth-shell {
        width: min(560px, 100%);
        min-height: auto;
        grid-template-columns: 1fr;
        grid-template-areas: "form";
        border-radius: 20px;
    }

    .auth-visual-panel {
        display: none;
    }

    .auth-form-panel {
        min-height: min(680px, calc(100dvh - 44px));
        padding: 48px clamp(28px, 8vw, 64px);
    }
}

@media (max-width: 480px) {
    body.auth-page {
        padding: 0;
        place-items: stretch;
        background: #ffffff;
    }

    .auth-shell {
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-form-panel {
        min-height: 100dvh;
        padding: 32px 24px;
        align-items: center;
    }

    .auth-heading {
        margin-top: 45px;
    }

    .auth-support {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 4px;
    }
}

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