﻿/* =======================
   🌌 Base Styles
======================= */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #0a0e1a;
    /* ✅ Thêm -webkit- prefix cho Safari/iOS để tránh lỗi nền trắng */
    background: -webkit-linear-gradient(135deg, #0a0e1a 0%, #1a2332 30%, #0f1419 70%, #050a0f 100%);
    background: linear-gradient(135deg, #0a0e1a 0%, #1a2332 30%, #0f1419 70%, #050a0f 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: #ffffff;
    overflow-x: hidden;
}
    /* ✅ Tách lớp sao riêng - không dùng blur để Safari không lỗi, thêm prefix và chỉnh stars trắng */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: -webkit-radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.8), transparent), -webkit-radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.6), transparent), -webkit-radial-gradient(1px 1px at 90px 40px, #fff, transparent), -webkit-radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.4), transparent);
        background-image: radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.8), transparent), radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.6), transparent), radial-gradient(1px 1px at 90px 40px, #fff, transparent), radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.4), transparent);
        background-repeat: repeat;
        background-size: 400px 300px;
        animation: moveStars 25s linear infinite;
        z-index: -1;
        will-change: transform;
    }

@keyframes moveStars {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-300px);
    }
}
/* =======================
   💎 Glass Effects
======================= */
.glass-card,
.form-glass-card {
    -webkit-backdrop-filter: blur(20px); /* ✅ Safari fix */
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
/* Header logo block */
.glass-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(63, 114, 255, 0.3);
}
/* Form */
.form-glass-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(63, 114, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
}
/* ✅ Fallback cho iOS cũ không hỗ trợ backdrop-filter */
@supports not ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))) {
    .glass-card, .form-glass-card {
        background: rgba(15, 20, 25, 0.9);
    }
}
/* =======================
   ✨ Logo
======================= */
.logo-text {
    background: linear-gradient(135deg, #0648FF 0%, #4a90e2 50%, #74b9ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-shadow: 0 0 30px rgba(6,72,255,0.6);
}

.logo-container {
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%,100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}
/* =======================
   🧾 Form Controls
======================= */
.form-floating > .form-control {
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(6,72,255,0.25);
    border-radius: 15px;
    color: #fff;
    height: 58px;
    transition: all 0.3s ease;
}

    .form-floating > .form-control:focus {
        background: rgba(255,255,255,0.12);
        border-color: #0648FF;
        box-shadow: 0 0 20px rgba(6,72,255,0.3);
    }

.form-floating > label {
    color: rgba(255,255,255,0.8);
    font-weight: 500;
}
/* 🌟 Twinkling Stars (White Edition) - Fix cho iOS: Dùng pseudo-element dot trắng thay emoji để tránh distort */
.twinkle {
    position: absolute;
    width: 1.5rem;
    height: 1.5rem;
    pointer-events: none;
    opacity: 0;
    animation: twinkle 2s ease-in-out infinite alternate;
}

    .twinkle::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 8px;
        height: 8px;
        background: #ffffff;
        border-radius: 50%;
        transform: translate(-50%, -50%);
        box-shadow: 0 0 4px rgba(255, 255, 255, 0.9), 0 0 10px rgba(255, 255, 255, 0.6);
    }

@keyframes twinkle {
    0% {
        opacity: 0.3;
        transform: scale(0.6) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: scale(1) rotate(10deg);
    }

    100% {
        opacity: 0.4;
        transform: scale(0.7) rotate(-10deg);
    }
}
/* =======================
   🌌 Floating Particles
======================= */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle,#0648FF,#4a90e2);
    border-radius: 50%;
    animation: float-particle 8s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(6,72,255,0.6);
    will-change: transform, opacity;
}

@keyframes float-particle {
    0%,100% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }

    50% {
        transform: translateY(-20px) translateX(10px);
        opacity: 1;
    }
}
/* =======================
   🔘 Buttons
======================= */
.btn-gradient {
    background: linear-gradient(135deg, #0648FF 0%, #4a90e2 50%, #0648FF 100%);
    border: none;
    border-radius: 15px;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: #ffffff;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(6,72,255,0.25);
}

    .btn-gradient:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 25px rgba(6,72,255,0.4);
        background: linear-gradient(135deg, #4a90e2 0%, #0648FF 50%, #4a90e2 100%);
    }
/* Loading state */
.btn-loading.loading {
    pointer-events: none;
}

    .btn-loading.loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 20px;
        height: 20px;
        border: 2px solid rgba(255,255,255,0.3);
        border-top: 2px solid white;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    .btn-loading.loading .btn-text {
        opacity: 0;
    }

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
/* =======================
   🔗 Links & Social
======================= */
.modern-link {
    color: #74b9ff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .modern-link:hover {
        color: #ffffff;
        text-shadow: 0 0 10px rgba(116,185,255,0.5);
    }

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

    .password-toggle:hover {
        color: #74b9ff;
        transform: translateY(-50%) scale(1.1);
    }

.btn-social {
    background: rgba(255,255,255,0.9);
    border: 2px solid rgba(6,72,255,0.2);
    border-radius: 15px;
    padding: 0.8rem 1.5rem;
    color: #333;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

    .btn-social:hover {
        background: rgba(255,255,255,1);
        border-color: #0648FF;
        color: #0648FF;
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(6,72,255,0.2);
    }
/* =======================
   ⚠️ Alert
======================= */
.alert-modern {
    background: rgba(116,185,255,0.1);
    border: 1px solid rgba(116,185,255,0.3);
    border-radius: 15px;
    color: #74b9ff;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 1rem 1.25rem;
    font-weight: 500;
}
/* =======================
   🔠 Fonts
======================= */
@font-face {
    font-family: 'Mokoto';
    src: url('/fonts/MokotoDemo.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

html, body, * {
    font-family: 'Audiowide', sans-serif;
}
/* =======================
   📱 Responsive Mobile
======================= */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .main-container {
        padding: 20px 10px;
    }

    .logo-text {
        font-size: 2rem !important;
        text-align: center;
    }

    .glass-card {
        padding: 2rem 1.5rem;
        text-align: center;
    }

    .form-glass-card {
        padding: 2rem 1.5rem;
    }

    .btn-gradient {
        width: 100%;
        font-size: 1rem;
        padding: 0.8rem 1rem;
    }

    .btn-social {
        width: 100%;
        justify-content: center;
        font-size: 0.95rem;
    }

    .form-floating > .form-control {
        height: 50px;
        font-size: 0.95rem;
    }

    .twinkle {
        width: 1rem;
        height: 1rem;
    }

        .twinkle::before {
            width: 6px;
            height: 6px;
        }

    .particle {
        width: 4px;
        height: 4px;
    }
}
