/* 
 * Fihris Premium Auth Design
 * Shared styles for login, register, forgot-password, reset-password
 */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: var(--l-accent); color: #fff; }
html { direction: rtl; scroll-behavior: smooth; }
body { font-family: 'Noto Kufi Arabic', sans-serif; background-color: var(--l-bg); color: var(--l-text); min-height: 100vh; }

.noise-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E"); opacity: 0.04; mix-blend-mode: multiply; }

.glow-overlay-1 { position: fixed; top: -20vh; right: -10vw; width: 70vw; height: 70vw; background: radial-gradient(circle, color-mix(in srgb, var(--l-accent) 5%, transparent) 0%, transparent 70%); border-radius: 50%; filter: blur(80px); z-index: 0; pointer-events: none; }
.glow-overlay-2 { position: fixed; bottom: -30vh; left: -10vw; width: 80vw; height: 80vw; background: radial-gradient(circle, color-mix(in srgb, var(--l-accent) 4%, transparent) 0%, transparent 70%); border-radius: 50%; filter: blur(100px); z-index: 0; pointer-events: none; }

.login-page { display: flex; min-height: 100vh; position: relative; z-index: 5; }

/* The sophisticated statement side */
.statement-side { 
    flex: 1.2; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    padding: 5rem clamp(3rem, 5vw, 7rem); 
    position: relative; 
    background: var(--l-text); 
    overflow: hidden;
}

/* Subtle elegant pattern for the statement side */
.statement-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(color-mix(in srgb, var(--l-accent) 15%, transparent) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.5;
    z-index: 0;
}

.form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 4rem clamp(2rem, 4vw, 5rem); background: var(--l-bg); overflow-y: auto; }

.brand { font-family: 'Aref Ruqaa', serif; font-size: 1.8rem; font-weight: 700; color: var(--l-bg); position: absolute; top: 3.5rem; right: clamp(3rem, 5vw, 7rem); letter-spacing: 0.02em; text-decoration: none; display: flex; align-items: center; gap: 0.6rem; z-index: 2;}
.brand svg { color: var(--l-accent); width: 38px; height: 38px; }
.brand span { color: var(--l-accent); padding-top: 5px; }

.hero-title { font-family: 'Aref Ruqaa', serif; font-size: clamp(3rem, 5.5vw, 5.5rem); font-weight: 700; line-height: 1.15; color: var(--l-bg); margin-bottom: 2rem; z-index: 2; position: relative;}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line-inner { display: block; transform: translateY(105%); }

.hero-sub { font-size: clamp(1rem, 1.3vw, 1.2rem); color: color-mix(in srgb, var(--l-bg) 80%, transparent); line-height: 1.9; max-width: 440px; opacity: 0; transform: translateY(20px); z-index: 2; position: relative;}

.hero-accent-line { width: 0; height: 2px; background: var(--l-accent); margin-top: 3.5rem; z-index: 2; position: relative;}
.hero-number { font-family: 'Space Grotesk', sans-serif; font-size: 0.85rem; font-weight: 500; color: color-mix(in srgb, var(--l-bg) 35%, transparent); letter-spacing: 0.15em; margin-top: 1.5rem; opacity: 0; z-index: 2; position: relative;}

.form-wrap { width: 100%; max-width: 420px; }
.form-title { font-family: 'Aref Ruqaa', serif; font-size: 2.2rem; margin-bottom: 3rem; color: var(--l-text); }

/* Premium Input Fields */
.field { position: relative; margin-bottom: 2rem; }
.field input { 
    width: 100%; 
    background: color-mix(in srgb, var(--l-border) 10%, transparent); 
    border: 1px solid var(--l-border); 
    padding: 1.2rem 1.2rem 1rem; 
    color: var(--l-text); 
    font-family: 'Noto Kufi Arabic', sans-serif; 
    font-size: 1.05rem; 
    outline: none; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    border-radius: 8px; 
    -webkit-appearance: none; 
}
.field input:focus { 
    border-color: var(--l-accent); 
    background: transparent;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--l-accent) 10%, transparent); 
}
.field label { 
    position: absolute; 
    top: 1.1rem; 
    right: 1.2rem; 
    color: var(--l-text-muted); 
    font-size: 1rem; 
    pointer-events: none; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    transform-origin: right top; 
}
.field input:focus ~ label, .field input:not(:placeholder-shown) ~ label { 
    transform: translateY(-1.9rem) scale(0.85); 
    color: var(--l-accent); 
    right: 0.5rem;
    background: var(--l-bg);
    padding: 0 0.5rem;
}
.field input:-webkit-autofill, .field input:-webkit-autofill:focus { 
    -webkit-box-shadow: 0 0 0 1000px var(--l-bg) inset !important; 
    -webkit-text-fill-color: var(--l-text) !important; 
}

