:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --primary-neon: #00f3ff;
    --secondary-neon: #bc13fe;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Exo 2', sans-serif;
}

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

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Background Effects */
#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
}

.mouse-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(0, 243, 255, 0.15),
            transparent 40%);
    transition: opacity 0.3s;
}

.background-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 243, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
    transform: perspective(500px) rotateX(60deg) translateY(-100px) scale(2);
    animation: gridMove 20s linear infinite;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

@keyframes gridMove {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0) scale(2);
    }

    100% {
        transform: perspective(500px) rotateX(60deg) translateY(50px) scale(2);
    }
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.4;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: var(--primary-neon);
    top: -50px;
    left: -50px;
    animation: float 10s ease-in-out infinite;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary-neon);
    bottom: -100px;
    right: -100px;
    animation: float 12s ease-in-out infinite reverse;
}

@keyframes float {

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

    50% {
        transform: translate(30px, 50px);
    }
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
    width: 100%;
}

@media (min-width: 900px) {
    .hero {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .hero-content {
        flex: 1;
        text-align: left;
    }

    .form-container {
        flex: 0 0 400px;
    }
}

/* Typography & Content */
.hero-content {
    text-align: center;
    z-index: 1;
}

.icon-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    animation: floatIcon 6s ease-in-out infinite;
}

.floating-icon {
    width: 150px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(0, 243, 255, 0.4));
    mix-blend-mode: screen;
    /* Fade out edges to hide the square frame */
    mask-image: radial-gradient(circle at center, black 50%, transparent 95%);
    -webkit-mask-image: radial-gradient(circle at center, black 50%, transparent 95%);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.floating-icon:hover {
    transform: rotateY(360deg) scale(1.1);
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    position: relative;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        text-shadow:
            0 0 10px rgba(0, 243, 255, 0.5),
            0 0 20px rgba(0, 243, 255, 0.3),
            0 0 30px rgba(0, 243, 255, 0.2);
    }

    50% {
        text-shadow:
            0 0 20px rgba(0, 243, 255, 0.8),
            0 0 30px rgba(0, 243, 255, 0.6),
            0 0 40px rgba(0, 243, 255, 0.4),
            0 0 50px rgba(0, 243, 255, 0.2);
    }
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

@media (min-width: 900px) {
    .subtitle {
        margin: 0;
    }
}

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 var(--secondary-neon);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 var(--primary-neon);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(10px, 9999px, 30px, 0);
    }

    20% {
        clip: rect(80px, 9999px, 100px, 0);
    }

    40% {
        clip: rect(10px, 9999px, 50px, 0);
    }

    60% {
        clip: rect(60px, 9999px, 80px, 0);
    }

    80% {
        clip: rect(120px, 9999px, 140px, 0);
    }

    100% {
        clip: rect(30px, 9999px, 60px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(120px, 9999px, 140px, 0);
    }

    20% {
        clip: rect(10px, 9999px, 30px, 0);
    }

    40% {
        clip: rect(50px, 9999px, 90px, 0);
    }

    60% {
        clip: rect(90px, 9999px, 110px, 0);
    }

    80% {
        clip: rect(20px, 9999px, 40px, 0);
    }

    100% {
        clip: rect(100px, 9999px, 120px, 0);
    }
}

/* Form Styling */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-neon), transparent);
    animation: scanline 3s linear infinite;
}

@keyframes scanline {
    0% {
        transform: translateX(-100%);
    }

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

.form-header {
    margin-bottom: 2rem;
    text-align: center;
}

.form-header h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary-neon);
}

.form-header p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.input-group {
    position: relative;
    margin-bottom: 2rem;
}

.input-group input {
    width: 100%;
    padding: 10px 0;
    font-size: 1rem;
    color: #fff;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    outline: none;
    transition: 0.3s;
    font-family: var(--font-body);
}

.input-group label {
    position: absolute;
    top: 10px;
    left: 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    transition: 0.3s;
}

.input-group input:focus~label,
.input-group input:not(:placeholder-shown)~label {
    top: -20px;
    font-size: 0.8rem;
    color: var(--primary-neon);
}

