/* =========================================
   Auth Pages - Login, Register, Forgot Password
   Split-Panel Professional Design
   ========================================= */

/* ── Design Tokens ── */
:root {
    /* Primary Colors */
    --auth-primary-50: #ecf0f9;
    --auth-primary-100: #d9e2f3;
    --auth-primary-200: #b3c4e8;
    --auth-primary-300: #8da5dc;
    --auth-primary-400: #6787d1;
    --auth-primary-500: #4168c5;
    --auth-primary-600: #2d4aaa;
    --auth-primary-700: #0a2f72;
    --auth-primary-800: #082354;
    --auth-primary-900: #051938;

    /* Semantic */
    --auth-error: #dc2626;
    --auth-success: #059669;

    /* Neutrals */
    --auth-neutral-0: #ffffff;
    --auth-neutral-50: #f9fafb;
    --auth-neutral-100: #f3f4f6;
    --auth-neutral-200: #e5e7eb;
    --auth-neutral-300: #d1d5db;
    --auth-neutral-400: #9ca3af;
    --auth-neutral-500: #6b7280;
    --auth-neutral-600: #4b5563;
    --auth-neutral-700: #374151;
    --auth-neutral-800: #1f2937;
    --auth-neutral-900: #111827;
}

/* ── Base Body for Auth Pages ── */
body {
    font-family: 'Heebo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    margin: 0;
    min-height: 100vh;
    direction: rtl;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.5;
}

/* ── Dev notice ── */
body > .dev-notice {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(90deg, #fef08a 0%, #fef3c7 100%);
    color: #92400e;
    text-align: center;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid #fcd34d;
    backdrop-filter: blur(10px);
}

/* ── Auth Wrapper (Split Panel Layout) ── */
.auth-wrapper {
    display: flex;
    width: 100%;
    max-width: 1100px;
    min-height: 580px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 60px 20px 30px;
    animation: authFadeInUp 0.5s ease-out;
}

@keyframes authFadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Info Panel (Left side in RTL) ── */
.info-panel {
    flex: 0 0 42%;
    padding: 56px 40px;
    display: flex;
    flex-direction: column;
    position: relative;
    border-inline-end: 2px solid var(--auth-neutral-200);
    background: #ffffff;
    color: var(--auth-neutral-900);
}

.info-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--auth-primary-700) 0%, var(--auth-primary-400) 100%);
}

/* Brand Section */
.brand-section {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.brand-logo {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    margin: -56px -40px 32px -40px;
    width: calc(100% + 80px);
    max-width: calc(100% + 80px);
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--auth-primary-50) 0%, var(--auth-primary-100) 100%);
    border: 1.5px solid var(--auth-primary-200);
    color: var(--auth-primary-700);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.brand-text h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--auth-neutral-500);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0;
}

/* Info Content */
.info-content {
    flex: 1;
    margin-bottom: 12px;
}

.info-content h1 {
    font-size: 24px;
    font-weight: 900;
    line-height: 1.2;
    color: var(--auth-primary-800);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.info-content p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--auth-neutral-500);
    max-width: 95%;
}

.btn-info {
    align-self: flex-start;
    background-color: transparent;
    border: 1.5px solid var(--auth-primary-200);
    color: var(--auth-primary-700);
    padding: 10px 18px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-info:hover {
    background-color: var(--auth-primary-50);
    border-color: var(--auth-primary-400);
    transform: translateY(-1px);
}

/* ── About & Team Modal ── */
.about-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    padding: 24px;
}
.about-overlay.active { display: flex; }

.about-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: aboutIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes aboutIn {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

.about-close {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 10;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--auth-neutral-500);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.about-close:hover {
    color: var(--auth-error);
    transform: rotate(90deg);
}

.about-header {
    background: linear-gradient(135deg, var(--auth-primary-700), var(--auth-primary-500));
    padding: 40px 32px 28px;
    text-align: center;
    border-radius: 14px 14px 0 0;
}
.about-header h2 {
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 6px;
}
.about-header p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    margin: 0;
}

