/* 
   HifzTrack - Premium Auth Stylesheet (Arabic Egyptian first)
   Designed with custom glassmorphism, modern split desktop layouts, and seamless light/dark modes.
*/

:root {
    --auth-bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    --auth-card-bg: rgba(255, 255, 255, 0.75);
    --auth-card-border: rgba(255, 255, 255, 0.6);
    --auth-card-shadow: 0 20px 50px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.01);
    --auth-text: #0f172a;
    --auth-text-muted: #64748b;
    --auth-input-bg: rgba(255, 255, 255, 0.9);
    --auth-input-border: #e2e8f0;
    --auth-input-focus-bg: #ffffff;
    --auth-input-text: #0f172a;
    --auth-brand-bg: linear-gradient(135deg, #1e5c30 0%, #0f3d1e 100%);
    --auth-brand-text: #ffffff;
    --auth-brand-muted: #a7f3d0;
    --auth-divider-color: #e2e8f0;
    
    /* System Globals */
    --primary: #2d9f4e;
    --primary-dark: #1a5c2e;
    --primary-light: #4ade80;
    --gold: #c9a94e;
    --gold-light: #f59e0b;
    --gold-dark: #a8882e;
    --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-lg: 24px;
    --border-radius-md: 14px;
}

body.dark-mode {
    --auth-bg-gradient: linear-gradient(135deg, #070a13 0%, #0d1527 50%, #0b1e12 100%);
    --auth-card-bg: rgba(30, 41, 59, 0.45);
    --auth-card-border: rgba(255, 255, 255, 0.05);
    --auth-card-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.02);
    --auth-text: #f1f5f9;
    --auth-text-muted: #94a3b8;
    --auth-input-bg: rgba(15, 23, 42, 0.5);
    --auth-input-border: rgba(255, 255, 255, 0.08);
    --auth-input-focus-bg: rgba(15, 23, 42, 0.8);
    --auth-input-text: #f8fafc;
    --auth-brand-bg: linear-gradient(135deg, #091910 0%, #050d18 100%);
    --auth-brand-text: #f8fafc;
    --auth-brand-muted: #34d399;
    --auth-divider-color: rgba(255, 255, 255, 0.08);
}

/* Base Full Page Styling */
.auth-page-wrapper {
    min-height: 100vh;
    display: flex;
    background: var(--auth-bg-gradient);
    font-family: 'Cairo', sans-serif;
    color: var(--auth-text);
    transition: var(--transition-smooth);
    position: relative;
    overflow-x: hidden;
}

/* Split Layout Styling */
.auth-split-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* Left Brand Column (Desktop) */
.auth-brand-deck {
    display: none;
    width: 45%;
    background: var(--auth-brand-bg);
    color: var(--auth-brand-text);
    position: relative;
    overflow: hidden;
    padding: 60px;
    flex-direction: column;
    justify-content: space-between;
    z-index: 2;
    transition: var(--transition-smooth);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
}

/* Right Form Column */
.auth-form-deck {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    z-index: 3;
}

@media (min-width: 992px) {
    .auth-brand-deck {
        display: flex;
    }
    .auth-form-deck {
        width: 55%;
        padding: 60px;
    }
}

/* Arabesque Geometric Overlay */
.auth-brand-deck::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='rgba(74,222,128,0.06)' stroke-width='1.5'%3E%3Cpath d='M80 0 L160 80 L80 160 L0 80 Z'/%3E%3Ccircle cx='80' cy='80' r='50'/%3E%3Cpath d='M40 40 L120 120 M120 40 L40 120'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.85;
    pointer-events: none;
    z-index: 1;
}

body.dark-mode .auth-brand-deck::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='rgba(52,211,153,0.03)' stroke-width='1.5'%3E%3Cpath d='M80 0 L160 80 L80 160 L0 80 Z'/%3E%3Ccircle cx='80' cy='80' r='50'/%3E%3Cpath d='M40 40 L120 120 M120 40 L40 120'/%3E%3C/g%3E%3C/svg%3E");
}

