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

html, body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
}

/* ── Layout ── */
.sc-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 4rem 1.25rem 3rem;
}

/* ── Header ── */
.sc-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.sc-header--result {
    margin-bottom: 1.5rem;
}

.sc-logo {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: #fff;
}

.sc-tagline {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: #666;
}

/* ── Card ── */
.sc-card {
    width: 100%;
    max-width: 560px;
    background: #141414;
    border: 1px solid #242424;
    border-radius: 18px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.sc-card--result {
    max-width: 620px;
}

/* ── Form fields ── */
.sc-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.sc-field label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #666;
}

.sc-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #444;
}

.sc-row {
    display: flex;
    gap: 0.875rem;
}

.sc-input {
    width: 100%;
    background: #0e0e0e;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    color: #e0e0e0;
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
    appearance: none;
    -webkit-appearance: none;
}

.sc-input:focus { border-color: #444; }

/* ── Custom select ── */
.sc-select-wrapper {
    position: relative;
}

.sc-select-wrapper::after {
    content: '';
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #555;
}

select.sc-input {
    padding-right: 2.5rem;
    cursor: pointer;
}

select.sc-input option { background: #141414; }

/* ── Alert ── */
.sc-alert {
    background: #1c0f0f;
    border: 1px solid #4a1f1f;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    color: #d06060;
}

/* ── Buttons ── */
.sc-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #e8e8e8;
    color: #0a0a0a;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, opacity 0.15s;
    width: 100%;
}

.sc-btn-primary:hover:not(:disabled) { background: #fff; }
.sc-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.sc-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #666;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 0.7rem 1.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
    flex: 1;
}

.sc-btn-secondary:hover { border-color: #444; color: #ccc; }

/* ── Spinner (submit button) ── */
.sc-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #555;
    border-top-color: #111;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* ── Processing state ── */
.sc-processing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
}

.sc-progress-ring {
    position: relative;
    width: 96px;
    height: 96px;
}

.sc-progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.sc-ring-bg {
    fill: none;
    stroke: #222;
    stroke-width: 5;
}

.sc-ring-fill {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 175.9;
    transition: stroke-dashoffset 0.5s ease;
}

.sc-ring-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #e0e0e0;
}

.sc-processing-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.sc-status-msg {
    font-size: 0.85rem;
    color: #555;
}

/* ── Tabs ── */
.sc-tabs {
    display: flex;
    gap: 0.25rem;
    background: #0e0e0e;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 0.25rem;
}

.sc-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: #555;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sc-tab:hover { color: #aaa; }
.sc-tab--active { background: #1e1e1e; color: #e0e0e0; }

/* ── Live tab helpers ── */
.sc-live-probe {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #555;
}

.sc-spinner--dark {
    border-color: #333;
    border-top-color: #888;
}

.sc-live-info {
    font-size: 0.8rem;
    color: #5090c0;
    background: #0e1e2e;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
}

.sc-input-suffix {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sc-input-suffix .sc-input { flex: 1; }

.sc-input-suffix span {
    font-size: 0.85rem;
    color: #555;
    white-space: nowrap;
}

/* ── Cancel button (processing state) ── */
.sc-btn-cancel {
    background: transparent;
    border: none;
    color: #444;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.15s;
}

.sc-btn-cancel:hover:not(:disabled) { color: #888; }
.sc-btn-cancel:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Badges ── */
.sc-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
}

.sc-badge--queued      { background: #1e1e1e; color: #666; }
.sc-badge--downloading { background: #0e1e2e; color: #5090c0; }
.sc-badge--processing  { background: #1a0e2e; color: #9050c0; }
.sc-badge--ready       { background: #0e1e0e; color: #50b050; }
.sc-badge--failed      { background: #1e0e0e; color: #c05050; }
.sc-badge--cancelled   { background: #1e1a0e; color: #a08030; }

/* ── Result: ready state ── */
.sc-preview {
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.sc-video {
    width: 100%;
    display: block;
    max-height: 340px;
}

.sc-audio {
    width: 100%;
    padding: 0.5rem;
}

.sc-result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.sc-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #bbb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.sc-actions {
    display: flex;
    gap: 0.75rem;
}

.sc-actions .sc-btn-primary {
    flex: 1;
}

/* ── Result: failed state ── */
.sc-fail-icon {
    text-align: center;
    font-size: 2.5rem;
    color: #4a1f1f;
    padding: 0.5rem 0;
}

/* ── Blazor internals ── */
#blazor-error-ui {
    background: #1c0f0f;
    border-top: 1px solid #4a1f1f;
    color: #d06060;
    bottom: 0;
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 0.85rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ── Splash (Blazor WASM initial load) ── */
.sc-splash {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 1.25rem;
}

.sc-splash-logo {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: #fff;
}

.sc-splash-spinner {
    width: 22px;
    height: 22px;
    border: 2px solid #222;
    border-top-color: #555;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .sc-container { padding: 2rem 1rem 2rem; }
    .sc-row { flex-direction: column; }
    .sc-logo { font-size: 2rem; }
}
