* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --bg: #09070d;
    --surface: #16111e;
    --surface-2: #1d1628;
    --border: rgba(181, 103, 255, 0.24);
    --border-strong: rgba(191, 117, 255, 0.52);
    --text: #f6f0fc;
    --muted: #a99fb4;
    --muted-2: #776e80;
    --accent: #a95bff;
    --light: #d69dff;
    --soft: rgba(169, 91, 255, 0.12);
    --success: #69dba5;
    --danger: #ff8b9b;
    --sidebar: 248px;
    --shadow: 0 20px 55px rgba(0, 0, 0, 0.34);
}

html,
body {
    margin: 0;
    min-width: 320px;
    min-height: 100%;
    background: var(--bg);
}

body {
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(
            circle at 70% -10%,
            rgba(135, 53, 204, 0.2),
            transparent 34%
        ),
        linear-gradient(
            145deg,
            #08060b,
            #0b0810 48%,
            #09070d
        );
}

button,
input {
    font: inherit;
}

button,
a {
    color: inherit;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--sidebar);
    min-height: 100vh;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: #0d0a12;
    box-shadow: 14px 0 40px rgba(0, 0, 0, 0.24);
}

.brand {
    padding: 4px 4px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.brand img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 1px solid var(--border-strong);
    border-radius: 13px;
    background: #100b17;
}

.brand strong {
    font-family: Georgia, serif;
    font-size: 18px;
    letter-spacing: 0.16em;
}

.nav {
    margin-top: 20px;
    display: grid;
    gap: 7px;
}

.nav a,
.nav button {
    min-height: 46px;
    padding: 0 13px;
    display: grid;
    grid-template-columns: 26px 1fr;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    text-align: left;
    text-decoration: none;
}

.nav a {
    cursor: pointer;
}

.nav button {
    opacity: 0.58;
}

.nav a:hover {
    transform: translateX(2px);
    border-color: var(--border);
    background: var(--soft);
    color: var(--text);
}

