/* ─── Tokens ─── */
:root {
    --bg:       #0C0104;
    --border:   #2A2A2E;
    --accent:   #AF235F;
    --req:      #D7195E;
    --text:     #F5F5F5;
    --muted:    #6A6A70;
    --white:    #FFFFFF;
    --input-bg: #1C191A;
}

/* ─── Decorative backgrounds ─── */
body {
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    width: 600px;
    height: 600px;
    background: url('../img/top-right-element.png') no-repeat top right / contain;
    transform: translateX(70%) translateY(-35%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 400px;
    background: url('../img/bottom-element.png') no-repeat center top / 100% auto;
    transform: translateY(80%);
    pointer-events: none;
    z-index: 0;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
    background: var(--bg);
    font-family: 'Roboto', sans-serif;
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ─── Page shell ─── */
.page-wrapper {
    position: relative;
    z-index: 1;
    max-width: 820px;
    margin: 0 auto;
    padding: 0 32px 0;
}

/* ─── Header ─── */
.site-header {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 52px 0 56px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}

.logo-block {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-block img {
    width: 104px;
    height: 104px;
    object-fit: contain;
}

.logo-text {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.5;
}

.header-sep {
    width: 2px;
    height: 112px;
    background: #2a2a2e;
    flex-shrink: 0;
}

.header-info { flex: 1; }

.header-info h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
}

.header-info p {
    font-size: 16px;
    font-weight: 400;
    color: var(--white);
    line-height: 1.6;
    max-width: 580px;
}

/* ─── Form sections ─── */
.form-section {
    margin-bottom: 40px;
}

.section-header {
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 20px;
    font-weight: 400;
    color: var(--white);
}

/* ─── Field row ─── */
.field-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0 8px;
    margin-bottom: 24px;
    align-items: start;
}

.field-label {
    padding-top: 17px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
    text-align: left;
    line-height: 1.4;
    user-select: none;
}

.field-label .req {
    color: var(--req);
    font-weight: 700;
    margin-left: 1px;
}

.field-control { min-width: 0; }

/* ─── Text inputs & textarea ─── */
.form-input,
.form-textarea {
    display: block;
    width: 100%;
    height: 52px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 400;
    padding: 0 16px;
    outline: none;
    transition: border-color .18s;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--muted);
    font-weight: 300;
    font-style: italic;
}

.form-input:focus,
.form-textarea:focus { border-color: var(--accent); }

.form-input.is-invalid,
.form-textarea.is-invalid { border-color: var(--req); }

.form-textarea {
    height: 104px;
    padding: 14px 16px;
    resize: vertical;
}

/* ─── File upload zone ─── */
.file-zone {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--border);
    height: 52px;
    cursor: pointer;
    transition: border-color .18s;
}

.file-zone:hover,
.file-zone:focus-within { border-color: var(--accent); }
.file-zone.is-invalid { border-color: var(--req); }

.file-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.file-zone-icon {
    flex-shrink: 0;
    width: 50px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border);
    color: var(--muted);
}

.file-zone-icon svg { width: 16px; height: 16px; }

.file-zone-label {
    flex: 1;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.file-zone-text {
    font-size: 14px;
    color: var(--muted);
    font-style: italic;
    font-weight: 300;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-zone-text.has-file {
    color: var(--text);
    font-style: normal;
    font-weight: 400;
}

.file-zone-btn {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    white-space: nowrap;
    pointer-events: none;
}

/* ─── Radio group (inline) ─── */
.radio-group {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: center;
    padding-top: 17px;
    flex-wrap: wrap;
}

.radio-opt {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--text);
    font-weight: 400;
}

.radio-opt input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.radio-opt input[type="radio"]:checked {
    border-color: var(--accent);
    background: var(--accent);
}

.radio-opt input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--white);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ─── ISRC pair ─── */
.isrc-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* ─── Typography pair ─── */
.typography-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 6px;
}

/* ─── Song separator (album) ─── */
.song-separator {
    height: 2px;
    background: linear-gradient(90deg, rgba(175,35,95,0.5) 0%, rgba(175,35,95,0.08) 100%);
    margin: 0 0 32px;
}

/* ─── Hint text ─── */
.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-style: italic;
    font-weight: 300;
    color: var(--text);
    line-height: 1.5;
}

/* ─── Validation error ─── */
.field-error {
    display: none;
    margin-top: 6px;
    font-size: 11px;
    color: var(--req);
}
.field-error.visible { display: block; }

/* ─── Song box ─── */
.song-box { display: flex; flex-direction: column; }

.one-song {
    padding: 32px 0 8px;
    border-top: 1px solid var(--border);
    margin-bottom: 24px;
}

.song-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.song-title {
    font-size: 20px;
    font-weight: 400;
    color: var(--white);
}

.btn-remove-song {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s, color .15s;
    flex-shrink: 0;
}

.btn-remove-song:hover {
    border-color: var(--req);
    color: var(--req);
}

.inner-section-title {
    font-size: 20px;
    font-weight: 400;
    color: var(--white);
    margin-top: 32px;
    margin-bottom: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.one-song .field-row { grid-template-columns: 120px 1fr; }

/* ─── Add song button ─── */
.add-song-wrapper { display: none; margin-bottom: 40px; }
.add-song-wrapper.visible { display: block; }

.btn-add-song {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 12px 22px;
    cursor: pointer;
    transition: border-color .15s, color .15s;
    border-radius: 0;
}

.btn-add-song:hover { border-color: var(--accent); color: var(--accent); }
.btn-add-song svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ─── Conditional blocks ─── */
.conditional { display: none; }
.conditional.visible { display: grid; }

/* ─── Submit ─── */
.submit-wrapper {
    padding-top: 8px;
    margin-top: 24px;
}

.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 55px;
    background: var(--accent);
    border: none;
    border-radius: 3px;
    color: var(--white);
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: background .2s;
}

.btn-submit:hover { background: #c4295e; }
.btn-submit:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-submit .spinner {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-text { opacity: .75; }

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

/* ─── Toast ─── */
.toast-container {
    position: fixed;
    top: 24px; right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    min-width: 280px;
    max-width: 400px;
    background: #1C0D15;
    border: 1px solid var(--border);
    border-left: 3px solid;
    padding: 14px 18px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    animation: toastIn .25s ease;
    pointer-events: auto;
}

.toast.success { border-left-color: #27AE60; }
.toast.error   { border-left-color: var(--req); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px) translateX(8px); }
    to   { opacity: 1; transform: none; }
}

/* ─── Footer ─── */
.site-footer {
    text-align: center;
    padding: 12px 0 8px;
    font-size: 14px;
    color: var(--text);
    border-top: 1px solid var(--border);
    margin-top: 16px;
    line-height: 2;
}

.site-footer a { color: var(--text); text-decoration: underline; }
.site-footer a:hover { color: var(--white); }

/* ─── Responsive ─── */
@media (max-width: 680px) {
    .page-wrapper { padding: 0 20px 60px; }
    .site-header { flex-direction: column; align-items: flex-start; gap: 20px; padding: 36px 0 40px; margin-bottom: 40px; }
    .header-sep { display: none; }
    .field-row,
    .one-song .field-row { grid-template-columns: 1fr; gap: 6px; }
    .field-label { padding-top: 0; }
    .radio-group { flex-wrap: wrap; }
    .section-header { margin-bottom: 20px; }
}
