/*
    MessagingHub Authentication Screens
    Tailored for RTL (Farsi) Layout
    Font: Vazirmatn (inherited from public.css)
    Color Theme: Formal Slate & Teal — same tokens as the landing page and the panels
*/

:root {
    --auth-primary: #0d9488;
    --auth-primary-hover: #0f766e;
    --auth-slate-900: #0f172a;
    --auth-slate-800: #1e293b;
    --auth-slate-500: #64748b;
    --auth-border: #e2e8f0;
    --auth-surface: #f8fafc;
}

/* --- Page shell ---
   صفحه‌های ورود قالب خودشان را دارند (_AuthLayout)، پس پوسته‌ی صفحه هم اینجاست:
   یک نوار نشانِ ساده بالا، بدنه‌ای که همه‌ی فضای باقی‌مانده را می‌گیرد، و یک پاورقی
   یک‌خطی. هیچ ناوبری‌ای در کار نیست — تنها کاری که این صفحه دارد، فرم ورود است. */
.auth-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--auth-surface);
}

.auth-body > main {
    flex: 1 0 auto;
    display: flex;
}

.auth-body > main > .auth-section {
    flex: 1 0 auto;
}

.auth-topbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--auth-border);
    padding: 1.15rem 0;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--auth-slate-900);
}

.auth-brand i {
    color: var(--auth-primary);
}

.auth-footer {
    border-top: 1px solid var(--auth-border);
    background-color: #ffffff;
    padding: 1.1rem 0;
    font-size: 0.82rem;
    color: var(--auth-slate-500);
}

.auth-footer .container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.auth-section {
    /* بدنه‌ی صفحه بین نوار بالا و پاورقی نفس بکشد؛ کارت هرگز به لبه نچسبد */
    background-color: var(--auth-surface);
    background-image:
        radial-gradient(circle at 88% 12%, rgba(13, 148, 136, 0.10), transparent 45%),
        radial-gradient(circle at 8% 92%, rgba(15, 23, 42, 0.07), transparent 45%);
    padding: 4rem 0 5rem 0;
    min-height: 70vh;
    display: flex;
    align-items: center;
}

/* --- The card --- */
.auth-card {
    background-color: #ffffff;
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.10), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 992px) {
    .auth-card {
        grid-template-columns: 1.05fr 0.95fr;
    }
}

/* --- Brand aside (dark slate → teal, same gradient family as the hero) --- */
.auth-aside {
    display: none;
    position: relative;
    padding: 3rem 2.75rem;
    color: #ffffff;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #0d9488 165%);
    overflow: hidden;
}

@media (min-width: 992px) {
    .auth-aside {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
}

/* بافت شبکه‌ای بسیار کم‌رنگ تا سطح تیره تخت به‌نظر نرسد */
.auth-aside::before {
    content: '';
    position: absolute;
    inset: 0;
    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: 28px 28px;
    mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 75%);
    pointer-events: none;
}

.auth-aside > * {
    position: relative;
    z-index: 1;
}

.auth-aside-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background-color: rgba(13, 148, 136, 0.18);
    border: 1px solid rgba(45, 212, 191, 0.35);
    color: #5eead4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1.75rem;
}

.auth-aside-title {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.auth-aside-lead {
    color: #cbd5e1;
    font-weight: 300;
    line-height: 2;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.auth-points {
    list-style: none;
    padding: 0;
    margin: 2.5rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-points li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.9;
}

.auth-points i {
    color: #2dd4bf;
    font-size: 0.9rem;
    margin-top: 0.45rem;
    flex-shrink: 0;
}

.auth-aside-note {
    margin: 2.5rem 0 0 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 0.8rem;
    line-height: 1.9;
}

/* --- Form side --- */
.auth-form {
    padding: 2.5rem 1.75rem;
}

@media (min-width: 576px) {
    .auth-form {
        padding: 3rem 2.75rem;
    }
}

.auth-form-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--auth-slate-900);
    margin-bottom: 0.4rem;
}

.auth-form-lead {
    color: var(--auth-slate-500);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.auth-form .form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.auth-form .input-group-text {
    background-color: var(--auth-surface);
    border-color: var(--auth-border);
    color: #94a3b8;
    width: 44px;
    justify-content: center;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.auth-form .form-control {
    border-color: var(--auth-border);
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    font-size: 0.95rem;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form .form-control::placeholder {
    color: #cbd5e1;
}

.auth-form .form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 148, 136, 0.15);
}

.auth-form .input-group:focus-within .input-group-text {
    border-color: var(--auth-primary);
    color: var(--auth-primary);
}

.auth-reveal {
    border: 1px solid var(--auth-border);
    background-color: var(--auth-surface);
    color: #94a3b8;
    width: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.auth-reveal:hover {
    color: var(--auth-primary);
}

.auth-form .form-check-input:checked {
    background-color: var(--auth-primary);
    border-color: var(--auth-primary);
}

.auth-form .form-check-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 148, 136, 0.15);
}

.auth-form .form-check-label {
    font-size: 0.875rem;
    color: var(--auth-slate-500);
}

.auth-submit {
    width: 100%;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
}

.auth-field-error {
    display: block;
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

/* --- Error summary --- */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    line-height: 1.9;
    margin-bottom: 1.5rem;
}

/* آیکون هشدار از خودِ CSS می‌آید، چون نشانه‌گذاری خلاصه را تگ‌هلپر می‌سازد */
.auth-alert.validation-summary-errors::before {
    content: '\f06a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-top: 0.35rem;
    flex-shrink: 0;
}

.auth-alert ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* خلاصه‌ی اعتبارسنجی وقتی خطایی ندارد نباید یک جعبه‌ی قرمز خالی بسازد */
.auth-alert.validation-summary-valid {
    display: none;
}

/* --- Access denied state --- */
.auth-state {
    max-width: 560px;
    margin: 0 auto;
    background-color: #ffffff;
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.08);
    padding: 3rem 2rem;
    text-align: center;
}

.auth-state-medallion {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    margin: 0 auto 1.75rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    background-color: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #d97706;
}

.auth-state h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--auth-slate-900);
    line-height: 1.9;
    margin-bottom: 0.75rem;
}

.auth-state p {
    color: var(--auth-slate-500);
    font-size: 0.9rem;
    line-height: 2;
    margin-bottom: 2rem;
}

.auth-state-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

/* --- Entrance motion: one orchestrated reveal, staggered --- */
@keyframes authRise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.auth-card,
.auth-state {
    animation: authRise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-stagger > * {
    animation: authRise 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-stagger > *:nth-child(1) { animation-delay: 0.10s; }
.auth-stagger > *:nth-child(2) { animation-delay: 0.16s; }
.auth-stagger > *:nth-child(3) { animation-delay: 0.22s; }
.auth-stagger > *:nth-child(4) { animation-delay: 0.28s; }
.auth-stagger > *:nth-child(5) { animation-delay: 0.34s; }
.auth-stagger > *:nth-child(6) { animation-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
    .auth-card,
    .auth-state,
    .auth-stagger > * {
        animation: none;
    }

    .btn-landing-primary:hover {
        transform: none;
    }
}
