:root {
    --primary-blue: #007ee5;
    --primary-blue-light: #4da7ff;
    --primary-blue-dark: #0059a8;
    --accent-green: #00e676;
    --accent-yellow: #ffcc00;
    --accent-red: #ff3d71;
    --dark-bg: #0f1419;
    --dark-card: #1a2029;
    --light-text: #ffffff;
    --muted-text: rgba(255, 255, 255, 0.7);
}

/* =========================================
   Global Layout & Backgrounds
   ========================================= */

.auth-container-section {
    background: linear-gradient(135deg, #0c1117 0%, #0f151d 50%, #0a0f14 100%);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    padding: 2rem 1rem;
}

/* Animated Circuit Board Background */
.circuit-board-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        /* Horizontal lines */
        linear-gradient(to right, var(--primary-blue) 1px, transparent 1px),
        /* Vertical lines */
        linear-gradient(to bottom, var(--primary-blue) 1px, transparent 1px),
        /* Diagonal lines */
        linear-gradient(45deg, transparent 49.7%, rgba(0, 126, 229, 0.3) 49.7%, rgba(0, 126, 229, 0.3) 50.3%, transparent 50.3%),
        linear-gradient(-45deg, transparent 49.7%, rgba(0, 126, 229, 0.3) 49.7%, rgba(0, 126, 229, 0.3) 50.3%, transparent 50.3%);
    background-size: 40px 40px, 40px 40px, 80px 80px, 80px 80px;
    opacity: 0.15;
    z-index: 0;
    animation: circuitFloat 20s linear infinite;
}

/* Gaming Pixels Pattern */
.pixel-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(0, 126, 229, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(0, 126, 229, 0.08) 2px, transparent 2px),
        radial-gradient(circle at 50% 90%, rgba(0, 126, 229, 0.06) 2px, transparent 2px);
    background-size: 60px 60px, 90px 90px, 120px 120px;
    opacity: 0.4;
    z-index: 0;
}

/* Floating Gaming Elements */
.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.floating-element {
    position: absolute;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

/* Merged floating element positions from both files */
.floating-element:nth-child(1) {
    top: 15%;
    left: 10%;
    width: 40px;
    height: 40px;
    background: var(--primary-blue);
    border-radius: 10px;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    top: 65%;
    right: 15%;
    width: 60px;
    height: 60px;
    background: var(--accent-green);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation-delay: -2s;
}

.floating-element:nth-child(3) {
    top: 35%;
    right: 20%;
    width: 30px;
    height: 30px;
    background: var(--accent-yellow);
    border-radius: 50%;
    animation-delay: -4s;
}

.floating-element:nth-child(4) {
    bottom: 20%;
    left: 15%;
    width: 50px;
    height: 50px;
    background: var(--primary-blue);
    clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 75% 75%, 75% 100%, 50% 75%, 0% 75%);
    animation-delay: -1s;
}

/* =========================================
   Animations
   ========================================= */

@keyframes circuitFloat {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(40px) translateX(40px); }
}

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

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

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
   Auth Containers
   ========================================= */

.gaming-login-container,
.gaming-register-container {
    background: rgba(26, 32, 41, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(0, 126, 229, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    z-index: 1;
    margin: 0 auto;
}

.gaming-login-container {
    max-width: 500px;
}

.gaming-register-container {
    max-width: 1000px;
}

.gaming-login-container::before,
.gaming-register-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-green), var(--primary-blue-light));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
    z-index: 2;
}

/* =========================================
   Headers
   ========================================= */

.login-header,
.register-header {
    text-align: center;
    padding: 2rem 2rem 1.5rem;
    position: relative;
}

.login-header::after,
.register-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-blue), transparent);
}

.gamehub-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Login specific logo adjustment: flex-direction column was in original */
.login-header .gamehub-logo {
    flex-direction: column;
}

.gamehub-logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-light));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 25px rgba(0, 126, 229, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

/* Register specific logo icon size */
.register-header .gamehub-logo-icon {
    width: 48px;
    height: 48px;
}

.gamehub-logo-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 70%);
    animation: shine 3s infinite;
}

.gamehub-logo-text {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-green));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.register-header .gamehub-logo-text {
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.login-header h2,
.register-header h2 {
    font-size: 1.5rem;
    color: var(--light-text);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.register-header h2 {
    font-size: 1.6rem;
}

.login-header p,
.register-header p {
    color: var(--muted-text);
    font-size: 0.95rem;
    line-height: 1.4;
    max-width: 400px;
    margin: 0 auto;
}

.register-header p {
    max-width: 500px;
}

/* =========================================
   Content & Forms
   ========================================= */

.login-content,
.register-content {
    padding: 1.5rem 2rem 2rem;
}

.gaming-form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--light-text);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.gaming-form-label i {
    color: var(--primary-blue);
    font-size: 0.95rem;
    min-width: 18px;
}

.required-star {
    color: var(--accent-red);
    font-size: 0.85rem;
}

.gaming-input-container {
    position: relative;
}

.gaming-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.875rem 1rem 0.875rem 3rem;
    color: var(--light-text);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.gaming-input:focus {
    border-color: var(--primary-blue);
    box-shadow:
        0 0 0 3px rgba(0, 126, 229, 0.2),
        inset 0 0 10px rgba(0, 126, 229, 0.1);
    background: rgba(255, 255, 255, 0.07);
}

.gaming-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

/* Register specific: phone input padding */
.gaming-input-container .iti__selected-dial-code {
    color: rgba(255, 255, 255, 0.4);
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-blue);
    font-size: 1rem;
    transition: color 0.3s ease;
}

