:root {
    --primary: #00f2fe; /* Neon Cyan */
    --primary-light: #4facfe;
    --primary-dark: #006b7d;
    --secondary: #94a3b8;
    --accent: #ff0844; /* Neon Crimson/Fuchsia */
    --bg-base: #0f172a; /* Deep Slate Base */
    --card-bg: rgba(30, 41, 59, 0.4); /* Glassmorphism Card */
    --card-border: rgba(255, 255, 255, 0.08);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --glass-blur: blur(16px);
    --shadow-glow: 0 0 20px rgba(79, 172, 254, 0.2);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
}

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

/* Base Body with Deep Rich Gradients */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-base);
    color: var(--text);
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(79, 172, 254, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 8, 68, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 1) 0%, rgba(2, 6, 23, 1) 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

header {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--card-border);
    padding: 1.25rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Glassmorphic Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    border-color: rgba(79, 172, 254, 0.4);
    box-shadow: var(--shadow-glow), var(--shadow-md);
    transform: translateY(-2px);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
    margin-bottom: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 { 
    font-size: 2.25rem; 
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Gradient Glowing Buttons */
button {
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #020617; /* High contrast text on Cyan */
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 242, 254, 0.4);
}

button:active {
    transform: translateY(0) scale(0.98);
}

button.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text);
    box-shadow: none;
}

button.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255,255,255,0.3);
}

button.danger {
    background: linear-gradient(135deg, var(--accent), #ff4b2b);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 8, 68, 0.3);
}

button.danger:hover {
    box-shadow: 0 8px 25px rgba(255, 8, 68, 0.5);
}

/* CPT Card Aesthetics */
.cpt-card {
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: rgba(30, 41, 59, 0.3);
}

.cpt-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(79, 172, 254, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cpt-card:hover::before {
    opacity: 1;
}

.cpt-code {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.15em;
    padding: 0.35rem 1rem;
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.3);
    border-radius: 99px;
    margin-bottom: 1rem;
}

.recording-area {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--card-border);
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.5);
    margin-top: 0.75rem;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.recording-controls {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1.25rem;
}

/* Sleek Forms */
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], select, textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    color: var(--text);
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, input[type="date"]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.2);
}

/* Make date picker icon visible on dark background */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Custom Checkboxes and Radios */
input[type="radio"], input[type="checkbox"] {
    width: 1.5rem;
    height: 1.5rem;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group > label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.radio-label, .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text);
    padding: 0.875rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.radio-label:hover, .checkbox-label:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.radio-label input:checked ~ *, 
.checkbox-label input:checked ~ *,
.radio-label:has(input:checked),
.checkbox-label:has(input:checked) {
    background: rgba(0, 242, 254, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

.onboard-step h3 {
    margin-top: 0;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
    color: var(--primary-light);
    font-size: 1.5rem;
}

#waveform {
    width: 100%;
    height: 120px;
    background: transparent;
    border-radius: 12px;
    margin: 1rem 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#taskStimulus {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    line-height: 1.1;
    color: white;
    text-shadow: 0 4px 20px rgba(255,255,255,0.4);
    font-weight: 800;
    padding: 2.5rem;
}

#stimulusContainer {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(0, 242, 254, 0.3);
    box-shadow: inset 0 0 20px rgba(0, 242, 254, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.visualizer-bar {
    width: 4px;
    margin: 0 2px;
    background: linear-gradient(to top, var(--primary), var(--primary-light));
    border-radius: 2px;
    transition: height 0.05s ease;
    box-shadow: 0 0 8px var(--primary);
}

/* Timer Animation state class */
.pulse-warning {
    animation: pulseRed 1s infinite alternate;
}

@keyframes pulseRed {
    0% { color: var(--accent); text-shadow: 0 0 10px rgba(255, 8, 68, 0.4); transform: scale(1); }
    100% { color: #ff4b2b; text-shadow: 0 0 25px rgba(255, 8, 68, 0.8); transform: scale(1.05); }
}

.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--card);
    padding: 3rem;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--card-border);
}

.metric-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
}

.patient-badge {
    background: #eff6ff;
    color: var(--primary-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid #bfdbfe;
}

.workflow-step {
    padding: 1rem;
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    transition: all 0.2s;
    font-weight: 600;
    border: 1px solid transparent;
}

.workflow-step:hover {
    background: #f1f5f9;
    color: var(--text);
}

.workflow-step.active {
    background: #eff6ff;
    color: var(--primary-dark);
    border: 1px solid #bfdbfe;
    border-left: 4px solid var(--primary);
}

.workflow-sidebar {
    width: 220px;
    border-right: 1px solid #e2e8f0;
    padding-right: 1.5rem;
    max-height: 450px;
    overflow-y: auto;
}

.workflow-sidebar::-webkit-scrollbar {
    width: 6px;
}

.workflow-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.step-view {
    animation: slideIn 0.3s ease-out;
}

.automated-next-timer {
    font-size: 0.85rem;
    color: var(--primary);
    margin-top: 1rem;
    font-weight: 700;
    background: #eff6ff;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    display: inline-block;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}
