﻿:root {
    --primary: #1a3a5c;
    --primary-light: #2563a8;
    --primary-dark: #0f2640;
    --accent: #c8860a;
    --accent-light: #f0a830;
    --accent-dark: #a06a05;
    --gold: #d4a017;
    --success: #1a6e3c;
    --danger: #9b1c2e;
    --bg: #f4f1eb;
    --bg-card: #ffffff;
    --bg-elevated: #faf8f4;
    --bg-secondary: #faf8f4;
    --border: #ddd5c0;
    --border-light: #ede8dc;
    --border-color: #ddd5c0;
    --text-main: #1c1c1c;
    --text-muted: #6b6255;
    --text-light: #9c9285;
    --text-primary: #1c1c1c;
    --text-secondary: #6b6255;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --shadow: 0 2px 12px rgba(26,58,92,0.10);
    --shadow-md: 0 4px 24px rgba(26,58,92,0.14);
}

/* ============================================================
           Page Layout
           ============================================================ */
.login-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: hidden;
}

/* ── Background: داكن موحد مطابق لصفحة التشريعات ── */
.login-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    overflow: hidden;
}

.animated-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.12;
    animation: float 25s infinite ease-in-out;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: var(--primary-light);
    top: -150px;
    right: -150px;
    animation-duration: 28s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    bottom: -100px;
    left: -100px;
    animation-delay: 5s;
    animation-duration: 32s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: var(--primary-light);
    top: 50%;
    left: 30%;
    animation-delay: 10s;
    animation-duration: 36s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(40px, -40px) scale(1.08);
    }

    66% {
        transform: translate(-40px, 40px) scale(0.92);
    }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

/* ============================================================
           Card
           ============================================================ */
.login-card {
    position: relative;
    z-index: 1;
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.2);
    background: var(--bg-card);
    overflow: visible;
    animation: cardEntrance 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 620px;
    margin: 0 auto;
    width: 100%;
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Header: داكن + حد ذهبي سفلي — مطابق لـ header في search ── */
.login-header {
    text-align: center;
    padding: 1.75rem 1.5rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    border-bottom: 3px solid var(--accent);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.logo-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Logo backdrop: ذهبي — مطابق لـ .logo-icon في search ── */
.logo-backdrop {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 100%);
    border-radius: 18px;
    transform: rotate(45deg);
    box-shadow: 0 4px 20px rgba(200,134,10,0.45);
    animation: logoRotate 20s linear infinite;
}

@keyframes logoRotate {
    0% {
        transform: rotate(45deg);
    }

    100% {
        transform: rotate(405deg);
    }
}

.logo-container i {
    position: relative;
    font-size: 2.4rem;
    color: #ffffff;
    z-index: 1;
}

/* ── Title: أبيض على الخلفية الداكنة ── */
.login-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.01em;
    font-family: 'Tajawal', sans-serif;
}

/* ============================================================
           Form
           ============================================================ */
.card-body {
    padding: 0;
}

.login-form {
    padding: 1.5rem 1.75rem;
    background: var(--bg-card);
}

.form-group-enhanced {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-label-enhanced {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

    .form-label-enhanced i {
        font-size: 0.9rem;
        color: var(--accent);
    }

.input-wrapper {
    position: relative;
}

    .input-wrapper.focused .input-focus-line {
        width: 100%;
    }

.form-control-enhanced {
    width: 100%;
    padding: 0.6rem 0.875rem;
    font-size: 0.9375rem;
    font-family: 'Tajawal', sans-serif;
    color: var(--text-main);
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.25s ease;
    font-weight: 500;
}

    .form-control-enhanced:focus {
        outline: none;
        border-color: var(--primary-light);
        background: #ffffff;
        box-shadow: 0 0 0 3px rgba(37,99,168,0.1);
    }

    .form-control-enhanced::placeholder {
        color: var(--text-light);
        font-weight: 400;
    }

.input-focus-line {
    position: absolute;
    bottom: -1px;
    right: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    border-radius: 2px;
    transition: width 0.35s ease;
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    font-size: 1rem;
    transition: color 0.2s ease;
    border-radius: var(--radius-sm);
    z-index: 2;
}

    .password-toggle:hover {
        color: var(--primary);
    }

.password-wrapper .form-control-enhanced {
    padding-left: 3rem;
}

.validation-message {
    display: block;
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.35rem;
    font-weight: 500;
}

/* ── Options Row ── */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
    background: var(--bg-card);
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

    .custom-checkbox:checked {
        background: var(--primary);
        border-color: var(--primary);
    }

        .custom-checkbox:checked::after {
            content: '\f00c';
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: #fff;
            font-size: 0.65rem;
        }

    .custom-checkbox:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(26,58,92,0.1);
    }

.remember-me label {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.forgot-password {
    font-size: 0.875rem;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

    .forgot-password:hover {
        color: var(--primary);
    }

/* ── Terms ── */
.terms-agreement {
    margin: 0 0 1.25rem;
}

.terms-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
    user-select: none;
}

    .terms-check input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-top: 2px;
        border: 1.5px solid var(--border);
        border-radius: 4px;
        cursor: pointer;
        appearance: none;
        background: var(--bg-card);
        transition: all 0.2s ease;
        position: relative;
        flex-shrink: 0;
    }

        .terms-check input[type="checkbox"]:checked {
            background: var(--accent);
            border-color: var(--accent);
        }

            .terms-check input[type="checkbox"]:checked::after {
                content: '\f00c';
                font-family: 'Font Awesome 6 Free';
                font-weight: 900;
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                color: #fff;
                font-size: 0.65rem;
            }

    .terms-check a {
        color: var(--accent);
        font-weight: 700;
        text-decoration: underline;
        transition: color 0.2s;
    }

        .terms-check a:hover {
            color: var(--primary);
        }

.terms-error {
    display: none;
    align-items: center;
    gap: 0.35rem;
    color: var(--danger);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.4rem;
}

    .terms-error.show {
        display: flex;
    }

/* ── Login Button: مطابق لـ .btn-search-main ── */
.btn-login {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(26,58,92,0.3);
}

    .btn-login:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 5px 18px rgba(26,58,92,0.35);
    }

    .btn-login:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        box-shadow: none;
    }

