/**
 * GymControl Pro — Custom Login Page
 * Glassmorphism + Particles + Animations
 */

/* ===========================
   BASE RESET
   =========================== */
html, body {
    margin: 0 !important;
    padding: 0 !important;
}

body.login {
    background: #0A0E1A !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ===========================
   PARTICLES CANVAS
   =========================== */
.gcpt-particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===========================
   GLOWING ORBS (Background)
   =========================== */
.gcpt-login-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
}

.gcpt-login-glow-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.5), transparent 70%);
    top: -100px;
    left: -100px;
    animation: gcptGlowFloat1 8s ease-in-out infinite;
}

.gcpt-login-glow-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 70%);
    bottom: -80px;
    right: -80px;
    animation: gcptGlowFloat2 10s ease-in-out infinite;
}

.gcpt-login-glow-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.3), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: gcptGlowFloat3 12s ease-in-out infinite;
}

@keyframes gcptGlowFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(80px, 60px) scale(1.1); }
    66% { transform: translate(-40px, 30px) scale(0.9); }
}

@keyframes gcptGlowFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-60px, -40px) scale(1.15); }
    66% { transform: translate(30px, -60px) scale(0.85); }
}

@keyframes gcptGlowFloat3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.15; }
}

/* ===========================
   BRAND SECTION (above form)
   =========================== */
.gcpt-login-brand {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 8px;
    animation: gcptBrandEnter 0.8s ease forwards;
    opacity: 0;
    transform: translateY(-20px);
}

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

.gcpt-login-brand-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3B82F6;
    animation: gcptIconPulse 3s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

@keyframes gcptIconPulse {
    0%, 100% { 
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
        border-color: rgba(59, 130, 246, 0.3);
    }
    50% { 
        box-shadow: 0 0 50px rgba(59, 130, 246, 0.4), 0 0 80px rgba(139, 92, 246, 0.2);
        border-color: rgba(139, 92, 246, 0.5);
    }
}

.gcpt-login-brand-name {
    font-size: 28px;
    font-weight: 800;
    color: #F9FAFB;
    margin: 0 0 6px;
    letter-spacing: -0.5px;
}

.gcpt-login-brand-name span {
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gcpt-login-brand-tagline {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
    font-weight: 400;
}

/* ===========================
   HIDE DEFAULT WORDPRESS LOGO
   =========================== */
#login h1,
#login h1 a {
    display: none !important;
}

/* ===========================
   LOGIN FORM CARD
   =========================== */
#login {
    position: relative;
    z-index: 2;
    width: 100% !important;
    max-width: 420px !important;
    padding: 0 20px !important;
    margin: 0 !important;
}

#loginform {
    margin-top: 15px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    padding: 32px !important;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset !important;
    animation: gcptFormEnter 0.6s ease 0.3s forwards;
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    position: relative;
    overflow: hidden;
}

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

/* Animated border glow */
#loginform::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        #3B82F6, #8B5CF6, #06B6D4, #3B82F6, #8B5CF6);
    background-size: 400% 400%;
    border-radius: 17px;
    z-index: -1;
    opacity: 0;
    animation: gcptBorderGlow 4s ease infinite;
    transition: opacity 0.5s ease;
}

#loginform:hover::before,
#loginform:focus-within::before {
    opacity: 0.6;
}

@keyframes gcptBorderGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Inner background to cover the gradient */
#loginform::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.95);
    border-radius: 16px;
    z-index: -1;
}

/* ===========================
   FORM LABELS
   =========================== */
#loginform label {
    color: #9CA3AF !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    font-family: 'Inter', sans-serif !important;
    display: block !important;
    margin-bottom: 6px !important;
}

/* ===========================
   FORM INPUTS
   =========================== */
#loginform input[type="text"],
#loginform input[type="password"] {
    width: 100% !important;
    padding: 12px 16px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    color: #F9FAFB !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 15px !important;
    transition: all 0.3s ease !important;
    outline: none !important;
    box-shadow: none !important;
    margin-bottom: 4px !important;
    box-sizing: border-box !important;
}

#loginform input[type="text"]:focus,
#loginform input[type="password"]:focus {
    border-color: #3B82F6 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 
        0 0 0 3px rgba(59, 130, 246, 0.15),
        0 0 20px rgba(59, 130, 246, 0.1) !important;
}