.nav a.active {
    border-color: var(--border-strong);
    background:
        linear-gradient(
            90deg,
            rgba(169, 91, 255, 0.2),
            rgba(169, 91, 255, 0.04)
        );
    color: var(--light);
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav span:first-child {
    color: var(--light);
    font-size: 20px;
    text-align: center;
}

.profile {
    margin-top: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: 40px 1fr 24px;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(25, 19, 34, 0.82);
}

.avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: linear-gradient(145deg, #2a193c, #120b19);
    color: var(--light);
    font-weight: 800;
}

.profile strong,
.profile small {
    display: block;
}

.profile small {
    margin-top: 3px;
    color: var(--light);
}

.profile button {
    border: 0;
    background: transparent;
    color: var(--muted);
}

.workspace {
    min-width: 0;
    margin-left: var(--sidebar);
}

.topbar {
    min-height: 82px;
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(9, 7, 13, 0.86);
    backdrop-filter: blur(14px);
}

.topbar small,
.card > small,
.card div > small {
    color: var(--light);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.topbar h1 {
    margin: 3px 0 0;
    font-size: clamp(22px, 2.2vw, 30px);
}

.back-link {
    color: var(--light);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

main {
    width: min(1450px, calc(100% - 44px));
    margin: 0 auto;
    padding: 22px 0 48px;
}

.card {
    border: 1px solid var(--border);
    border-radius: 17px;
    background:
        linear-gradient(
            145deg,
            rgba(24, 18, 33, 0.96),
            rgba(13, 10, 18, 0.96)
        );
    box-shadow: var(--shadow);
}

.intro-card {
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.intro-card h2 {
    margin: 7px 0 0;
    font-family: Georgia, serif;
    font-size: clamp(26px, 3vw, 38px);
}

.intro-card p {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.status-pill {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--soft);
    color: var(--light);
    font-size: 12px;
    white-space: nowrap;
}

.upload-layout {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    align-items: start;
    gap: 18px;
}

.upload-card {
    padding: 22px;
}

.drop-zone {
    width: 100%;
    min-height: 250px;
    padding: 28px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    border: 1px dashed var(--border-strong);
    border-radius: 15px;
    background:
        radial-gradient(
            circle at 50% 10%,
            rgba(169, 91, 255, 0.12),
            transparent 40%
        ),
        rgba(12, 9, 17, 0.74);
    color: var(--text);
    cursor: pointer;
    text-align: center;
    transition:
        border-color 150ms ease,
        background 150ms ease,
        transform 150ms ease;
}

.drop-zone:hover,
.drop-zone.dragging {
    transform: translateY(-2px);
    border-color: var(--light);
    background:
        radial-gradient(
            circle at 50% 10%,
            rgba(169, 91, 255, 0.2),
            transparent 42%
        ),
        rgba(16, 11, 22, 0.9);
}

.upload-icon {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--soft);
    color: var(--light);
    font-size: 29px;
    box-shadow: 0 0 28px rgba(169, 91, 255, 0.16);
}

.drop-zone strong {
    margin-top: 7px;
    font-size: 20px;
}

.drop-zone > span:not(.upload-icon) {
    color: var(--muted);
}

.drop-zone small {
    color: var(--muted-2);
}

.hidden {
    display: none !important;
}

.file-card {
    margin-top: 14px;
    padding: 14px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(22, 17, 30, 0.82);
}

.file-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--soft);
    color: var(--light);
}

.file-info {
    min-width: 0;
}

.file-info strong,
.file-info span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-info span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.remove-button {
    min-height: 36px;
    padding: 0 11px;
    border: 1px solid rgba(255, 139, 155, 0.28);
    border-radius: 9px;
    background: rgba(255, 139, 155, 0.08);
    color: var(--danger);
    cursor: pointer;
}

.mode-section,
.preferences {
    margin-top: 22px;
    padding-top: 21px;
    border-top: 1px solid var(--border);
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.section-heading h3 {
    margin: 5px 0 0;
    font-size: 19px;
}

.section-heading > span {
    color: var(--muted-2);
    font-size: 12px;
}

.mode-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
}

.mode-card {
    min-height: 154px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(18, 13, 25, 0.78);
    cursor: pointer;
}

.mode-card:has(input:checked) {
    border-color: var(--border-strong);
    background:
        linear-gradient(
            145deg,
            rgba(169, 91, 255, 0.15),
            rgba(18, 13, 25, 0.8)
        );
    box-shadow: inset 0 0 0 1px rgba(169, 91, 255, 0.12);
}

.mode-card input {
    position: absolute;
    top: 14px;
    right: 14px;
    accent-color: var(--accent);
}

.mode-title {
    padding-right: 24px;
    font-size: 17px;
    font-weight: 800;
}

.mode-description {
    margin-top: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.mode-card small {
    margin-top: auto;
    padding-top: 12px;
    color: var(--muted-2);
    line-height: 1.35;
}

.recommended-badge {
    width: max-content;
    margin-bottom: 9px;
    padding: 4px 7px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--light);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.tag-grid {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.tag-grid label {
    cursor: pointer;
}

.tag-grid input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tag-grid span {
    min-height: 38px;
    padding: 0 13px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(18, 13, 25, 0.72);
    color: var(--muted);
}

.tag-grid input:checked + span {
    border-color: var(--border-strong);
    background: var(--soft);
    color: var(--light);
}

.preference-note {
    margin: 12px 0 0;
    color: var(--muted-2);
    font-size: 12px;
    line-height: 1.45;
}

.primary-button {
    width: 100%;
    min-height: 50px;
    margin-top: 22px;
    border: 0;
    border-radius: 11px;
    background:
        linear-gradient(
            135deg,
            #8f3df0,
            #bd69ff
        );
    color: white;
    cursor: pointer;
    font-weight: 800;
    box-shadow:
        0 12px 28px rgba(155, 63, 239, 0.23);
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.46;
}

.form-message {
    min-height: 20px;
    margin: 10px 0 0;
    color: var(--danger);
    font-size: 13px;
    text-align: center;
}

.upload-rights-panel {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(168, 85, 247, 0.38);
    border-radius: 14px;
    background: rgba(94, 43, 135, 0.12);
}

.upload-rights-panel h3 {
    margin: 0.25rem 0 0.75rem;
}

.upload-rights-panel > p {
    margin: 0.7rem 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.upload-rights-check {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    line-height: 1.45;
}

.upload-rights-check input {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
    accent-color: var(--accent);
}

.upload-rights-check a {
    color: var(--accent-soft);
}

.side-column {
    display: grid;
    gap: 14px;
}

.side-card {
    padding: 18px;
}

.side-card h3 {
    margin: 8px 0 0;
    font-size: 18px;
}

.side-card > p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.steps {
    margin: 16px 0 0;
    padding: 0;
    display: grid;
    gap: 16px;
    list-style: none;
}

.steps li {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 10px;
}

.steps li > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--soft);
    color: var(--light);
    font-weight: 800;
}

.steps strong {
    font-size: 14px;
}

.steps p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.progress-panel {
    margin-top: 18px;
    padding: 22px;
}

.progress-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.progress-heading h2 {
    margin: 5px 0 0;
}

.progress-heading > strong {
    color: var(--light);
    font-family: Georgia, serif;
    font-size: 34px;
}

.progress-track {
    height: 13px;
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #0c0911;
}

#progressBar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(
            90deg,
            #8935e8,
            #c56dff
        );
    box-shadow: 0 0 16px rgba(169, 91, 255, 0.46);
    transition: width 120ms linear;
}

#progressText {
    margin: 10px 0 0;
    color: var(--muted);
}

@media (max-width: 1080px) {
    .upload-layout {
        grid-template-columns: 1fr;
    }

    .side-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .sidebar {
        display: none;
    }

    .workspace {
        margin-left: 0;
    }

    .mode-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .topbar,
    .intro-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        padding: 13px;
    }

    main {
        width: calc(100% - 26px);
        padding-top: 13px;
    }

    .intro-card,
    .upload-card,
    .side-card,
    .progress-panel {
        border-radius: 13px;
    }

    .status-pill {
        white-space: normal;
    }

    .side-column {
        grid-template-columns: 1fr;
    }

    .drop-zone {
        min-height: 220px;
    }
}

/* Mobile Beta Polish */
@media (max-width: 800px) {
    .workspace,
    .upload-layout,
    .upload-card,
    .side-column,
    .file-copy {
        min-width: 0;
    }

    .topbar {
        padding-top: max(13px, env(safe-area-inset-top));
        padding-right: max(13px, env(safe-area-inset-right));
        padding-left: max(13px, env(safe-area-inset-left));
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    .drop-zone {
        padding: 24px 16px;
    }

    .drop-zone button,
    .primary-button,
    .remove-button,
    .top-actions a,
    .top-actions button {
        min-height: 44px;
    }

    .file-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .file-row .remove-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .file-name,
    #progressText,
    .status-pill {
        overflow-wrap: anywhere;
    }
}

@media (max-width: 480px) {
    .intro-card,
    .upload-card,
    .side-card,
    .progress-panel {
        padding: 16px;
    }

    .top-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .top-actions > * {
        width: 100%;
    }

    .progress-heading {
        flex-direction: column;
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
