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

:root {
    --color-bg: #f8fafc;
    --color-card: rgba(255, 255, 255, 0.65);
    --color-border: rgba(255, 255, 255, 0.5);
    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-muted: #94a3b8;
    --color-accent: #25D366;
    --color-accent-light: #4ade80;
    --color-accent-dark: #128C7E;
    --color-error: #ef4444;
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 40px rgba(37, 211, 102, 0.15);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ==========================================
   WHATSAPP WATERMARK BACKGROUND
   ========================================== */
.whatsapp-watermark {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.whatsapp-watermark svg {
    width: 120vw;
    height: 120vh;
    opacity: 0.04;
}

/* ==========================================
   AURORA BACKGROUND
   ========================================== */
.aurora-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #f0fdf4 50%, #f5f3ff 100%);
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: aurora-move 20s ease-in-out infinite;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.25) 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation-duration: 25s;
    animation-delay: 0s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 217, 255, 0.15) 0%, transparent 70%);
    top: 40%;
    right: -15%;
    animation-duration: 30s;
    animation-delay: -5s;
}

.blob-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
    bottom: -10%;
    left: 20%;
    animation-duration: 22s;
    animation-delay: -10s;
}

.blob-4 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.15) 0%, transparent 70%);
    top: 20%;
    left: 60%;
    animation-duration: 28s;
    animation-delay: -15s;
}

@keyframes aurora-move {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(60px, -40px) scale(1.1);
    }
    50% {
        transform: translate(-30px, 60px) scale(0.95);
    }
    75% {
        transform: translate(40px, 30px) scale(1.05);
    }
}

/* ==========================================
   FLOATING PARTICLES
   ========================================== */
.particles-container {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particles-container::before,
.particles-container::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(37, 211, 102, 0.3);
    border-radius: 50%;
    animation: particle-float 15s ease-in-out infinite;
}

.particles-container::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    width: 8px;
    height: 8px;
}

.particles-container::after {
    top: 60%;
    right: 15%;
    animation-delay: -7s;
    background: rgba(0, 217, 255, 0.25);
    width: 5px;
    height: 5px;
}

@keyframes particle-float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }
    33% {
        transform: translateY(-40px) translateX(20px);
        opacity: 0.6;
    }
    66% {
        transform: translateY(20px) translateX(-15px);
        opacity: 0.2;
    }
}

/* ==========================================
   MOUSE SPOTLIGHT
   ========================================== */
.spotlight {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(
        circle 500px at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(37, 211, 102, 0.06) 0%,
        transparent 70%
    );
    transition: background 0.3s ease;
}

/* ==========================================
   LOGIN CARD
   ========================================== */
.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card-outer {
    position: relative;
    padding: 2px;
    border-radius: var(--radius-lg);
    animation: fadeInUp 0.8s ease;
}

.login-card-border {
    position: absolute;
    inset: -1px;
    border-radius: calc(var(--radius-lg) + 1px);
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        rgba(37, 211, 102, 0.4) 20%,
        rgba(0, 217, 255, 0.3) 40%,
        rgba(124, 58, 237, 0.2) 60%,
        rgba(37, 211, 102, 0.4) 80%,
        transparent 100%
    );
    z-index: -1;
    opacity: 0.7;
}

.login-card-border::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: var(--radius-lg);
    background: var(--color-card);
    backdrop-filter: blur(20px);
    z-index: -1;
}

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

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
    background: var(--color-card);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}

.login-header {
    margin-bottom: 36px;
    position: relative;
}

.logo-ring {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-ring::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--color-accent-light),
        var(--color-accent-dark),
        var(--color-accent-light)
    );
    animation: pulse-ring-glow 3s ease-in-out infinite;
    opacity: 0.6;
    filter: blur(8px);
}

.logo-ring::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--color-accent-light),
        var(--color-accent-dark),
        var(--color-accent-light)
    );
    mask: radial-gradient(circle, transparent 68%, black 69%);
    -webkit-mask: radial-gradient(circle, transparent 68%, black 69%);
}

.logo-icon {
    position: relative;
    z-index: 2;
    width: 94px;
    height: 94px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 32px rgba(37, 211, 102, 0.35), 0 0 0 5px rgba(255, 255, 255, 0.4);
    animation: logo-breathe 3s ease-in-out infinite;
}

.logo-icon svg {
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

@keyframes pulse-ring-glow {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes logo-breathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(37, 211, 102, 0.3), 0 0 0 4px rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 12px 32px rgba(37, 211, 102, 0.4), 0 0 0 4px rgba(255, 255, 255, 0.3);
    }
}

.login-title h1 {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e293b 0%, #128C7E 50%, #25D366 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.login-title p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* ==========================================
   LOGIN ERROR
   ========================================== */
.login-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
    color: var(--color-error);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    animation: shake 0.5s ease;
    backdrop-filter: blur(8px);
}

.login-error svg {
    flex-shrink: 0;
}

/* ==========================================
   FORM
   ========================================== */
.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: all var(--transition-fast);
    z-index: 2;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: rgba(255, 255, 255, 0.5);
    border: 1.5px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    transition: all var(--transition-fast);
    position: relative;
    z-index: 1;
}

.input-wrapper input:focus {
    border-color: var(--color-accent);
    background: rgba(255, 255, 255, 0.8);
}

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

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

/* Glow effect behind input */
.input-glow {
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-sm) + 2px);
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
    opacity: 0;
    z-index: 0;
    filter: blur(8px);
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.input-wrapper input:focus ~ .input-glow {
    opacity: 0.25;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    border-radius: 6px;
    z-index: 2;
}

.toggle-password:hover {
    color: var(--color-text-secondary);
    background: rgba(0, 0, 0, 0.04);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

/* ==========================================
   LOGIN BUTTON
   ========================================== */
.login-button {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.25), 0 0 0 0 rgba(37, 211, 102, 0.3);
    letter-spacing: 0.02em;
}

.login-button::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.6s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35), 0 0 0 4px rgba(37, 211, 102, 0.1);
}

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

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

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.spinner-icon {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 480px) {
    .login-card {
        padding: 36px 24px;
        max-width: 100%;
    }

    .login-title h1 {
        font-size: 1.35rem;
    }

    .login-title p {
        font-size: 0.8rem;
    }

    .logo-ring {
        width: 90px;
        height: 90px;
    }

    .logo-icon {
        width: 76px;
        height: 76px;
    }

    .logo-icon svg {
        width: 42px;
        height: 42px;
    }

    .whatsapp-watermark svg {
        width: 150vw;
        height: 150vh;
    }
}