#loginform input[type="text"]::placeholder,
#loginform input[type="password"]::placeholder {
    color: #4B5563 !important;
}

/* Input wrapper animation */
#loginform .input,
#loginform p {
    animation: gcptInputSlide 0.5s ease forwards;
    opacity: 0;
    transform: translateX(-10px);
}

#loginform p:nth-child(1) { animation-delay: 0.4s; }
#loginform p:nth-child(2) { animation-delay: 0.5s; }
#loginform p:nth-child(3) { animation-delay: 0.6s; }
#loginform p:nth-child(4) { animation-delay: 0.7s; }

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

/* ===========================
   REMEMBER ME CHECKBOX
   =========================== */
#loginform .forgetmenot {
    margin-top: 8px !important;
}

#loginform .forgetmenot label {
    color: #6B7280 !important;
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer !important;
}

#loginform input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
    position: relative !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0;
}

#loginform input[type="checkbox"]:checked {
    background: #3B82F6 !important;
    border-color: #3B82F6 !important;
}

#loginform input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

/* ===========================
   SUBMIT BUTTON
   =========================== */
#loginform .submit {
    margin-top: 8px !important;
}

#wp-submit {
    width: 100% !important;
    padding: 14px 24px !important;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6) !important;
    border: none !important;
    border-radius: 10px !important;
    color: white !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3) !important;
    text-shadow: none !important;
    position: relative;
    overflow: hidden;
}

#wp-submit:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5) !important;
}

#wp-submit:active {
    transform: translateY(0) !important;
}

/* Shimmer effect on button */
#wp-submit::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    animation: gcptShimmer 3s ease infinite;
}

@keyframes gcptShimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* ===========================
   NAVIGATION LINKS
   =========================== */
#nav, #backtoblog {
    text-align: center !important;
    padding: 0 !important;
    margin: 12px 0 0 !important;
}

#nav a, #backtoblog a {
    color: #6B7280 !important;
    font-size: 13px !important;
    font-family: 'Inter', sans-serif !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
}

#nav a:hover, #backtoblog a:hover {
    color: #3B82F6 !important;
}

/* Hide back to blog on login */
#backtoblog {
    display: none !important;
}

/* ===========================
   ERROR / SUCCESS MESSAGES
   =========================== */
#login_error,
.message,
.success {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    border-left: 4px solid #EF4444 !important;
    border-radius: 10px !important;
    color: #F9FAFB !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 13px !important;
    padding: 14px 18px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.1) !important;
    animation: gcptShake 0.4s ease;
}

.message, .success {
    border-color: rgba(16, 185, 129, 0.3) !important;
    border-left-color: #10B981 !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1) !important;
    animation: gcptFormEnter 0.4s ease forwards !important;
}

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

/* ===========================
   CUSTOM FOOTER
   =========================== */
.gcpt-login-footer-custom {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 2;
    animation: gcptFadeIn 1s ease 1s forwards;
    opacity: 0;
}

.gcpt-login-footer-custom p {
    color: #4B5563;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
}

.gcpt-login-footer-custom a {
    color: #6B7280;
    text-decoration: none;
    transition: color 0.3s ease;
}

.gcpt-login-footer-custom a:hover {
    color: #3B82F6;
}

@keyframes gcptFadeIn {
    to { opacity: 1; }
}

/* ===========================
   PRIVACY POLICY (WP 5.2+)
   =========================== */
.privacy-policy-page-link {
    text-align: center !important;
    margin-top: 12px !important;
}

.privacy-policy-page-link a {
    color: #4B5563 !important;
    font-size: 12px !important;
}

/* ===========================
   LANGUAGE SWITCHER (WP 5.9+)
   =========================== */
.language-switcher {
    display: none !important;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 480px) {
    #login {
        padding: 0 16px !important;
    }

    #loginform {
        padding: 24px 20px !important;
    }

    .gcpt-login-brand-name {
        font-size: 22px;
    }

    .gcpt-login-brand-icon {
        width: 64px;
        height: 64px;
    }

    .gcpt-login-brand-icon svg {
        width: 36px;
        height: 36px;
    }
}
