* {
    box-sizing: border-box;
}

:root {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;

    background:
        radial-gradient(circle at top,
            #202738 0,
            #10141d 45%,
            #080b10 100%);

    color: #f4f6fa;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

.page {
    min-height: 100vh;

    display: flex;
    justify-content: center;

    padding: 60px 20px;
}

.converter {
    width: 100%;
    max-width: 780px;
}

.header {
    display: flex;
    align-items: center;
    gap: 18px;

    margin-bottom: 30px;
}

.logo {
    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 16px;

    background: #ffffff;
    color: #10141d;

    font-weight: 800;
    font-size: 20px;
}

h1 {
    margin: 0;

    font-size: 30px;
}

h2 {
    margin-top: 0;
}

.subtitle {
    margin: 5px 0 0;

    color: #9098a8;
}

.card {
    margin-bottom: 18px;
    padding: 24px;

    border: 1px solid #2b3240;
    border-radius: 18px;

    background:
        rgba(20, 25, 35, 0.92);

    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.22);
}

.field-label {
    display: block;

    margin-bottom: 10px;

    font-size: 14px;
    font-weight: 600;

    color: #c6ccd8;
}

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

input,
select {
    width: 100%;

    border: 1px solid #353d4d;
    border-radius: 10px;

    padding: 13px 14px;

    background: #0d1118;
    color: #ffffff;

    outline: none;
}

input:focus,
select:focus {
    border-color: #747f94;
}

.url-row button,
.primary-button,
.download-button {
    border: 0;
    border-radius: 10px;

    padding: 13px 20px;

    background: #f3f5f8;
    color: #11151d;

    font-weight: 700;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease;
}

.url-row button:hover,
.primary-button:hover,
.download-button:hover {
    transform: translateY(-1px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.media-preview {
    display: flex;
    align-items: center;
    gap: 20px;
}

.thumbnail {
    width: 200px;
    max-width: 40%;

    aspect-ratio: 16 / 9;
    object-fit: cover;

    border-radius: 12px;

    background: #0a0d12;
}

.media-info {
    min-width: 0;
}

.media-info h2 {
    margin-bottom: 10px;

    overflow-wrap: anywhere;
}

.media-info p {
    margin: 5px 0;

    color: #969ead;
}

.format-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 10px;

    margin-bottom: 22px;
}

.format-button {
    border: 1px solid #353d4d;
    border-radius: 10px;

    padding: 13px;

    background: #0d1118;
    color: #b6bdc9;

    font-weight: 700;
}

.format-button.active {
    border-color: #f4f6fa;

    background: #f4f6fa;
    color: #11151d;
}

.quality-area {
    margin-bottom: 22px;
}

.primary-button {
    width: 100%;
}

.progress-header {
    display: flex;
    justify-content: space-between;

    margin-bottom: 12px;

    font-weight: 600;
}

.progress-track {
    height: 12px;

    overflow: hidden;

    border-radius: 999px;

    background: #090c11;
}

.progress-bar {
    width: 0%;
    height: 100%;

    border-radius: inherit;

    background: #f4f6fa;

    transition: width 0.35s ease;
}

.job-status {
    margin-bottom: 0;

    color: #979fad;
}

.success-card {
    text-align: center;
}

.expiry {
    color: #969ead;
}

.download-button {
    display: inline-block;

    margin-top: 10px;

    text-decoration: none;
}

.message {
    margin-bottom: 0;
}

.error {
    color: #ff8e8e;
}

.hidden {
    display: none;
}

@media (max-width: 650px) {
    .page {
        padding: 30px 14px;
    }

    .url-row {
        flex-direction: column;
    }

    .media-preview {
        align-items: flex-start;
        flex-direction: column;
    }

    .thumbnail {
        width: 100%;
        max-width: 100%;
    }
}