/**
 * login.css — Premium Login Page Styles
 * Domain Hosting System - DHS Yönetim
 * Dark glassmorphism theme with animated background + 3D Card Flip
 */

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

/* ─── CSS Variables ─── */
:root {
    --login-bg-start: #0a0a1a;
    --login-bg-mid: #0d0d2b;
    --login-bg-end: #0f0f23;
    --card-bg: rgba(18, 18, 40, 0.75);
    --card-border: rgba(99, 102, 241, 0.15);
    --card-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 120px rgba(99, 102, 241, 0.05);
    --input-bg: rgba(30, 30, 60, 0.6);
    --input-border: rgba(99, 102, 241, 0.2);
    --input-focus-border: #6366f1;
    --input-focus-glow: rgba(99, 102, 241, 0.3);
    --text-primary: #f0f0ff;
    --text-secondary: #a8b2d1;
    --text-muted: #6b7394;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    --btn-glow: 0 0 30px rgba(99, 102, 241, 0.4), 0 0 60px rgba(139, 92, 246, 0.2);
    --danger: #ef4444;
    --success: #22c55e;
}

/* ─── Reset & Base ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body.login-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--login-bg-start);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── Animated Mesh Gradient Background ─── */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.login-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(59, 130, 246, 0.06) 0%, transparent 40%);
    animation: bgPulse 12s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-3%, -3%) scale(1.05); }
}

/* ─── Floating Orbs ─── */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3), transparent);
    top: -10%;
    left: -5%;
    animation-duration: 18s;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.25), transparent);
    bottom: -15%;
    right: -5%;
    animation-duration: 22s;
    animation-delay: -5s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.2), transparent);
    top: 50%;
    left: 60%;
    animation-duration: 25s;
    animation-delay: -10s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.02); }
}

/* ─── Floating Grid Particles ─── */
.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(99, 102, 241, 0.4);
    border-radius: 50%;
    animation: particleRise linear infinite;
}

@keyframes particleRise {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ─── Login Container ─── */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 1rem;
    animation: containerEnter 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes containerEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═════════════════════════════════════════════
   3D CARD FLIP SCENE
   ═════════════════════════════════════════════ */
.card-scene {
    perspective: 1200px;
    width: 100%;
}

.card-flipper {
    position: relative;
    width: 100%;
    transition: transform 0.7s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
}

.card-flipper.flipped {
    transform: rotateY(180deg);
}

.card-face {
    width: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card-front {
    position: relative;
    z-index: 2;
}

.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: rotateY(180deg);
    z-index: 1;
}

/* ─── Login Card (Glassmorphism) ─── */
.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5), rgba(139, 92, 246, 0.3), transparent);
}

.login-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.04), transparent 60%);
    pointer-events: none;
}

/* ─── Logo & Branding ─── */
.login-logo-wrap {
    text-align: center;
    margin-bottom: 1.8rem;
    position: relative;
    z-index: 1;
}

.login-logo-img {
    height: 52px;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.2));
    transition: transform 0.4s ease;
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.login-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 0.6rem;
    font-weight: 500;
}

/* ─── Section Title ─── */
.login-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.login-desc {
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
    line-height: 1.5;
}

/* ─── Form Groups ─── */
.login-form-group {
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 1;
}

.login-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 0.5rem;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    transition: color 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.login-input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-input::placeholder {
    color: var(--text-muted);
    font-weight: 300;
}

.login-input:focus {
    border-color: var(--input-focus-border);
    background: rgba(30, 30, 60, 0.85);
    box-shadow: 0 0 0 4px var(--input-focus-glow), inset 0 0 20px rgba(99, 102, 241, 0.03);
}

.login-input:focus + .input-icon,
.login-input:focus ~ .input-icon {
    color: var(--accent-primary);
}

.login-input-wrap:has(.login-input:focus) .input-icon {
    color: var(--accent-primary);
}

/* Password toggle */
.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    z-index: 2;
    transition: color 0.3s ease;
}

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

/* ─── Submit Button ─── */
.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

.login-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--btn-glow);
}

.login-btn:hover::before { opacity: 1; }

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.login-btn .btn-text { position: relative; z-index: 1; }
.login-btn .btn-icon { margin-right: 8px; position: relative; z-index: 1; }

/* Ripple effect */
.login-btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}

/* ─── Bottom Links ─── */
.login-links {
    text-align: center;
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
}

.login-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.login-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 1.5px;
    background: var(--accent-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.login-links a:hover {
    color: var(--accent-primary);
}

.login-links a:hover::after {
    width: 100%;
}

/* ─── Error Alert ─── */
.login-alert {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #fca5a5;
    position: relative;
    z-index: 1;
    animation: alertShake 0.5s ease;
}

.login-alert .alert-icon {
    font-size: 1.1rem;
    color: var(--danger);
    flex-shrink: 0;
}

/* Success variant */
.login-alert.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.login-alert.alert-success .alert-icon {
    color: var(--success);
}

@keyframes alertShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(2px); }
}

/* ─── 2FA Section ─── */
.twofa-info {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.twofa-shield {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    animation: shieldPulse 2s ease-in-out infinite;
}

@keyframes shieldPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
}

.twofa-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.twofa-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 2FA Code Input */
.twofa-input {
    text-align: center;
    letter-spacing: 10px;
    font-size: 1.8rem;
    font-weight: 700;
    padding: 16px !important;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Trust device checkbox */
.login-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 1rem 0 0.5rem;
    position: relative;
    z-index: 1;
}

.login-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.login-check label {
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.login-check label:hover { color: var(--text-secondary); }

/* ─── Divider ─── */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1.5rem 0;
    position: relative;
    z-index: 1;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.2), transparent);
}

.login-divider span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

/* ─── Footer ─── */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.login-footer p {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.6;
    letter-spacing: 0.3px;
}

/* ─── Loading Spinner ─── */
.login-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═════════════════════════════════════════════
   RESET PASSWORD ICON
   ═════════════════════════════════════════════ */
.reset-icon-wrap {
    text-align: center;
    margin-bottom: 1.2rem;
    position: relative;
    z-index: 1;
}

.reset-icon-circle {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(99, 102, 241, 0.1));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-secondary);
    border: 1px solid rgba(168, 85, 247, 0.25);
    animation: keyPulse 2s ease-in-out infinite;
}

@keyframes keyPulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.2);
        transform: rotate(0);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(168, 85, 247, 0);
        transform: rotate(-5deg);
    }
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
    .login-container {
        padding: 0.75rem;
        max-width: 100%;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    .login-logo-img {
        height: 42px;
    }
    
    .login-title {
        font-size: 1.3rem;
    }
    
    .login-input {
        padding: 12px 12px 12px 40px;
        font-size: 0.9rem;
    }
    
    .login-btn {
        padding: 13px;
        font-size: 0.95rem;
    }
    
    .twofa-input {
        font-size: 1.4rem;
        letter-spacing: 6px;
    }
    
    .orb { display: none; }
}

@media (max-width: 360px) {
    .login-card {
        padding: 1.5rem 1.2rem;
        border-radius: 16px;
    }
    
    .login-subtitle {
        font-size: 0.7rem;
        letter-spacing: 2px;
    }
}

/* ─── Landscape Mobile ─── */
@media (max-height: 600px) and (orientation: landscape) {
    html, body { overflow: auto; }
    
    .login-card {
        padding: 1.5rem;
    }
    
    .login-logo-wrap {
        margin-bottom: 1rem;
    }
    
    .login-form-group {
        margin-bottom: 0.8rem;
    }
}
