/* templates/registration/login.html */

html {
    scrollbar-gutter: stable;
}

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #475569;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.3);
}
body {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-primary);
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Animated Background */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 40%);
}

/* Floating Shapes - ریسپانسیو */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
    pointer-events: none;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    bottom: 100px;
    left: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    top: 40%;
    right: 10%;
    animation-delay: -10s;
}

@media (max-width: 640px) {
    .shape-1 {
        width: 180px;
        height: 180px;
        top: -60px;
        right: -60px;
    }
    .shape-2 {
        width: 120px;
        height: 120px;
        bottom: 60px;
        left: -30px;
    }
    .shape-3 {
        width: 90px;
        height: 90px;
        top: 35%;
        right: 5%;
    }
}

@media (max-width: 380px) {
    .shape-1, .shape-2, .shape-3 {
        opacity: 0.06;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(5deg);
    }
    50% {
        transform: translateY(0px) rotate(0deg);
    }
    75% {
        transform: translateY(20px) rotate(-5deg);
    }
}

/* Login Card - ریسپانسیو */
.login-card {
    position: relative;
    z-index: 10;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 24px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

@media (max-width: 640px) {
    .login-card {
        border-radius: 20px;
    }
}

@media (max-width: 380px) {
    .login-card {
        border-radius: 16px;
    }
}

/* Logo Animation - ریسپانسیو */
.logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.4);
    animation: pulse-glow 3s infinite ease-in-out;
}

@media (max-width: 640px) {
    .logo-icon {
        width: 64px;
        height: 64px;
        font-size: 28px;
        border-radius: 16px;
    }
}

@media (max-width: 380px) {
    .logo-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
        border-radius: 14px;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 10px 60px rgba(59, 130, 246, 0.6);
    }
}

/* Input Styling */
.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 14px 48px 14px 18px;
    font-size: 16px; /* جلوگیری از زوم خودکار در iOS */
    min-height: 48px; /* حداقل ارتفاع لمسی */
    box-sizing: border-box;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 14px;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

@media (max-width: 380px) {
    .input-group input {
        padding: 12px 44px 12px 14px;
        min-height: 44px;
        border-radius: 12px;
    }
    .input-group .input-icon {
        right: 14px;
        font-size: 16px;
    }
}

.input-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
    background: var(--bg-secondary);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group .input-icon {
    position: absolute;
    right: 18px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    transition: color 0.3s ease;
}

.input-group:focus-within .input-icon {
    color: var(--accent);
}

/* Password visibility toggle */
.password-wrap {
    position: relative;
}
.password-wrap input {
    padding-left: 48px;
    padding-right: 48px;
}
.password-toggle {
    position: absolute;
    inset-inline-end: 14px;
    inset-inline-start: auto;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: color 0.2s ease;
    font-size: 18px;
}
.password-toggle:hover {
    color: var(--accent);
}

/* Button - ریسپانسیو */
.btn-login {
    width: 100%;
    padding: 14px 24px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.4);
}

.btn-login:hover::before {
    left: 100%;
}

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

@media (max-width: 640px) {
    .btn-login {
        padding: 13px 22px;
        min-height: 48px;
        font-size: 17px;
        border-radius: 12px;
    }
}

@media (max-width: 380px) {
    .btn-login {
        padding: 12px 18px;
        min-height: 44px;
        font-size: 16px;
        border-radius: 12px;
    }
}

/* Error Message - ریسپانسیو */
.error-message {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 14px 18px;
    color: #fca5a5;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 380px) {
    .error-message {
        padding: 12px 14px;
        font-size: 14px;
        gap: 8px;
    }
}

/* Particles */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.3;
    animation: particle-float 15s infinite ease-in-out;
    pointer-events: none;
}

.particle--1 { top: 20%; left: 10%; animation-delay: 0s; }
.particle--2 { top: 60%; left: 20%; animation-delay: -3s; }
.particle--3 { top: 30%; left: 80%; animation-delay: -6s; }
.particle--4 { top: 70%; left: 70%; animation-delay: -9s; }
.particle--5 { top: 40%; left: 50%; animation-delay: -12s; }

@keyframes particle-float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-100px) translateX(50px);
    }
    50% {
        transform: translateY(-50px) translateX(-30px);
    }
    75% {
        transform: translateY(-150px) translateX(20px);
    }
}

/* Footer - ریسپانسیو */
.footer-text {
    color: var(--text-muted);
    font-size: 14px;
}

@media (max-width: 380px) {
    .footer-text {
        font-size: 12px;
    }
}

/* Safe area برای دستگاه‌های با ناچ */
@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

.footer-text a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-text a:hover {
    color: #60a5fa;
}
