:root {
    /* High Contrast Palette */
    --primary: #d8b4fe;
    /* Lighter purple for better contrast on dark */
    --secondary: #f9a8d4;
    /* Lighter pink */
    --bg-dark: #020617;
    /* Very dark blue/black */
    --text-light: #f8fafc;
    --text-muted: #cbd5e1;
    --glass: rgba(15, 23, 42, 0.8);
    /* Darker glass for better text readability */
    --glass-border: rgba(255, 255, 255, 0.2);
    --focus-ring: #38bdf8;
    /* Bright Cyan for focus */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Accessible Focus States */
:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Space Background Animation */
.stars,
.twinkling {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    /* Prevent interference with clicks */
}

.stars {
    background: #000 url('http://www.script-tutorials.com/demos/360/images/stars.png') repeat top center;
    z-index: -2;
}

.twinkling {
    background: transparent url('http://www.script-tutorials.com/demos/360/images/twinkling.png') repeat top center;
    z-index: -1;
    animation: move-twink-back 200s linear infinite;
    opacity: 0.7;
    /* Reduce visual noise for accessibility */
}

@keyframes move-twink-back {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -10000px 5000px;
    }
}

.container {
    width: 90%;
    max-width: 600px;
    text-align: center;
    z-index: 1;
    padding: 1rem;
}

header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.25rem;
    /* ~36px */
    color: var(--primary);
    /* Solid color better for some readers than gradient text */
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.125rem;
    /* ~18px */
}

.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.input-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

input[type="text"] {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    border: 2px solid var(--glass-border);
    /* Thicker border */
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-family: inherit;
    font-size: 1.125rem;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus {
    border-color: var(--primary);
    outline: none;
    /* Handled by :focus-visible if keyboard */
}

.controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

select {
    flex: 1;
    min-width: 140px;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--glass-border);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
}

select option {
    background: #1e293b;
    padding: 10px;
}

.btn-primary {
    flex: 2;
    min-width: 120px;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: #3b0764;
    /* Dark text on light purple for contrast ratio > 4.5:1 */
    font-weight: 700;
    font-size: 1.125rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: #c084fc;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.3);
}

.btn-secondary {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: transparent;
    border: 2px solid var(--glass-border);
    color: var(--text-light);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-light);
}

/* Utilities */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Progress Page Specifics */
h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-light);
    line-height: 1.3;
}

.status-text {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.progress-container {
    width: 100%;
    height: 24px;
    /* Taller for visibility */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    border: 1px solid var(--glass-border);
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--primary);
    /* Solid high contrast color */
    transition: width 0.3s ease;
}

#visualProgressText {
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 1.5rem;
}

/* Footer */
footer {
    margin-top: 3rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.75rem;
    }

    .controls {
        flex-direction: column;
    }

    .btn-primary,
    select {
        width: 100%;
    }
}