/**
 * Auth pages — login / register / forgot password
 * Clean split layout, brand panel + focused form
 */

.auth-body {
    margin: 0;
    min-height: 100vh;
    background: #f3f4f6;
    font-family: 'DM Sans', 'Tajawal', system-ui, sans-serif;
    color: #111827;
    -webkit-font-smoothing: antialiased;
}

html[dir="rtl"] .auth-body {
    font-family: 'Tajawal', 'DM Sans', system-ui, sans-serif;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem clamp(1.5rem, 4vw, 3.5rem);
    color: #f8fafc;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(255, 255, 255, 0.18), transparent 55%),
        linear-gradient(155deg, var(--footer-bg, #0f172a) 0%, #134e4a 48%, var(--primary, #0f766e) 100%);
    overflow: hidden;
}

.auth-brand::after {
    content: '';
    position: absolute;
    inset: auto -20% -30% auto;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.auth-brand__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    position: relative;
    z-index: 1;
}

.auth-brand__logo img {
    height: 2.25rem;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.auth-brand__mark {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.85rem;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(6px);
}

.auth-brand__name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-brand__copy {
    position: relative;
    z-index: 1;
    max-width: 28rem;
    animation: authRise 0.7s ease both;
}

.auth-brand__eyebrow {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
}

.auth-brand__title {
    margin: 0 0 1rem;
    font-size: clamp(1.75rem, 3.2vw, 2.6rem);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.auth-brand__text {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.6;
    opacity: 0.88;
}

.auth-brand__perks {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
    animation: authRise 0.85s ease 0.1s both;
}

.auth-brand__perks li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    opacity: 0.92;
}

.auth-brand__perks i {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.75rem;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    padding: 1.25rem clamp(1.25rem, 4vw, 3rem) 2rem;
}

.auth-panel__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-back:hover { color: var(--primary, #0f766e); }

.auth-lang {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.2rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.auth-lang a {
    min-width: 2.25rem;
    text-align: center;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-decoration: none;
}

.auth-lang a.is-active {
    background: var(--primary, #0f766e);
    color: #fff;
}

.auth-panel__body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 28rem;
    animation: authRise 0.65s ease both;
}

.auth-card--wide { max-width: 36rem; }

.auth-card__title {
    margin: 0 0 0.4rem;
    font-size: clamp(1.6rem, 2.5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.auth-card__subtitle {
    margin: 0 0 1.75rem;
    color: #64748b;
    font-size: 0.98rem;
    line-height: 1.5;
}

.auth-alert {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    border-radius: 0.85rem;
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
}

.auth-alert--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-alert--success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.auth-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
}

.auth-field input {
    width: 100%;
    height: 2.85rem;
    padding: 0 0.95rem;
    border-radius: 0.8rem;
    border: 1px solid #dbe3ee;
    background: #fff;
    font: inherit;
    color: #0f172a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--primary, #0f766e);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 15, 118, 110), 0.18);
}

.auth-field__hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.88rem;
    color: #475569;
}

.auth-check input {
    margin-top: 0.2rem;
    accent-color: var(--primary, #0f766e);
}

.auth-check a {
    color: var(--primary, #0f766e);
    font-weight: 600;
    text-decoration: none;
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    height: 2.95rem;
    margin-top: 0.35rem;
    border: 0;
    border-radius: 0.85rem;
    background: var(--button-color, var(--primary, #0f766e));
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 10px 24px rgba(var(--primary-rgb, 15, 118, 110), 0.22);
}

.auth-submit:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.auth-links {
    margin-top: 1.35rem;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}

.auth-links a {
    color: var(--primary, #0f766e);
    font-weight: 700;
    text-decoration: none;
}

.auth-forgot {
    display: block;
    text-align: end;
    margin-top: -0.35rem;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: var(--primary, #0f766e);
    font-weight: 600;
    text-decoration: none;
}

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

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand {
        min-height: auto;
        padding: 1.5rem 1.25rem 1.75rem;
    }
    .auth-brand__copy { margin-top: 1.5rem; }
    .auth-brand__perks { display: none; }
    .auth-brand__title { font-size: 1.55rem; }
    .auth-form__row { grid-template-columns: 1fr; }
}
