
:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172033;
    background: #edf2fb;
    font-synthesis: none;
    --primary: #5b4cf0;
    --primary-dark: #4637c9;
    --primary-soft: #eeeafd;
    --accent: #2474f5;
    --surface: rgba(255, 255, 255, 0.96);
    --surface-muted: #f6f8fd;
    --border: #dfe5f2;
    --text: #172033;
    --muted: #68738a;
    --success: #087f5b;
    --danger: #d9485f;
    --shadow: 0 16px 45px rgba(57, 72, 112, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #edf2fb;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(
            circle at 8% 4%,
            rgba(91, 76, 240, 0.12),
            transparent 30rem
        ),
        radial-gradient(
            circle at 92% 8%,
            rgba(36, 116, 245, 0.10),
            transparent 32rem
        ),
        linear-gradient(180deg, #f8faff 0, #edf2fb 68%, #e8eef9 100%);
}

button,
select,
textarea,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.container {
    width: min(1360px, 100%);
    margin: 0 auto;
    padding: 30px 28px 38px;
}

header {
    display: grid;
    justify-items: center;
    padding: 20px 18px 26px;
    margin-bottom: 22px;
    text-align: center;
}

header img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(560px, 84vw);
    max-height: 175px;
    object-fit: contain;
    filter:
        drop-shadow(0 14px 30px rgba(52, 77, 148, 0.14))
        drop-shadow(0 2px 7px rgba(255, 255, 255, 0.8));
}

header p {
    max-width: 720px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1.72fr) minmax(310px, 0.75fr);
    gap: 20px;
    align-items: start;
}

.column {
    display: grid;
    align-content: start;
    gap: 20px;
}

.card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.heading,
.range-row,
.progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.heading span {
    display: block;
    color: #7a83a0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.heading h1,
.heading h2 {
    margin: 5px 0 0;
}

.heading strong,
#playerState {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 6px 11px;
    border: 1px solid #d8d4fb;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

h1 {
    font-size: clamp(21px, 2.3vw, 27px);
    line-height: 1.2;
}

h2 {
    margin: 0 0 14px;
    color: #232c43;
    font-size: 16px;
}

p {
    color: var(--muted);
    line-height: 1.55;
}

textarea,
select {
    width: 100%;
    border: 1px solid #ccd5e8;
    border-radius: 12px;
    outline: none;
    background: #fff;
    color: var(--text);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

textarea:hover,
select:hover {
    border-color: #aebadc;
}

textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(91, 76, 240, 0.12);
}

textarea {
    min-height: 235px;
    margin-top: 18px;
    padding: 17px;
    resize: vertical;
    background: #fbfcff;
    font-size: 16px;
    line-height: 1.62;
}

select {
    min-height: 45px;
    padding: 10px 38px 10px 12px;
    cursor: pointer;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
    color: #7b859c;
}

.footer small:last-child {
    font-variant-numeric: tabular-nums;
}

.two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.range-row output {
    min-width: 64px;
    padding: 5px 9px;
    border-radius: 8px;
    background: #eef2fa;
    color: #34405d;
    font-weight: 800;
    text-align: center;
}

input[type="range"] {
    width: 100%;
    margin: 13px 0 2px;
    accent-color: var(--primary);
}

.toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.toggle h2 {
    margin-bottom: 5px;
}

.toggle p {
    margin: 0;
}

.toggle input {
    flex: 0 0 auto;
    width: 25px;
    height: 25px;
    accent-color: var(--primary);
    cursor: pointer;
}

.actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 14px;
}

button,
.downloads a {
    min-height: 49px;
    border: 1px solid #cbd4e8;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

button:hover:not(:disabled),
.downloads a:hover {
    transform: translateY(-1px);
}

button:active:not(:disabled),
.downloads a:active {
    transform: translateY(0);
}

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

#generate {
    border: 0;
    background: linear-gradient(100deg, #2378f3, #604cf0 62%, #8244e9);
    color: #fff;
    box-shadow: 0 12px 24px rgba(72, 74, 222, 0.22);
}

#generate:hover:not(:disabled) {
    box-shadow: 0 15px 28px rgba(72, 74, 222, 0.29);
}

.actions button:last-child,
.downloads a,
.downloads button,
.music-preview-row button {
    display: grid;
    place-items: center;
    background: #fff;
    color: #33405d;
    text-decoration: none;
}

.actions button:last-child:hover,
.downloads a:hover,
.downloads button:hover,
.music-preview-row button:hover:not(:disabled) {
    border-color: #9eace0;
    background: #f5f7fd;
}

.progress-panel {
    padding: 17px 18px;
    border: 1px solid #d8d4fb;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8f7ff, #f2f5fd);
    box-shadow: 0 10px 28px rgba(75, 77, 137, 0.08);
}

.progress-head {
    margin-bottom: 10px;
    color: #3c4660;
}

.progress-head strong {
    color: var(--primary-dark);
    font-variant-numeric: tabular-nums;
}

.progress-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe5f1;
}

.progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2474f5, #6150ef, #9548e5);
    box-shadow: 0 0 14px rgba(91, 76, 240, 0.25);
    transition: width 0.35s ease;
}

audio {
    width: 100%;
    margin-top: 18px;
}

.downloads {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.music-preview-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 10px;
    margin-top: 13px;
}

.music-preview-row button {
    min-height: 43px;
}

#musicSettings {
    padding-top: 17px;
    margin-top: 17px;
    border-top: 1px solid #e4e9f3;
}

aside label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    align-items: center;
    gap: 12px;
    margin-top: 13px;
    color: #4e5972;
    font-size: 14px;
    font-weight: 650;
}

aside label select {
    min-height: 41px;
}

#status {
    min-height: 25px;
    padding: 2px 8px;
    color: #566178;
    text-align: center;
    font-weight: 650;
}

#status.success {
    color: var(--success);
}

#status.error {
    color: var(--danger);
}

.hidden {
    display: none !important;
}

@media (max-width: 960px) {
    .grid {
        grid-template-columns: 1fr;
    }

    aside.column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    aside.column .card:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .container {
        padding: 18px 13px 28px;
    }

    header {
        padding-top: 10px;
    }

    .card {
        padding: 18px;
        border-radius: 17px;
    }

    .two,
    .actions,
    .downloads,
    aside.column {
        grid-template-columns: 1fr;
    }

    aside.column .card:last-child {
        grid-column: auto;
    }

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

    .heading {
        align-items: flex-start;
    }

    .footer {
        display: grid;
        gap: 5px;
    }
}
