/* Base styles & Dark Mode */
:root {
    --bg-base: #090a0f;
    --accent: #00ffcc;
    --accent-glow: rgba(0, 255, 204, 0.4);
    --text-main: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

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

/* Animated background elements */
.ambient-light {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    animation: float 10s infinite alternate ease-in-out;
}
.light-1 {
    width: 400px; height: 400px;
    background: rgba(0, 255, 204, 0.15);
    top: -100px; left: -100px;
}
.light-2 {
    width: 500px; height: 500px;
    background: rgba(59, 130, 246, 0.15);
    bottom: -150px; right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Glassmorphism Container */
.container {
    position: relative;
    z-index: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Typography */
h1 { font-size: 2rem; font-weight: 300; margin-bottom: 0.5rem; letter-spacing: 1px; }
h1 span { color: var(--accent); font-weight: 600; }
p.subtitle { color: #94a3b8; margin-bottom: 2rem; font-size: 0.95rem; line-height: 1.5; }

/* Form Elements */
.form-group { margin-bottom: 1.5rem; position: relative; }

input[type="email"], input[type="text"], textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px 16px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

textarea { resize: vertical; min-height: 100px; }

input:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Wave Sync Puzzle Styles */
.wave-container {
    position: relative;
    width: 100%;
    height: 80px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}
canvas#waveCanvas { width: 100%; height: 100%; display: block; }

.slider-container { margin-bottom: 1.5rem; display: flex; gap: 15px; align-items: center; }

input[type="range"] {
    flex-grow: 1; -webkit-appearance: none; background: rgba(255,255,255,0.1); height: 4px; border-radius: 2px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); cursor: pointer; box-shadow: 0 0 10px var(--accent-glow); transition: 0.2s;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.2); }

.sync-status {
    font-family: monospace; font-size: 0.85rem; color: rgba(255, 64, 64, 0.8); text-transform: uppercase; letter-spacing: 1px; width: 90px; text-align: right; transition: color 0.3s, text-shadow 0.3s;
}
.sync-status.synced { color: #00ffcc; text-shadow: 0 0 8px var(--accent-glow); }

/* Beautiful Animated Toggle Switch */
.switch-container {
    display: flex;
    align-items: center;
    justify-content: center; /* Center toggle horizontally */
    gap: 12px;
    margin-bottom: 1.5rem;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Hide the default browser checkbox completely */
.switch-container input[type="checkbox"] {
    display: none !important;
}

/* Switch track background */
.switch-track {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    transition: background-color 0.4s ease, border-color 0.4s ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

/* Switch thumb */
.switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: #94a3b8;
    border-radius: 50%;
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1), background-color 0.4s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Checked state */
.switch-container input[type="checkbox"]:checked ~ .switch-track {
    background-color: rgba(0, 255, 204, 0.1);
    border-color: var(--accent);
}

.switch-container input[type="checkbox"]:checked ~ .switch-track .switch-thumb {
    transform: translateX(24px);
    background-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* Label text */
.switch-label {
    font-size: 0.95rem;
    color: #94a3b8;
    transition: color 0.4s ease, text-shadow 0.4s ease;
}

.switch-container input[type="checkbox"]:checked ~ .switch-label {
    color: var(--text-main);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

/* Buttons */
button {
    width: 100%; background: transparent; color: var(--accent); border: 1px solid var(--accent); border-radius: 8px; padding: 14px; font-size: 1rem; font-weight: 600; cursor: pointer; text-transform: uppercase; letter-spacing: 2px; transition: all 0.3s ease; position: relative; overflow: hidden;
}
button:hover:not(:disabled) { background: var(--accent); color: var(--bg-base); box-shadow: 0 0 20px var(--accent-glow); }
button:disabled { border-color: rgba(255,255,255,0.1); color: rgba(255,255,255,0.2); cursor: not-allowed; }
button:disabled:hover { background: transparent; box-shadow: none; }

/* Notification Toast */
#notification { display: none; margin-top: 1rem; padding: 12px; border-radius: 8px; text-align: center; font-size: 0.9rem; animation: fadeIn 0.3s ease; }
.success { background: rgba(0, 255, 128, 0.1); color: #00ff80; border: 1px solid rgba(0, 255, 128, 0.2); }
.error { background: rgba(255, 64, 64, 0.1); color: #ff4040; border: 1px solid rgba(255, 64, 64, 0.2); }