.btn-text, .btn-icon {
    position: relative;
    z-index: 1;
}

    .btn-icon i {
        transition: transform 0.25s ease;
    }

.btn-login:hover:not(:disabled) .btn-icon i {
    transform: translateX(-3px);
}

.btn-shine {
    position: absolute;
    top: -50%;
    left: -100%;
    width: 50%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transform: skewX(-20deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    50%, 100% {
        left: 200%;
    }
}

/* ── Divider ── */
.divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
}

    .divider::before, .divider::after {
        content: '';
        flex: 1;
        border-bottom: 1px solid var(--border);
    }

    .divider span {
        padding: 0 0.875rem;
        color: var(--text-muted);
        font-size: 0.8125rem;
        font-weight: 500;
        background: var(--bg-card);
    }

/* ── Register ── */
.register-prompt {
    text-align: center;
}

    .register-prompt p {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
        font-weight: 500;
        color: var(--text-muted);
    }

.btn-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background: transparent;
    border: 1.5px solid var(--accent);
    border-radius: var(--radius);
    color: var(--accent);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
    text-decoration: none;
    transition: all 0.2s ease;
}

    .btn-register:hover {
        background: var(--accent);
        color: #ffffff;
        transform: translateY(-1px);
        box-shadow: 0 4px 16px rgba(200,134,10,0.3);
    }

/* ============================================================
           Card Footer
           ============================================================ */
.card-footer-enhanced {
    padding: 1rem 1.75rem;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-light);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 600;
}

    .security-badge i {
        font-size: 1rem;
    }

.support-contact {
    margin-top: 0.875rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.support-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

    .support-title i {
        color: var(--accent);
    }

.support-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.375rem 1rem;
}

    .support-numbers a {
        font-size: 0.9rem;
        color: var(--primary);
        font-weight: 600;
        text-decoration: none;
        transition: color 0.2s;
        padding: 0.2rem 0.4rem;
        border-radius: var(--radius-sm);
    }

        .support-numbers a:hover {
            color: var(--accent);
        }

/* ============================================================
           System Info Cards — مطابقة لـ .info-item في search
           ============================================================ */
.system-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
    margin-top: 1.5rem;
    padding: 0 0.25rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.875rem;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

    .info-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    }

    .info-item i {
        font-size: 1.25rem;
        color: var(--accent);
    }

    .info-item span {
        font-size: 0.78rem;
        color: var(--text-main);
        font-weight: 600;
        text-align: center;
    }

/* ============================================================
           Floating Scale
           ============================================================ */
.floating-scale {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2;
    font-size: 4rem;
    color: rgba(255,255,255,0.12);
    pointer-events: none;
    animation: scaleBreath 4s ease-in-out infinite;
}

@keyframes scaleBreath {
    0%, 100% {
        transform: scale(1);
        opacity: 0.12;
    }

    50% {
        transform: scale(1.12);
        opacity: 0.2;
    }
}

/* ============================================================
           Responsive
           ============================================================ */
@media (max-width: 768px) {
    .login-form {
        padding: 1.25rem;
    }

    .login-header {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .system-info {
        grid-template-columns: 1fr;
        gap: 0.625rem;
        margin-top: 1.25rem;
    }

    .info-item {
        flex-direction: row;
        justify-content: flex-start;
        padding: 0.75rem;
    }

    .floating-scale {
        font-size: 3rem;
        bottom: 1rem;
        right: 1rem;
    }

    .card-footer-enhanced {
        padding: 0.875rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .login-card {
        border-radius: var(--radius-lg);
    }

    .login-header h3 {
        font-size: 1.25rem;
    }

    .btn-login {
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
    }

    .support-numbers {
        flex-direction: column;
        gap: 0.25rem;
    }
}

.navbar-brand {
    color: #fff !important;
    letter-spacing: .5px;
    white-space: nowrap;
}

.bar {
    background: linear-gradient(135deg, var(--primary) 100%, var(--primary-light) 0%) !important;
}

.support-group {
    margin-top: 0.6rem;
}

.support-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.25rem;
    text-align: center;
}

