@import url('common.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --auth-primary: #951010;
    --auth-primary-dark: #6b0c0c;
    --auth-primary-light: #c41515;
    --auth-accent: #2563eb;
    --auth-text: #1f2937;
    --auth-text-light: #6b7280;
    --auth-text-muted: #9ca3af;
    --auth-border: #e5e7eb;
    --auth-bg: #ffffff;
    --auth-bg-page: #f3f4f6;
    --auth-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --auth-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--auth-bg-page);
}

/* ══════════════════════════════════════════
   MAIN LAYOUT - CENTERED CARD
   ══════════════════════════════════════════ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

/* AUTH CONTAINER - The Centered Card */
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    background: var(--auth-bg);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    display: flex;
    min-height: 550px;
}

/* RTL Support */
[dir="rtl"] .auth-container {
    direction: rtl;
}

/* ══════════════════════════════════════════
   IMAGE PANEL - Left Side (Col-6)
   ══════════════════════════════════════════ */
.auth-image-panel {
    flex: 0 0 50%;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-image-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 70% 70%, rgba(0, 0, 0, 0.2) 0%, transparent 60%);
}

.auth-image-panel img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    opacity: 1;
}

.auth-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(107, 12, 12, 0.3) 0%,
            rgba(149, 16, 16, 0.25) 100%);
    pointer-events: none;
}

.auth-image-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.auth-image-content h2 {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.auth-image-content p {
    font-size: 14px;
    opacity: 0.95;
    line-height: 1.6;
}

/* ══════════════════════════════════════════
   FORM PANEL - Right Side (Col-6)
   ══════════════════════════════════════════ */
.auth-form-panel {
    flex: 1;
    padding: 50px 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.auth-form-inner {
    width: 100%;
    max-width: 480px;
}

/* ══════════════════════════════════════════
   LOGO
   ══════════════════════════════════════════ */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
    text-decoration: none;
}

.auth-logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(149, 16, 16, 0.3);
}

.auth-logo img {
    max-height: 48px;
    width: auto;
}

.auth-logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--auth-primary);
    letter-spacing: -0.3px;
}

/* ══════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════ */
.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.auth-subtitle {
    font-size: 14px;
    color: #6c757d;
    font-weight: 400;
}

/* ══════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════ */
.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 6px;
}

/* Input Fields */
.form-control {
    width: 100%;
    padding: 10px 15px;
    font-size: 14px;
    font-family: inherit;
    color: var(--auth-text);
    background: #fafafa;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.25s ease;
    outline: none;
}

.form-control::placeholder {
    color: #adb5bd;
    font-size: 13px;
    font-weight: 400;
}

.form-control:hover {
    border-color: #c8c8c8;
    background: #ffffff;
}

.form-control:focus {
    border-color: var(--auth-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(149, 16, 16, 0.08);
}

.form-control.is-invalid {
    border-color: #ef4444;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

/* Input Groups */
.input-group {
    display: flex;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    transition: all 0.25s ease;
}

.input-group:hover {
    border-color: #c8c8c8;
    background: #ffffff;
}

.input-group:focus-within {
    border-color: var(--auth-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(149, 16, 16, 0.08);
}

.input-group .form-control {
    border: none;
    box-shadow: none !important;
    padding: 10px 15px;
    background: transparent;
}

.input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    background: transparent;
    border: none;
    color: var(--auth-text-light);
    font-size: 18px;
    cursor: autochce;
    transition: color 0.2s;
}

.input-group:focus-within .input-group-text:first-child {
    color: var(--auth-primary);
}

.input-group-text:last-child:hover {
    color: var(--auth-text);
}

/* Validation Feedback */
.invalid-feedback {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #ef4444;
    font-weight: 500;
}

.text-muted {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--auth-text-light);
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 !important;
}

.form-check-input {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--auth-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    margin: 0 !important;
    position: relative;
}

.form-check-input:hover {
    border-color: var(--auth-primary);
}

.form-check-input:checked {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
}

.form-check-input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.form-check-label {
    font-size: 13px;
    color: var(--auth-text);
    cursor: pointer;
    user-select: none;
}

/* ══════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(149, 16, 16, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(149, 16, 16, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-dark {
    background: white;
    color: var(--auth-text);
    border: 1.5px solid #e0e0e0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn-outline-dark:hover {
    background: #f8f9fa;
    border-color: #c8c8c8;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.w-100 {
    width: 100%;
}

/* ══════════════════════════════════════════
   LINKS
   ══════════════════════════════════════════ */
.auth-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

/* ══════════════════════════════════════════
   DIVIDER
   ══════════════════════════════════════════ */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--auth-text-light);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 500;
}

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

