/* ═══════════════════════════════════════
   login.css — Login Page
   ═══════════════════════════════════════ */

/* ── Page Shell ── */
.login-page {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: #eef2f8;
    direction: rtl;
}

/* ═══════════════════════════════════════
   Brand Panel (left)
   ═══════════════════════════════════════ */

.login-brand-panel {
    position: relative;
    width: 42%;
    min-height: 100vh;
    background: linear-gradient(150deg, #0b3355 0%, #1f6392 55%, #2e86c1 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 40px 32px;
    flex-shrink: 0;
}

/* Decorative floating shapes */
.brand-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.07;
    background: white;
    animation: floatShape 8s ease-in-out infinite;
}

.brand-shape-1 {
    width: 320px;
    height: 320px;
    top: -80px;
    right: -80px;
    animation-delay: 0s;
}

.brand-shape-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: -50px;
    animation-delay: 2s;
}

.brand-shape-3 {
    width: 140px;
    height: 140px;
    bottom: 160px;
    right: 30px;
    opacity: 0.05;
    animation-delay: 4s;
}

.brand-shape-4 {
    width: 80px;
    height: 80px;
    top: 40%;
    left: 20px;
    opacity: 0.06;
    animation-delay: 1s;
}

@keyframes floatShape {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-20px) scale(1.04); }
}

/* Brand content */
.brand-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
    color: white;
}

/* Logo ring */
.brand-logo-ring {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    backdrop-filter: blur(4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.2);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 0 0 0 rgba(255,255,255,0.12); }
    50% { box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 0 0 12px rgba(255,255,255,0); }
}

.brand-logo-text {
    font-size: 2rem;
    font-weight: 900;
    color: white;
    letter-spacing: 2px;
}

.brand-title {
    font-size: 2.4rem;
    font-weight: 800;
    color: white;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

    .brand-title span {
        color: #7ec8f5;
    }

.brand-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.72);
    margin: 0 0 28px 0;
    font-weight: 400;
}

.brand-divider {
    width: 48px;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin: 0 auto 28px auto;
}

/* Feature list */
.brand-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 280px;
    text-align: right;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    font-weight: 500;
}

.feature-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.13);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    border: 1px solid rgba(255,255,255,0.15);
}

/* Bottom version */
.brand-version {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.78rem;
    z-index: 1;
}

/* ═══════════════════════════════════════
   Form Panel (right)
   ═══════════════════════════════════════ */

.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: #eef2f8;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 24px rgba(31, 99, 146, 0.08), 0 1px 4px rgba(0,0,0,0.04);
    padding: 36px 36px 28px 36px;
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: cardFadeIn 0.5s ease-out;
}

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

/* Mobile logo (hidden on desktop) */
.login-mobile-logo {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.mobile-logo-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1f6392;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.mobile-logo-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
}

/* Card header */
.login-card-header {
    margin-bottom: 28px;
    text-align: right;
}

.login-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 6px 0;
}

.login-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Error banner */
.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 500;
    border-right: 4px solid #dc2626;
    animation: shakeError 0.4s ease;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Field wrappers */
.login-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.login-field-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    text-align: right;
}

/* MudTextField overrides for login page */
.login-page .login-input .mud-input-outlined-border {
    border-radius: 10px !important;
}

.login-page .login-input .mud-input-root {
    font-size: 0.9rem !important;
}

.login-page .login-input .mud-input-adornment {
    color: #94a3b8;
}

.login-page .login-input:has(.mud-input-root:focus-within) .mud-input-adornment {
    color: #1f6392;
}

/* Options row */
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin: -4px 0;
}

.remember-label {
    font-size: 0.83rem;
    color: #475569;
}

.forgot-password {
    font-size: 0.83rem;
    color: #1f6392;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

    .forgot-password:hover {
        color: #155a80;
        text-decoration: underline;
    }

/* Login button */
.login-page .login-btn {
    height: 48px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    letter-spacing: 0.3px;
    transition: all 0.25s ease !important;
    box-shadow: 0 4px 14px rgba(31, 99, 146, 0.35) !important;
}

    .login-page .login-btn:hover:not(:disabled) {
        transform: translateY(-1px) !important;
        box-shadow: 0 6px 20px rgba(31, 99, 146, 0.45) !important;
    }

    .login-page .login-btn:active:not(:disabled) {
        transform: translateY(0) !important;
    }

/* Demo hint */
.login-demo-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f0f9ff;
    border: 1px dashed #bae6fd;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #0284c7;
    text-align: center;
}

    .login-demo-hint strong {
        font-weight: 700;
        color: #0369a1;
    }

/* Card footer */
.login-card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.78rem;
    color: #94a3b8;
}

.footer-divider {
    color: #cbd5e1;
}

/* ═══════════════════════════════════════
   Responsive
   ═══════════════════════════════════════ */

@media (max-width: 900px) {
    .login-brand-panel {
        width: 38%;
        padding: 32px 20px;
    }

    .brand-title { font-size: 2rem; }
    .brand-subtitle { font-size: 0.88rem; }
    .brand-logo-ring { width: 80px; height: 80px; }
    .brand-logo-text { font-size: 1.7rem; }

    .login-card { padding: 28px 24px 22px 24px; }
}