.input-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-neon);
    transition: 0.3s;
}

.input-group input:focus~.input-line {
    width: 100%;
}

/* Cyber Button */
.cyber-button {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 1px solid var(--primary-neon);
    color: var(--primary-neon);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cyber-button:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
    text-shadow: 0 0 8px var(--primary-neon);
}

.cyber-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.4), transparent);
    transition: 0.5s;
}

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

/* Responsive Adjustments */
@media (max-width: 900px) {
    body {
        padding: 0;
        display: block;
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
        /* Allow natural scrolling */
        overflow-x: hidden;
        position: relative;
    }

    .container {
        display: block;
        /* Fix: Flexbox centering breaks scrolling on mobile */
        padding: 1rem;
        padding-bottom: 150px;
        /* Generous bottom space */
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .hero {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
        padding-top: 2rem;
        text-align: center;
        width: 100%;
        overflow-x: hidden;
    }

    .hero-content {
        text-align: center;
        margin-bottom: 1rem;
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0;
    }

    .form-container {
        width: 100%;
        max-width: 450px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.8rem;
        /* Smaller for mobile */
        line-height: 1.3;
        padding: 0 0.5rem;
        word-wrap: break-word;
    }

    .subtitle {
        font-size: 1rem;
        padding: 0 1rem;
        max-width: 100%;
    }

    .container {
        padding: 0.5rem;
        width: 100%;
    }

    .glass-panel {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }

    .form-header h2 {
        font-size: 1.5rem;
    }

    .icon-container {
        margin-bottom: 1.5rem;
    }

    .floating-icon {
        width: 120px;
    }

    /* Disable glitch effect on mobile to prevent text overlap */
    .glitch::before,
    .glitch::after {
        display: none;
    }

    /* Performance Optimizations for Mobile */
    .mouse-glow {
        display: none;
        /* Disable mouse glow on mobile */
    }

    .glass-panel {
        backdrop-filter: none;
        /* Heavy on mobile GPU */
        -webkit-backdrop-filter: none;
        background: rgba(5, 5, 5, 0.85);
        /* Solid fallback */
    }

    .modal-overlay,
    .modal-content {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .modal-content {
        background: rgba(5, 5, 5, 0.95);
    }
}

/* Success Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid var(--primary-neon);
    border-radius: 20px;
    padding: 3rem 4rem;
    text-align: center;
    box-shadow:
        0 0 40px rgba(0, 243, 255, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.2), transparent);
    animation: modalScan 2s ease-in-out infinite;
}

@keyframes modalScan {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--primary-neon);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--bg-color);
    font-weight: bold;
    box-shadow:
        0 0 30px rgba(0, 243, 255, 0.6),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
    animation: successPulse 1.5s ease-in-out infinite;
}

@keyframes successPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 0 30px rgba(0, 243, 255, 0.6),
            inset 0 0 20px rgba(0, 0, 0, 0.3);
    }

    50% {
        transform: scale(1.1);
        box-shadow:
            0 0 50px rgba(0, 243, 255, 0.8),
            inset 0 0 20px rgba(0, 0, 0, 0.3);
    }
}

.success-message {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-neon);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0;
    text-shadow:
        0 0 20px rgba(0, 243, 255, 0.8),
        0 0 40px rgba(0, 243, 255, 0.4);
    animation: textGlow 1.5s ease-in-out infinite;
}

@keyframes textGlow {

    0%,
    100% {
        text-shadow:
            0 0 20px rgba(0, 243, 255, 0.8),
            0 0 40px rgba(0, 243, 255, 0.4);
    }

    50% {
        text-shadow:
            0 0 30px rgba(0, 243, 255, 1),
            0 0 60px rgba(0, 243, 255, 0.6),
            0 0 80px rgba(0, 243, 255, 0.3);
    }
}

/* Mobile adjustments for modal */
@media (max-width: 600px) {
    .modal-content {
        padding: 2rem 2.5rem;
        margin: 0 1rem;
    }

    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .success-message {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }
}