* {
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--mdb-body-bg);
    transition: background-color .3s ease;
}

/* ── Login Card ─────────────────────────────────────── */
.auth-card {
    width: 100%;
    max-width: 440px;
    background-color: var(--mdb-card-bg, #fff);
    border: 1px solid var(--mdb-card-border-color, #e0e0e0);
    border-radius: 1rem;
    box-shadow: var(--mdb-card-shadow, 0 8px 32px rgba(0, 0, 0, .10));
    padding: 2.5rem 2.5rem 2rem;
    animation: slideUp .4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Brand ──────────────────────────────────────────── */
.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand-logo {
    width: 64px;
    height: 64px;
    background: var(--mdb-primary);
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .75rem;
    box-shadow: 0 4px 16px rgba(var(--mdb-primary-rgb), .35);
}

.auth-brand-logo i {
    color: #fff;
    font-size: 1.75rem;
}

.auth-brand h4 {
    color: var(--mdb-body-color);
    font-weight: 700;
    margin: 0;
    font-size: 1.35rem;
}

.auth-brand p {
    color: var(--mdb-gray-500);
    font-size: .875rem;
    margin: .25rem 0 0;
}

/* ── Form Label ─────────────────────────────────────── */
.auth-label {
    display: block;
    font-size: .825rem;
    font-weight: 600;
    color: var(--mdb-gray-700);
    margin-bottom: .35rem;
}

html.dark .auth-label {
    color: var(--mdb-gray-400);
}

/* ── Input Group ────────────────────────────────────── */
.auth-input-wrap {
    position: relative;
}

.auth-input {
    width: 100%;
    padding: .65rem 1rem .65rem 2.75rem;
    border: 1.5px solid var(--mdb-border-color);
    border-radius: .5rem;
    font-family: 'Cairo', sans-serif;
    font-size: .95rem;
    color: var(--mdb-body-color);
    background-color: var(--mdb-white, #fff);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

html[dir="rtl"] .auth-input {
    padding: .65rem 2.75rem .65rem 1rem;
}

.auth-input:focus {
    border-color: var(--mdb-primary);
    box-shadow: 0 0 0 3px rgba(var(--mdb-primary-rgb), .15);
}

.auth-input.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, .12);
}

.auth-input-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mdb-gray-500);
    font-size: .9rem;
    pointer-events: none;
}

html[dir="ltr"] .auth-input-icon {
    left: .875rem;
}

html[dir="rtl"] .auth-input-icon {
    right: .875rem;
}

.auth-eye-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--mdb-gray-500);
    padding: .25rem;
    font-size: .9rem;
    transition: color .2s;
}

html[dir="ltr"] .auth-eye-btn {
    right: .75rem;
}

html[dir="rtl"] .auth-eye-btn {
    left: .75rem;
}

.auth-eye-btn:hover {
    color: var(--mdb-primary);
}

.auth-error-text {
    font-size: .78rem;
    color: #dc3545;
    margin-top: .3rem;
}

/* ── Submit Button ──────────────────────────────────── */
.auth-btn {
    width: 100%;
    padding: .75rem;
    background-color: var(--mdb-primary);
    border: none;
    border-radius: .5rem;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 4px 12px rgba(var(--mdb-primary-rgb), .30);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

.auth-btn:hover:not(:disabled) {
    filter: brightness(1.08);
    box-shadow: 0 6px 18px rgba(var(--mdb-primary-rgb), .40);
}

.auth-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.auth-btn:disabled {
    opacity: .75;
    cursor: not-allowed;
}

/* ── Alert ──────────────────────────────────────────── */
.auth-alert {
    border-radius: .5rem;
    padding: .75rem 1rem;
    font-size: .875rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    animation: fadeIn .3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

.auth-alert-error {
    background-color: rgba(220, 53, 69, .10);
    border: 1px solid rgba(220, 53, 69, .25);
    color: #dc3545;
}

.auth-alert-success {
    background-color: rgba(var(--mdb-primary-rgb), .10);
    border: 1px solid rgba(var(--mdb-primary-rgb), .25);
    color: var(--mdb-primary);
}

/* ── Remember / Forgot ──────────────────────────────── */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .85rem;
}

.auth-check-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    color: var(--mdb-gray-600);
    cursor: pointer;
}

.auth-check-label input[type="checkbox"] {
    accent-color: var(--mdb-primary);
    width: 15px;
    height: 15px;
}

.auth-link {
    color: var(--mdb-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: .85rem;
    transition: opacity .2s;
}

.auth-link:hover {
    opacity: .8;
}

/* ── Divider ────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--mdb-gray-400);
    font-size: .8rem;
    margin: 1.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--mdb-border-color);
}

/* ── Theme Switcher (bottom) ────────────────────────── */
.auth-theme-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: 1.5rem;
}

.theme-dot-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .2s, border-color .2s;
    padding: 0;
}

.theme-dot-btn:hover,
.theme-dot-btn.active {
    border-color: var(--mdb-primary);
    transform: scale(1.2);
}

/* Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin .7s linear infinite;
}

/* Dark adjustments */
html.dark .auth-card {
    background-color: #262624;
}

html.dark .auth-input {
    background-color: #2e2e2c;
    border-color: #4f4f4d;
    color: #d4d4d0;
}

html.dark .auth-input:focus {
    border-color: var(--mdb-primary);
}