/* Glowing spiritual back-light effect */
.auth-brand-deck::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(45, 159, 78, 0.15) 0%, rgba(201, 169, 78, 0.05) 50%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* Content on Brand Column */
.brand-deck-header {
    position: relative;
    z-index: 2;
}

.brand-deck-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 24px;
    font-weight: 800;
    color: var(--auth-brand-text);
    text-decoration: none;
}

.brand-deck-logo i {
    font-size: 28px;
    color: var(--gold);
    text-shadow: 0 0 15px rgba(201, 169, 78, 0.4);
}

.brand-deck-body {
    position: relative;
    z-index: 2;
    margin: auto 0;
}

.brand-deck-badge {
    background: rgba(45, 159, 78, 0.15);
    color: var(--auth-brand-muted);
    border: 1px solid rgba(45, 159, 78, 0.25);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.brand-deck-body h1 {
    font-size: 40px;
    font-weight: 900;
    line-height: 1.4;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.brand-deck-body h1 span {
    color: var(--gold);
    display: block;
    font-size: 48px;
}

.brand-deck-body p {
    font-size: 16px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 35px;
    max-width: 90%;
}

/* Premium Features List on Left Side */
.brand-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.brand-feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-radius: var(--border-radius-md);
    transition: var(--transition-smooth);
}

.brand-feature-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(201, 169, 78, 0.15);
}

.brand-feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(45, 159, 78, 0.15);
    color: var(--auth-brand-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.brand-feature-text h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px;
}

.brand-feature-text p {
    font-size: 13px;
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    max-width: 100%;
}

.brand-deck-footer {
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 25px;
}

.brand-deck-footer .quran-verse {
    font-size: 16px;
    color: var(--gold-light);
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    line-height: 1.6;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.brand-deck-footer .quran-reference {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-top: 5px;
    font-weight: 600;
}

/* Glassmorphic Form Card Styling */
.auth-card {
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    box-shadow: var(--auth-card-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 480px;
    transition: var(--transition-smooth);
    animation: authCardFadeIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes authCardFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Card Header */
.auth-logo-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}

@media (min-width: 992px) {
    .auth-logo-mobile {
        display: none;
    }
}

.auth-logo-mobile .logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    margin-bottom: 15px;
    box-shadow: 0 8px 20px rgba(45, 159, 78, 0.25);
    position: relative;
}

.auth-logo-mobile h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}

.auth-logo-mobile p {
    font-size: 13px;
    color: var(--auth-text-muted);
    margin: 5px 0 0;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

@media (max-width: 991px) {
    .auth-header {
        margin-top: 10px;
    }
}

.auth-header h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--auth-text);
    margin: 0 0 8px;
}

.auth-header p {
    font-size: 14px;
    color: var(--auth-text-muted);
    margin: 0;
}

/* Premium Form Elements */
.form-label {
    color: var(--auth-text);
    font-weight: 600 !important;
    font-size: 14px;
    margin-bottom: 8px;
}

.input-group {
    border-radius: var(--border-radius-md);
    background: var(--auth-input-bg);
    border: 2px solid var(--auth-input-border);
    transition: var(--transition-smooth);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(45, 159, 78, 0.12);
    background: var(--auth-input-focus-bg);
}