.about-body {
    padding: 24px 28px;
}
.about-body h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--auth-primary-700);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.about-body h3 i { font-size: 13px; opacity: 0.65; }

.team-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}
.team-card {
    flex: 0 0 calc((100% - 20px) / 3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    border-radius: 10px;
    background: var(--auth-neutral-50);
    border: 1px solid var(--auth-neutral-100);
    transition: all 0.2s;
}
.team-card:hover {
    background: #fff;
    border-color: var(--auth-primary-200);
    box-shadow: 0 4px 12px rgba(10, 47, 114, 0.08);
}
.team-card i {
    width: 38px;
    height: 38px;
    background: var(--auth-primary-50);
    color: var(--auth-primary-600);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.team-card span {
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-neutral-800);
    text-align: center;
    line-height: 1.3;
}

.about-thanks {
    border-top: 1px solid var(--auth-neutral-100);
    padding-top: 20px;
}
.about-thanks h3 i { color: #ef4444; opacity: 1; }
.about-thanks p {
    font-size: 13px;
    color: var(--auth-neutral-500);
    margin: 0 0 12px;
    line-height: 1.6;
}
.thanks-names {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.thanks-names .thanks-chip {
    background: var(--auth-neutral-50);
    border: 1px solid var(--auth-neutral-200);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--auth-neutral-700);
}

.about-footer {
    padding: 14px 28px;
    text-align: center;
    background: var(--auth-neutral-50);
    border-radius: 0 0 14px 14px;
    border-top: 1px solid var(--auth-neutral-100);
    font-size: 11.5px;
    color: var(--auth-neutral-400);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ── Form Panel (Right side in RTL) ── */
.form-panel {
    flex: 1;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #ffffff;
    position: relative;
    overflow-y: auto;
}

.form-panel-header {
    margin-bottom: 32px;
}

.form-panel-header h2 {
    font-size: 28px;
    font-weight: 900;
    color: var(--auth-neutral-900);
    margin-bottom: 8px;
}

.form-panel-header p {
    font-size: 15px;
    color: var(--auth-neutral-500);
    font-weight: 500;
}

/* ── Form Groups ── */
.form-group,
.input-group {
    margin-bottom: 22px;
    text-align: right;
}

.form-group label,
.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--auth-neutral-900);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .input-icon {
    position: absolute;
    right: 14px;
    color: var(--auth-neutral-400);
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    height: 48px;
    border: 1.5px solid var(--auth-neutral-200);
    border-radius: 6px;
    background-color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    color: var(--auth-neutral-900);
    padding-right: 40px;
    padding-left: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    outline: none;
    border-color: var(--auth-primary-700) !important;
    box-shadow: 0 0 0 4px rgba(10, 47, 114, 0.1);
    background-color: var(--auth-neutral-50);
}

.input-wrapper:focus-within .input-icon {
    color: var(--auth-primary-700);
}

.input-wrapper input::placeholder {
    color: var(--auth-neutral-300);
    font-size: 14px;
}

/* Select styling */
.input-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-left: 40px;
}

.input-wrapper .select-arrow {
    position: absolute;
    left: 14px;
    color: var(--auth-neutral-400);
    font-size: 12px;
    pointer-events: none;
    transition: color 0.2s;
}

.input-wrapper:focus-within .select-arrow {
    color: var(--auth-primary-700);
}

/* Password Toggle Button */
.btn-toggle-pass {
    position: absolute;
    left: 6px;
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    color: var(--auth-neutral-400);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    font-size: 14px;
}

.btn-toggle-pass:hover {
    color: var(--auth-primary-700);
}

/* ── Form Actions Row ── */
.form-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
    font-size: 13px;
}