/* Auth type radio buttons (for Register) */
.account-type-group { display: flex; gap: 1rem; margin-bottom: 2.5rem; }
.type-option { flex: 1; }
.type-option input { display: none; }
.type-option label { 
    display: block; 
    text-align: center; 
    padding: 1.2rem 1rem; 
    border: 1px solid var(--l-border); 
    border-radius: 8px;
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    color: var(--l-text-muted); 
    font-weight: 500;
}
.type-option label:hover {
    border-color: color-mix(in srgb, var(--l-accent) 50%, transparent);
}
.type-option input:checked + label { 
    border-color: var(--l-accent); 
    color: var(--l-accent); 
    background: color-mix(in srgb, var(--l-accent) 5%, transparent); 
    box-shadow: 0 4px 12px color-mix(in srgb, var(--l-accent) 10%, transparent);
}

/* Status Box (Errors/Success) */
.statusBox { overflow: hidden; max-height: 0; opacity: 0; margin-bottom: 0; border-radius: 8px; }
.statusBox .error-inner { display: flex; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.3rem; border-right: 3px solid #EF4444; background: rgba(239, 68, 68, 0.05); }
.statusBox.success .error-inner { border-right-color: #10B981; background: rgba(16, 185, 129, 0.05); }
.statusBox .error-icon { width: 22px; height: 22px; border: 1.5px solid #EF4444; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.statusBox.success .error-icon { border-color: #10B981; }
.statusBox .error-icon span { color: #EF4444; font-size: 0.8rem; font-weight: 600; line-height: 1; }
.statusBox.success .error-icon span { color: #10B981; content: "✓"; }
.statusBox .error-text { color: #B91C1C; font-size: 0.95rem; line-height: 1.7; }
.statusBox.success .error-text { color: #047857; }

.form-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; margin-bottom: 2rem; }
.remember { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.remember input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border: 1px solid var(--l-border); border-radius: 4px; background: transparent; cursor: pointer; transition: all 0.3s ease; position: relative; }
.remember input[type="checkbox"]:checked { border-color: var(--l-accent); background: var(--l-accent); }
.remember input[type="checkbox"]:checked::after { content: ''; position: absolute; top: 2px; left: 5px; width: 5px; height: 9px; border: solid #ffffff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.remember span { font-size: 0.95rem; color: var(--l-text-muted); transition: color 0.3s; }
.remember:hover span { color: var(--l-text); }

/* Premium Submit Button */
.submit-btn { 
    font-family: 'Space Grotesk', sans-serif; 
    font-size: 1.05rem; 
    font-weight: 600; 
    letter-spacing: 0.05em; 
    background: var(--l-text); 
    color: var(--l-bg); 
    border: none; 
    padding: 1.1rem 3rem; 
    cursor: pointer; 
    position: relative; 
    overflow: hidden; 
    border-radius: 8px; 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    width: 100%; 
    display: flex;
    justify-content: center;
    align-items: center;
}
.submit-btn::before { 
    content: ''; 
    position: absolute; 
    inset: 0; 
    background: var(--l-accent); 
    opacity: 0;
    transition: opacity 0.4s ease; 
    z-index: 0; 
}
.submit-btn:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 10px 25px color-mix(in srgb, var(--l-accent) 20%, transparent); 
}
.submit-btn:hover::before { opacity: 1; }
.submit-btn span { position: relative; z-index: 1; transition: color 0.4s; }
.submit-btn:disabled { opacity: 0.6; pointer-events: none; }

.text-link { color: var(--l-text-muted); font-size: 0.95rem; text-decoration: none; transition: all 0.3s; }
.text-link:hover { color: var(--l-accent); }

.bg-glyph { position: absolute; font-family: 'Aref Ruqaa', serif; color: color-mix(in srgb, var(--l-accent) 2.5%, transparent); pointer-events: none; user-select: none; line-height: 1; z-index: 1; }

@media (max-width: 900px) {
    .login-page { flex-direction: column; }
    .statement-side { padding: 5rem 2rem 3rem; flex: none; border-bottom: 1px solid color-mix(in srgb, var(--l-accent) 20%, transparent); }
    .form-side { padding: 3rem 1.5rem 4rem; flex: none; }
    .brand { top: 2rem; right: 1.5rem; }
    .bg-glyph { display: none; }
    .hero-title { font-size: clamp(2.5rem, 8vw, 3rem); }
}
@media (max-width: 480px) {
    .statement-side { padding: 4.5rem 1.2rem 2.5rem; }
    .form-side { padding: 2rem 1.2rem 3rem; }
    .form-actions { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
    .account-type-group { flex-direction: column; gap: 0.8rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
