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

html,
body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #1e293b 0%, #020617 45%, #000000 100%);
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: hidden;
}

/* Floating glow orbits */
.glow-orbit {
    position: fixed;
    border-radius: 9999px;
    filter: blur(60px);
    opacity: 0.6;
    z-index: 0;
    mix-blend-mode: screen;
    pointer-events: none;
}

.glow-orbit-one {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle at center, #38bdf8, transparent 60%);
    top: -80px;
    left: -40px;
    animation: float-one 14s ease-in-out infinite alternate;
}

.glow-orbit-two {
    width: 460px;
    height: 460px;
    background: radial-gradient(circle at center, #a855f7, transparent 60%);
    bottom: -120px;
    right: -20px;
    animation: float-two 18s ease-in-out infinite alternate;
}

@keyframes float-one {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(40px, 40px) scale(1.1);
    }
}

@keyframes float-two {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(-40px, -20px) scale(1.05);
    }
}

.app-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 960px;
}

.card {
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 65%),
                radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.18), transparent 65%),
                rgba(15, 23, 42, 0.96);
    border-radius: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow:
        0 0 30px rgba(15, 23, 42, 0.9),
        0 0 80px rgba(56, 189, 248, 0.65),
        0 0 120px rgba(168, 85, 247, 0.55);
    padding: 2.25rem 2.5rem 2rem;
    backdrop-filter: blur(22px);
}

.card-header {
    margin-bottom: 1.75rem;
}

.title {
    font-size: clamp(2.1rem, 3vw, 2.6rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    background: linear-gradient(to right, #e5e7eb, #38bdf8, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #cbd5f5;
    font-size: 0.95rem;
    line-height: 1.6;
}

.controls {
    display: grid;
    grid-template-columns: 2fr 2fr;
    gap: 1.75rem;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-label {
    font-size: 0.9rem;
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hint {
    font-size: 0.8rem;
    color: #9ca3af;
}

input[type="file"] {
    padding: 0.7rem 0.9rem;
    border-radius: 0.8rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
    font-size: 0.9rem;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.4rem 0.9rem;
    border-radius: 0.7rem;
    border: none;
    background: linear-gradient(to right, #38bdf8, #a855f7);
    color: #0f172a;
    font-weight: 600;
    cursor: pointer;
}

input[type="range"] {
    width: 100%;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(to right, #38bdf8, #a855f7);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #0f172a;
    border: 2px solid #e5e7eb;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #0f172a;
    border: 2px solid #e5e7eb;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
    cursor: pointer;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.8rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
}

.primary-button {
    position: relative;
    border: none;
    border-radius: 999px;
    padding: 0.9rem 1.6rem;
    font-size: 0.98rem;
    font-weight: 600;
    color: #0f172a;
    background: linear-gradient(135deg, #38bdf8, #a855f7);
    cursor: pointer;
    overflow: hidden;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-shadow:
        0 0 20px rgba(56, 189, 248, 0.8),
        0 0 30px rgba(168, 85, 247, 0.75);
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.primary-button .button-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 0, rgba(248, 250, 252, 0.7), transparent 55%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.primary-button span {
    position: relative;
    z-index: 1;
}

.primary-button:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow:
        0 0 26px rgba(56, 189, 248, 0.9),
        0 0 40px rgba(168, 85, 247, 0.9);
    filter: saturate(1.15);
}

.primary-button:hover .button-glow {
    opacity: 1;
}

.primary-button:active {
    transform: translateY(1px) scale(0.99);
}

.primary-button[disabled] {
    opacity: 0.6;
    cursor: wait;
    box-shadow: none;
}

.status-panel {
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.99));
    border-radius: 1.2rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 1.5rem 1.4rem 1.3rem;
    box-shadow: inset 0 0 18px rgba(15, 23, 42, 0.9);
}

.status-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.status-block {
    padding: 0.7rem 0.8rem;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 64, 175, 0.7));
    border: 1px solid rgba(148, 163, 184, 0.6);
    box-shadow: 0 0 18px rgba(15, 23, 42, 0.9);
}

.status-label {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
}

.status-value {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.98rem;
    font-weight: 600;
    color: #e5e7eb;
}

.status-message {
    font-size: 0.9rem;
    color: #c4d0ff;
    margin-bottom: 0.9rem;
    min-height: 1.4rem;
}

.progress-bar {
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(51, 65, 85, 0.9);
    overflow: hidden;
    margin-bottom: 0.9rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #22c55e, #38bdf8);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.8);
    transition: width 0.2s ease;
}

.download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.7);
    text-decoration: none;
    background: radial-gradient(circle at top, rgba(56, 189, 248, 0.2), transparent 60%);
    box-shadow: 0 0 18px rgba(15, 23, 42, 0.9);
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

.download-link:hover {
    background: radial-gradient(circle at top, rgba(56, 189, 248, 0.35), transparent 60%);
    border-color: rgba(248, 250, 252, 0.8);
    box-shadow:
        0 0 20px rgba(56, 189, 248, 0.8),
        0 0 26px rgba(15, 23, 42, 0.95);
    transform: translateY(-1px);
}

.card-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

.footer-note {
    max-width: 420px;
}

/* Responsive layout */
@media (max-width: 800px) {
    body {
        padding: 1rem;
        align-items: stretch;
    }

    .card {
        padding: 1.75rem 1.4rem 1.4rem;
    }

    .controls {
        grid-template-columns: 1fr;
    }

    .status-row {
        grid-template-columns: 1fr;
    }

    .card-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