.auth-divider span {
    padding: 0 14px;
}

/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--auth-border);
    font-size: 13px;
    color: var(--auth-text-light);
}

/* ══════════════════════════════════════════
   LANGUAGE SWITCHER
   ══════════════════════════════════════════ */
.auth-lang-switcher {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
}

[dir="rtl"] .auth-lang-switcher {
    right: auto;
    left: 24px;
}

.auth-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    color: var(--auth-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.auth-lang-btn:hover {
    background: var(--auth-bg-page);
    border-color: var(--auth-primary);
    color: var(--auth-primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

/* ══════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════ */
.auth-alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid;
}

.auth-alert--success {
    background: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}

.auth-alert--danger {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

/* ══════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════ */
.mb-0 {
    margin-bottom: 0 !important;
}

.mb-2 {
    margin-bottom: 10px !important;
}

.mb-3 {
    margin-bottom: 16px !important;
}

.mb-4 {
    margin-bottom: 20px !important;
}

.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-center {
    align-items: center !important;
}

.row {
    display: flex;
    margin: 0 -8px;
}

[dir="rtl"] .row {
    direction: rtl;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 8px;
}

/* ══════════════════════════════════════════
   RESPONSIVE DESIGN
   ══════════════════════════════════════════ */

/* Large Tablets */
@media (max-width: 1024px) {
    .auth-container {
        max-width: 900px;
    }

    .auth-image-panel {
        flex: 0 0 35%;
        padding: 0;
    }

    .auth-image-panel img {
        object-fit: cover;
        object-position: top center;
    }

    .auth-form-panel {
        padding: 50px 40px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .auth-page {
        padding: 20px 15px;
    }

    .auth-container {
        flex-direction: column;
        max-width: 500px;
        min-height: auto;
    }

    [dir="rtl"] .auth-container {
        flex-direction: column;
    }

    .auth-image-panel {
        flex: 0 0 auto;
        padding: 0;
        min-height: 250px;
    }

    .auth-image-panel img {
        object-fit: cover;
        object-position: top center;
    }

    .auth-image-content h2 {
        font-size: 24px;
    }

    .auth-image-content p {
        font-size: 14px;
    }

    .auth-form-panel {
        padding: 40px 30px;
    }

    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .row {
        flex-direction: column;
        margin: 0;
    }

    .auth-title {
        font-size: 24px;
    }

    .auth-subtitle {
        font-size: 14px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .auth-page {
        padding: 15px 10px;
    }

    .auth-container {
        border-radius: 15px;
    }

    .auth-image-panel {
        padding: 0;
        min-height: 200px;
    }

    .auth-image-panel img {
        object-fit: cover;
        object-position: top center;
    }

    .auth-image-content h2 {
        font-size: 20px;
    }

    .auth-form-panel {
        padding: 30px 20px;
    }

    .auth-form-inner {
        max-width: 100%;
    }

    .auth-title {
        font-size: 22px;
    }

    .form-control,
    .btn {
        font-size: 14px;
        padding: 11px 14px;
    }

    .auth-logo-icon,
    .auth-logo img {
        width: 44px;
        height: 44px;
        max-height: 44px;
        font-size: 22px;
    }

    .auth-logo-text {
        font-size: 20px;
    }

    .auth-lang-switcher {
        top: 15px;
        right: 15px;
    }

    [dir="rtl"] .auth-lang-switcher {
        left: 15px;
    }
}

/* Very Small Mobile */
@media (max-width: 360px) {
    .auth-image-panel {
        padding: 25px 15px;
    }

    .auth-form-panel {
        padding: 25px 15px;
    }

    .auth-header {
        margin-bottom: 24px;
    }

    .form-group {
        margin-bottom: 16px;
    }
}

/* ══════════════════════════════════════════
   ACCESSIBILITY
   ══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
.form-control:focus-visible,
.btn:focus-visible,
.auth-link:focus-visible {
    outline-offset: 2px;
}

/* Print Styles */
@media print {

    .auth-page::before,
    .auth-image-panel,
    .auth-lang-switcher {
        display: none !important;
    }

    .auth-container {
        box-shadow: none !important;
        max-width: 100% !important;
    }

    .auth-form-panel {
        padding: 20px !important;
    }
}