/* ============================================
   DRENA ADZOPE - Page de Connexion Crystal Blue
   Design Moderne & Épuré (Bleu & Blanc)
   ============================================ */

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

/* Variables CSS */
:root {
    --primary-blue: #2563eb;
    --light-blue: #60a5fa;
    --dark-blue: #1e3a8a;
    --accent-cyan: #22d3ee;
    --pure-white: #ffffff;
    --bg-light: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.5);
    --error-bg: #fee2e2;
    --error-text: #ef4444;
}

/* Reset et Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    position: relative;
    overflow: hidden;
}

/* Dynamic Blue Gradient Background */
.bg-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(34, 211, 238, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 1) 0%, rgba(241, 245, 249, 1) 100%);
    z-index: -2;
}

/* Floating Abstract Shapes */
.shape {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
    z-index: -1;
    animation: shapeFloat 20s infinite alternate ease-in-out;
}

.shape-1 {
    width: 600px;
    height: 600px;
    background: var(--light-blue);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: var(--primary-blue);
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-cyan);
    top: 40%;
    right: 15%;
    animation-delay: -10s;
}

@keyframes shapeFloat {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1) rotate(20deg);
    }
}

/* Grid Overlay */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--primary-blue) 0.5px, transparent 0.5px);
    background-size: 30px 30px;
    opacity: 0.05;
    z-index: -1;
}

/* Main Wrapper */
.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

/* Logo & Branding */
.logo-section {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

.logo-icon {
    width: 80px;
    height: 80px;
    background: var(--pure-white);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow:
        0 10px 25px rgba(37, 99, 235, 0.1),
        inset 0 0 0 1px rgba(37, 99, 235, 0.05);
    position: relative;
}

.logo-icon::after {
    content: '';
    position: absolute;
    inset: -5px;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-cyan));
    border-radius: 24px;
    z-index: -1;
    opacity: 0.15;
}

.logo-icon svg {
    width: 45px;
    height: 45px;
    color: var(--primary-blue);
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.brand-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark-blue);
    letter-spacing: -1px;
}

.brand-title span {
    color: var(--primary-blue);
}

.brand-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 5px;
}

/* Glass Card */
.login-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 50px 40px;
    box-shadow:
        0 25px 50px -12px rgba(37, 99, 235, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    animation: scaleUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.login-container h2 {
    display: none;
}

/* Form Styling */
.input-group {
    position: relative;
    margin-bottom: 20px;
    animation: fadeInLeft 0.5s ease-out backwards;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.input-group:nth-child(1) {
    animation-delay: 0.3s;
}

.input-group:nth-child(2) {
    animation-delay: 0.4s;
}

.input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: all 0.3s ease;
    pointer-events: none;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 18px 20px 18px 56px;
    background: var(--pure-white);
    border: 2px solid transparent;
    border-radius: 20px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: var(--text-muted);
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: var(--pure-white);
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.15);
}

input[type="text"]:focus+.input-icon,
input[type="password"]:focus+.input-icon {
    color: var(--primary-blue);
}

/* Submit Button */
input[type="submit"] {
    width: 100%;
    padding: 18px;
    background: var(--primary-blue);
    color: var(--pure-white);
    border: none;
    border-radius: 20px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
    margin-top: 10px;
    animation: fadeInUp 0.5s ease-out 0.5s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

input[type="submit"]:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.5);
}

input[type="submit"]:active {
    transform: translateY(0);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 5px;
}

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

/* Error Alert */
.error {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 15px;
    border-radius: 18px;
    margin-bottom: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Links */
.login-footer {
    text-align: center;
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
    animation: fadeIn 1s ease-out 0.6s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

.login-footer a:hover {
    color: var(--primary-blue);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--light-blue);
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 480px) {
    .login-container {
        padding: 40px 25px;
    }

    .brand-title {
        font-size: 1.5rem;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--pure-white);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

body.loaded .loading-overlay {
    opacity: 0;
    visibility: hidden;
}