:root {
    --bg: #090b10;
    --panel: #11151d;
    --panel-2: #171c26;
    --text: #f4f7fb;
    --muted: #929baa;
    --line: #272e3a;
    --accent: #8b5cf6;
    --accent-2: #6d28d9;
    --danger: #ef4444;
    --success: #22c55e;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 50% 0%, rgba(139,92,246,.18), transparent 34rem),
        var(--bg);
}

button, input, select { font: inherit; }

.page {
    width: min(100% - 32px, 980px);
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hero {
    flex: 1;
    padding: 42px 0 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo {
    width: fit-content;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 70px;
}

.logo span { color: #a78bfa; }

.hero-copy {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 34px;
}

.badge {
    display: inline-flex;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255,255,255,.03);
    color: #c8ced9;
    font-size: 13px;
    margin-bottom: 18px;
}

h1 {
    font-size: clamp(38px, 7vw, 68px);
    line-height: .98;
    letter-spacing: -3px;
    margin: 0;
}

h1 span { color: #a78bfa; }

.hero-copy > p {
    color: var(--muted);
    font-size: 17px;
    margin: 18px 0 0;
}

.converter-card,
.result-card {
    width: min(100%, 760px);
    margin: 0 auto;
    background: rgba(17,21,29,.88);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 14px;
    box-shadow: 0 25px 80px rgba(0,0,0,.25);
}

.input-row {
    display: flex;
    gap: 10px;
}

input[type="url"], select {
    color: var(--text);
    background: var(--panel-2);
    border: 1px solid var(--line);
    outline: none;
    border-radius: 14px;
}

input[type="url"] {
    flex: 1;
    min-width: 0;
    height: 58px;
    padding: 0 18px;
}

input[type="url"]:focus, select:focus {
    border-color: #7050c8;
    box-shadow: 0 0 0 3px rgba(139,92,246,.12);
}

button {
    border: 0;
    cursor: pointer;
    color: white;
    font-weight: 800;
}

.input-row button {
    min-width: 135px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

button:disabled { opacity: .6; cursor: wait; }

.hint {
    color: #697282;
    font-size: 12px;
    margin: 10px 5px 2px;
}

.message {
    min-height: 0;
    font-size: 13px;
    padding: 0 5px;
}

.message:not(:empty) { margin-top: 10px; }
.message.error { color: #fca5a5; }
.message.success { color: #86efac; }

.result-card { margin-top: 18px; padding: 20px; }

.video-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.video-info img {
    width: 150px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    background: #202632;
}

.video-info h2 {
    font-size: 18px;
    margin: 0 0 8px;
}

.video-info p { margin: 0; color: var(--muted); }

.quality label {
    display: block;
    color: #c7cdd7;
    font-size: 13px;
    margin-bottom: 7px;
}

select {
    width: 100%;
    height: 50px;
    padding: 0 14px;
}

.download-btn {
    width: 100%;
    height: 54px;
    margin-top: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.progress-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    padding: 13px;
    border-radius: 13px;
    background: rgba(255,255,255,.035);
    color: #d7dce5;
}

.progress-box p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #3a4150;
    border-top-color: #a78bfa;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0 auto 24px;
    width: min(100%, 760px);
}

.features div {
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255,255,255,.02);
}

.features strong {
    display: block;
    color: #a78bfa;
    font-size: 12px;
    margin-bottom: 6px;
}

.features span { color: #b7beca; font-size: 13px; }

footer {
    color: #5f6775;
    text-align: center;
    font-size: 11px;
    padding: 0 0 22px;
}

.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: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 650px) {
    .hero { padding-top: 28px; }
    .logo { margin-bottom: 52px; }
    h1 { letter-spacing: -2px; }
    .input-row { flex-direction: column; }
    .input-row button { height: 54px; }
    .video-info img { width: 115px; }
    .features { grid-template-columns: 1fr; }
}