.gaming-input:focus + .input-icon {
    color: var(--accent-green);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.password-toggle:hover {
    color: var(--primary-blue);
    transform: translateY(-50%) scale(1.1);
}

/* Country Code (Register only) */
.country-code-container {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 75px;
    background: rgba(0, 126, 229, 0.1);
    border-right: 1px solid rgba(0, 126, 229, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    color: var(--primary-blue-light);
    font-weight: 600;
    font-size: 0.9rem;
}

.phone-input {
    padding-left: 90px !important;
}

/* =========================================
   Buttons
   ========================================= */

.gaming-btn {
    width: 100%;
    padding: 0.875rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.gaming-btn::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;
}

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

/* Primary Button Action Style (Login btn on login page, Register btn on register page) */
.btn-login:not([href]), /* Button element (usually submit) in login form */
.btn-register-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: var(--light-text);
    box-shadow: 0 4px 15px rgba(0, 126, 229, 0.3);
}

.btn-login:not([href]):hover,
.btn-register-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 126, 229, 0.4);
}

/* Secondary/Outline Button Style */
.btn-register,
.btn-login[href] { /* Specific selector for login link on register page */
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    color: var(--light-text);
}

.btn-register:hover,
.btn-login[href]:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-blue);
}

/* =========================================
   Dividers & Footers
   ========================================= */

.form-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: rgba(255, 255, 255, 0.4);
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 126, 229, 0.3), transparent);
}

.form-divider span {
    padding: 0 0.75rem;
    font-size: 0.85rem;
}

.login-footer,
.register-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.login-footer p,
.register-footer p {
    color: var(--muted-text);
    font-size: 0.8rem;
    line-height: 1.4;
}

.login-footer a,
.form-check-label a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.login-footer a:hover,
.form-check-label a:hover {
    color: var(--accent-green);
    text-decoration: underline;
}

/* =========================================
   Utilities & Misc
   ========================================= */

/* Forgot Password Link */
.forgot-password-link {
    color: var(--primary-blue-light);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.forgot-password-link:hover {
    color: var(--accent-green);
    text-decoration: underline;
}

/* Loading Spinner */
.btn-spinner {
    animation: spin 1s linear infinite;
}

/* Register Specific: Form Grid */
.register-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Register Specific: Password Strength */
.password-strength {
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
    position: relative;
}

.password-strength::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            var(--accent-red) 0%,
            var(--accent-red) 33%,
            var(--accent-yellow) 33%,
            var(--accent-yellow) 66%,
            var(--accent-green) 66%,
            var(--accent-green) 100%);
    opacity: 0.2;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.strength-weak { background: var(--accent-red); width: 33%; }
.strength-medium { background: var(--accent-yellow); width: 66%; }
.strength-strong { background: var(--accent-green); width: 100%; }

.strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: var(--muted-text);
}

/* Register Specific: Terms Checkbox */
.terms-checkbox-container {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(0, 126, 229, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(0, 126, 229, 0.1);
}

.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.125rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 126, 229, 0.2);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(0, 126, 229, 0.2);
}

.form-check-label {
    color: var(--muted-text);
    font-size: 0.85rem;
    line-height: 1.4;
    cursor: pointer;
}

/* =========================================
   Responsive Styles
   ========================================= */

@media (max-width: 992px) {
    .register-form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .auth-container-section {
        padding: 0rem;
    }

    .login-content,
    .register-content {
        padding: 1.25rem 1.5rem 1.5rem;
    }

    .login-header,
    .register-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .gamehub-logo-text {
        font-size: 1.8rem;
    }
    
    .register-header .gamehub-logo-text {
        font-size: 1.6rem;
    }

    .login-header h2 {
        font-size: 1.3rem;
    }
    
    .register-header h2 {
        font-size: 1.4rem;
    }

    .gamehub-logo-icon {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 576px) {
    /* Combined specific container styles for mobile */
    .gaming-login-container,
    .gaming-register-container {
        border-radius: 12px;
        margin: 0.5rem;
    }
    
    /* Login specific spacing override */
    .gaming-login-container {
        margin: 0.5rem;
    }

    .gamehub-logo {
        gap: 0.75rem;
    }
    
    .register-header .gamehub-logo {
        gap: 10px;
    }

    .gamehub-logo-text {
        font-size: 1.6rem;
    }
    
    .register-header .gamehub-logo-text {
        font-size: 1.4rem;
    }
    
    .register-header .gamehub-logo-icon {
        width: 40px;
        height: 40px;
    }

    .gaming-input {
        padding: 0.75rem 0.875rem 0.75rem 2.75rem;
        font-size: 0.9rem;
    }

    .input-icon {
        left: 0.875rem;
        font-size: 0.9rem;
    }

    .gaming-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Register specific */
    .country-code-container {
        width: 70px;
    }

    .phone-input {
        padding-left: 80px !important;
    }
}