.input-group-text {
    background: transparent !important;
    border: none !important;
    color: var(--auth-text-muted);
    padding: 12px 18px !important;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

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

.form-control {
    background: transparent !important;
    border: none !important;
    color: var(--auth-input-text) !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    height: auto !important;
    box-shadow: none !important;
    direction: rtl !important;
    text-align: right !important;
}

.form-control::placeholder {
    color: var(--auth-text-muted);
    opacity: 0.6;
}

.form-control:focus {
    outline: none !important;
}

/* Password Toggle Feature Styling */
.password-toggle-btn {
    background: transparent;
    border: none;
    color: var(--auth-text-muted);
    padding: 0 16px;
    cursor: pointer;
    font-size: 15px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-btn:hover {
    color: var(--primary);
}

/* Custom Select Dropdown Box */
select.form-control {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8.5L1.5 4h9z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 16px center !important;
    padding-left: 45px !important;
}

body.dark-mode select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8.5L1.5 4h9z'/%3E%3C/svg%3E") !important;
}

/* Alerts / Notification Blocks */
.alert {
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 600;
    padding: 14px 20px;
    margin-bottom: 25px;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #ef4444 !important;
    border-right: 4px solid #ef4444;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #10b981 !important;
    border-right: 4px solid #10b981;
}

.alert-info {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #3b82f6 !important;
    border-right: 4px solid #3b82f6;
}

.alert a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.alert .btn-close {
    margin-right: auto;
    margin-left: 0;
    background-size: 0.75em;
    filter: invert(0.3);
}

body.dark-mode .alert .btn-close {
    filter: invert(0.9);
}

/* Remember me & Forgot Password Styling */
.form-check-input {
    width: 18px;
    height: 18px;
    border-radius: 6px !important;
    border: 2px solid var(--auth-input-border);
    background-color: var(--auth-input-bg);
    cursor: pointer;
    margin-top: 0;
    transition: var(--transition-smooth);
}

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

.form-check-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-text-muted);
    cursor: pointer;
    padding-right: 6px;
    user-select: none;
}

.form-check-input:checked ~ .form-check-label {
    color: var(--auth-text);
}

.forgot-password-link {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

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

body.dark-mode .forgot-password-link:hover {
    color: var(--primary-light);
}

/* Primary Button Styling */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    border: none !important;
    border-radius: var(--border-radius-md) !important;
    padding: 13px 25px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(45, 159, 78, 0.25) !important;
    transition: var(--transition-smooth) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(45, 159, 78, 0.35), 0 0 15px rgba(45, 159, 78, 0.2) !important;
}

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

.btn-primary i {
    font-size: 16px;
    transition: var(--transition-smooth);
}

.btn-primary:hover i {
    transform: translateX(-3px); /* Move leftwards in RTL */
}

/* Outlined Alternative Button styling */
.btn-outline-primary {
    border: 2px solid var(--primary) !important;
    background: transparent !important;
    color: var(--primary) !important;
    border-radius: var(--border-radius-md) !important;
    padding: 12px 25px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    transition: var(--transition-smooth) !important;
    box-shadow: none !important;
}

.btn-outline-primary:hover {
    background: var(--primary) !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(45, 159, 78, 0.2) !important;
}

/* Form Helper Footer Items */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 25px 0;
    color: var(--auth-text-muted);
    font-size: 13px;
    font-weight: 600;
}

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

.auth-footer-text {
    font-size: 14px;
    color: var(--auth-text-muted);
    font-weight: 600;
}

.auth-footer-text a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition-smooth);
    margin-right: 4px;
}

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

body.dark-mode .auth-footer-text a:hover {
    color: var(--primary-light);
}

/* Floating Dark Mode Button Shortcut */
.floating-theme-toggle {
    position: fixed;
    top: 25px;
    left: 25px; /* Floats on left corner for RTL */
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    box-shadow: var(--auth-card-shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--auth-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition-smooth);
}

.floating-theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    color: var(--primary);
}

/* Return to main site page shortcut link button */
.return-home-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--auth-text-muted);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition-smooth);
    margin-top: 15px;
}

.return-home-link:hover {
    color: var(--primary);
}

.return-home-link i {
    font-size: 13px;
    transition: var(--transition-smooth);
}

.return-home-link:hover i {
    transform: translateX(4px); /* Moves rightwards towards main page */
}

/* Registration Grid System (2 columns on Desktop to decrease layout height) */
.register-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px 20px;
    margin-bottom: 25px;
}

@media (min-width: 576px) {
    .register-grid-2col {
        grid-template-columns: 1fr 1fr;
    }
}

.register-grid .form-group-full {
    grid-column: 1 / -1;
}

/* Custom Scrollbar for auth content */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(45, 159, 78, 0.2);
    border-radius: 50px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(45, 159, 78, 0.4);
}