@media (max-width: 680px) {
    .login-page {
        flex-direction: column;
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        align-items: stretch;
        justify-content: center;
        padding: 0;
        min-height: 100vh;
        background: #ffffff;
    }

    /* تمام‌صفحه در موبایل: بدون حاشیه، بدون قاب سفید کناره‌ها */
    .login-card {
        max-width: 100%;
        width: 100%;
        min-height: 100vh;
        border-radius: 0;
        border: none;
        box-shadow: none;
        justify-content: center;
        padding: 28px 22px;
    }

    .login-mobile-logo {
        display: flex;
    }

    .login-card-header {
        text-align: center;
    }

    .login-title { font-size: 1.4rem; }
}

@media (max-width: 400px) {
    .login-form-panel {
        padding: 0;
    }

    .login-card {
        padding: 22px 16px;
        border-radius: 0;
    }

    .login-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ═══════════════════════════════════════
   Register link on login + Doctor Registration page
   (palette-var driven → automatically theme-aware)
   ═══════════════════════════════════════ */
.login-register-prompt {
    text-align: center;
    font-size: 0.83rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 14px;
}

.login-register-link {
    color: var(--mud-palette-primary);
    font-weight: 700;
    text-decoration: none;
    margin-right: 6px;
}

    .login-register-link:hover {
        text-decoration: underline;
    }

/* ── Step-by-step registration wizard (RTL) ── */
.register-shell {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 16px 0 16px;
    background: var(--mud-palette-background);
    direction: rtl;
    overflow-x: hidden;
}

.register-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-shrink: 0;
    width: 100%;
    max-width: 840px;
}

.register-wizard {
    width: 100%;
    max-width: 840px;
    flex: 1 1 auto;
    padding-bottom: 84px;
}

/* Step indicator */
.reg-steps {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.reg-step {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

    /* connecting line to the previous (right-hand, in RTL) step */
    .reg-step::before {
        content: "";
        position: absolute;
        top: 16px;
        left: 50%;
        right: -50%;
        height: 2px;
        background: var(--mud-palette-lines-default);
        z-index: 0;
    }

    .reg-step:first-child::before { display: none; }

.reg-step-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    background: var(--mud-palette-surface);
    border: 2px solid var(--mud-palette-lines-default);
    color: var(--mud-palette-text-secondary);
    position: relative;
    z-index: 1;
    transition: all 0.2s ease;
}

.reg-step.active .reg-step-num {
    background: var(--mud-palette-primary);
    border-color: var(--mud-palette-primary);
    color: #fff;
}

.reg-step.done .reg-step-num {
    background: var(--mud-palette-success);
    border-color: var(--mud-palette-success);
    color: #fff;
}

.reg-step-label {
    font-size: 11px;
    color: var(--mud-palette-text-secondary);
    text-align: center;
}

.reg-step.active .reg-step-label {
    color: var(--mud-palette-primary);
    font-weight: 700;
}

.register-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0b3355, #1f6392);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 17px;
    flex-shrink: 0;
}

/* Single full-width card; the inner field grid provides the two columns */
.register-columns {
    flex: 1 1 auto;
    padding-bottom: 84px; /* room for the fixed action bar */
}

.reg-subhead {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13.5px;
    color: var(--mud-palette-primary);
    margin: 16px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

    .reg-subhead:first-child {
        margin-top: 0;
    }

.reg-section-card {
    break-inside: avoid;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.reg-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    color: var(--mud-palette-text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.reg-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* Step navigation row inside the card (left-aligned in RTL) */
.reg-card-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.reg-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .reg-field.full {
        grid-column: 1 / -1;
    }

.reg-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    text-align: right;
    display: block;
}

    .reg-label.required::after {
        content: " *";
        color: var(--mud-palette-error);
    }

.reg-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    padding-top: 4px;
}

/* RTL input behaviour */
.register-shell input,
.register-shell textarea {
    text-align: right !important;
    direction: rtl !important;
}

    /* English values (email / username / phone) read left-to-right but stay right-aligned */
    .register-shell .reg-ltr input {
        direction: ltr !important;
        text-align: right !important;
    }

.register-photo-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Fixed, always-visible centered action bar */
.register-footer {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    padding: 12px 16px;
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
    box-shadow: 0 -2px 14px rgba(0,0,0,0.08);
    z-index: 10;
}

.register-login-prompt {
    font-size: 0.85rem;
    color: var(--mud-palette-text-secondary);
}

.register-login-link {
    color: var(--mud-palette-primary);
    font-weight: 700;
    text-decoration: none;
    margin-right: 6px;
}

    .register-login-link:hover {
        text-decoration: underline;
    }

/* Tablet → single column of cards */
@media (max-width: 960px) {
    .register-columns { column-count: 1; }
}

@media (max-width: 600px) {
    /* تمام‌صفحه در موبایل: کارت لبه‌تا‌لبه بدون حاشیهٔ کناری */
    .register-shell { padding: 10px 0 0 0; }
    .register-topbar { padding: 0 14px; }
    .reg-steps { padding: 0 14px; }
    .reg-section-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .reg-fields { grid-template-columns: 1fr; }
    .register-footer { flex-direction: column; gap: 8px; padding: 0 14px; }
}