.link-action {
    color: var(--auth-primary-700);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.link-action:hover {
    color: var(--auth-primary-600);
    text-decoration: underline;
}

/* ── Buttons ── */
.btn-primary {
    width: 100%;
    height: 52px;
    background: var(--auth-primary-700);
    color: var(--auth-neutral-0);
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
    margin-top: 10px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -4px rgba(10, 47, 114, 0.3);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Loading state for button */
.btn-primary .btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* ── Auth Links ── */
.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.link-divider {
    color: var(--auth-neutral-200);
}

.block-link {
    display: block;
    margin-top: 18px;
    text-align: center;
}

.text-link {
    color: var(--auth-neutral-500);
    font-size: 13px;
    transition: color 0.2s;
    text-decoration: none;
    font-weight: 500;
}

.text-link:hover {
    color: var(--auth-primary-700);
    text-decoration: underline;
}

/* ── Footer in Form Panel ── */
.form-panel-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--auth-neutral-200);
    font-size: 12px;
    color: var(--auth-neutral-400);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Auth Logo ── */
.auth-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--auth-primary-700) 0%, var(--auth-primary-600) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    box-shadow: 0 10px 30px rgba(10, 47, 114, 0.3);
}

.auth-logo i {
    font-size: 24px;
    color: white;
}

/* ── Divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: var(--auth-neutral-400);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-neutral-200);
}

.auth-divider::before { margin-left: 15px; }
.auth-divider::after { margin-right: 15px; }

/* Security note in info panel */
.security-note {
    display: inline-flex;
    flex-direction: row;          /* icon first (right) then text (left) in RTL */
    align-items: flex-start;
    gap: 10px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--auth-neutral-600);
    background: rgba(10, 47, 114, 0.05);
    border: 1px solid var(--auth-primary-200);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0 0 18px;
    width: 100%;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
}

.security-note i {
    font-size: 15px;
    color: var(--auth-primary-700);
    margin-top: 2px;   /* align icon with first line of text */
    flex-shrink: 0;
}

/* =========================================
   Responsive Design
   ========================================= */

/* Tablet */
@media (max-width: 900px) {
    .auth-wrapper {
        max-width: 95%;
        margin: 50px 10px 20px;
    }

    .info-panel {
        flex: 0 0 38%;
        padding: 40px 30px;
    }

    .form-panel {
        padding: 40px 36px;
    }

    .info-content h1 {
        font-size: 22px;
    }
}

/* Mobile - Stack panels */
@media (max-width: 768px) {
    body {
        align-items: stretch;
    }

    .auth-wrapper {
        flex-direction: column;
        max-width: 100%;
        margin: 45px 0 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        min-height: auto;
        box-shadow: none;
    }

    .info-panel {
        flex: none;
        padding: 28px 24px;
        border-inline-end: none;
        border-bottom: 2px solid var(--auth-neutral-200);
    }

    .brand-section {
        margin-bottom: 16px;
    }

    .brand-logo {
        margin: -28px -24px 16px -24px;
        width: calc(100% + 48px);
        max-width: calc(100% + 48px);
    }

    .info-content {
        margin-bottom: 16px;
    }

    .info-content h1 {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .info-content p {
        font-size: 13px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .btn-info {
        display: none;
    }

    .form-panel {
        padding: 28px 20px;
    }

    .form-panel-header {
        margin-bottom: 24px;
    }

    .form-panel-header h2 {
        font-size: 22px;
    }

    .form-panel-header p {
        font-size: 13px;
    }

    .input-wrapper input,
    .input-wrapper select {
        height: 44px;
        font-size: 14px;
    }

    .btn-primary {
        height: 48px;
        font-size: 14px;
    }

    .form-actions {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

/* Small Mobile */
@media (max-width: 400px) {
    .form-panel {
        padding: 20px 16px;
    }

    .info-panel {
        padding: 20px 16px;
    }

    .info-content h1 {
        font-size: 18px;
    }

    .form-panel-header h2 {
        font-size: 20px;
    }
}
