:root {
    color-scheme: dark;
    --ink: #080a0b;
    --ink-soft: #101315;
    --surface: rgba(18, 21, 23, 0.94);
    --surface-raised: rgba(27, 30, 32, 0.96);
    --line: rgba(219, 159, 91, 0.32);
    --line-soft: rgba(255, 255, 255, 0.11);
    --bronze: #d99b59;
    --bronze-light: #f1c17f;
    --copper: #b96632;
    --cyan: #68d8cc;
    --magenta: #d453bb;
    --text: #f5f3ee;
    --muted: #b9b6af;
    --success: #57d69b;
    --danger: #ff7d75;
    --radius: 7px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        linear-gradient(rgba(4, 6, 7, 0.78), rgba(4, 6, 7, 0.93)),
        url("../images/magic407-depth-background.jpg") center top / cover fixed;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    pointer-events: none;
    background-image:
        linear-gradient(rgba(104, 216, 204, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(217, 155, 89, 0.045) 1px, transparent 1px);
    background-size: 84px 84px;
    mask-image: linear-gradient(to bottom, black, transparent 72%);
}

a {
    color: inherit;
    text-decoration: none;
}

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

button,
select,
input[type="file"] {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

.portal-shell {
    width: min(100%, 1460px);
    margin: 0 auto;
    padding: 0 28px 34px;
}

.portal-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(120px, 1fr);
    align-items: center;
    min-height: 78px;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 10, 11, 0.91);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(18px);
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    gap: 12px;
}

.portal-brand img {
    width: 52px;
    height: 52px;
    border: 1px solid rgba(241, 193, 127, 0.45);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42), 0 0 18px rgba(217, 155, 89, 0.16);
}

.portal-brand strong,
.portal-brand small {
    display: block;
    letter-spacing: 0;
}

.portal-brand strong {
    font-size: 1.15rem;
}

.portal-brand small {
    margin-top: 2px;
    color: var(--bronze);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.portal-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.portal-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.portal-nav a:hover,
.portal-nav a:focus-visible {
    border-color: var(--line);
    color: var(--text);
    background: rgba(255, 255, 255, 0.045);
    outline: none;
}

.portal-nav svg,
.portal-language svg {
    width: 18px;
    height: 18px;
}

.portal-language {
    display: flex;
    justify-self: end;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    overflow: hidden;
}

.portal-language button {
    width: 43px;
    height: 36px;
    border: 0;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.78rem;
    font-weight: 900;
}

.portal-language button + button {
    border-left: 1px solid var(--line-soft);
}

.portal-language button.is-active {
    color: #16110d;
    background: var(--bronze-light);
}

.portal-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    align-items: end;
    gap: 42px;
    min-height: 330px;
    padding: 58px 46px 42px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-left: 1px solid var(--line);
    background:
        linear-gradient(90deg, rgba(8, 10, 11, 0.98) 0%, rgba(8, 10, 11, 0.84) 48%, rgba(8, 10, 11, 0.58) 100%),
        url("../images/magic407-studio-banner-v1.png") right center / cover no-repeat;
    box-shadow: inset 0 -18px 38px rgba(0, 0, 0, 0.28), 0 24px 64px rgba(0, 0, 0, 0.3);
}

.portal-intro-copy {
    max-width: 760px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--bronze);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.portal-intro h1,
.panel-heading h2,
.review-aside h2,
.success-panel h2 {
    letter-spacing: 0;
}

.portal-intro h1 {
    max-width: 760px;
    margin: 0;
    font-size: 2.85rem;
    line-height: 1.05;
}

.portal-intro-copy > p:last-child {
    max-width: 700px;
    margin: 20px 0 0;
    color: #d2cec7;
    font-size: 0.97rem;
    line-height: 1.65;
}

.portal-promises {
    display: grid;
    gap: 9px;
    padding-left: 26px;
    border-left: 2px solid var(--bronze);
}

.portal-promises span {
    display: grid;
    grid-template-columns: 26px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    color: #dedbd5;
}

.portal-promises b {
    font-size: 0.94rem;
    line-height: 1.35;
}

.portal-promises svg {
    width: 20px;
    height: 20px;
    color: var(--cyan);
}

.submission-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 30px;
    padding: 36px 0 54px;
}

.submission-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 30px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--surface-raised);
}

.panel-heading h2,
.review-aside h2 {
    margin: 0;
    font-size: 1.72rem;
}

.panel-heading p:last-child {
    margin: 9px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.cms-only-badge {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid rgba(104, 216, 204, 0.35);
    border-radius: 5px;
    color: var(--cyan);
    background: rgba(104, 216, 204, 0.07);
    font-size: 0.76rem;
    font-weight: 900;
}

.cms-only-badge svg {
    width: 16px;
    height: 16px;
}

form fieldset {
    min-width: 0;
    margin: 0;
    padding: 28px 30px 30px;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
}

form legend {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0 0 21px;
    padding: 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 900;
}

form legend > span:first-child {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--bronze-light);
    font-size: 0.7rem;
}

.field-grid {
    display: grid;
    gap: 17px;
}

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

.full-width {
    grid-column: 1 / -1;
}

.field-grid label,
.message-field {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: #dedbd5;
    font-size: 0.82rem;
    font-weight: 800;
}

.field-grid label small {
    color: #8e918f;
    font-size: 0.73rem;
    font-weight: 600;
    line-height: 1.45;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    color: var(--text);
    background: #0c0f10;
    outline: none;
}

input,
select {
    min-height: 48px;
    padding: 0 13px;
}

textarea {
    min-height: 128px;
    padding: 13px;
    resize: vertical;
    line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
    color: #6f7472;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--bronze);
    box-shadow: 0 0 0 3px rgba(217, 155, 89, 0.12);
}

input:invalid:not(:placeholder-shown) {
    border-color: rgba(255, 125, 117, 0.72);
}

.upload-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 15px;
}

.track-limit-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: -3px 0 19px;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.track-limit-note svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: var(--cyan);
}

.track-upload-list {
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
}

.track-upload-slot {
    padding: 22px 0 24px;
}

.track-upload-slot + .track-upload-slot {
    border-top: 1px solid var(--line-soft);
}

.track-slot-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
}

.track-slot-heading > strong {
    font-size: 1rem;
}

.track-slot-heading > span {
    border: 1px solid rgba(104, 216, 204, 0.35);
    border-radius: 999px;
    padding: 4px 8px;
    color: var(--cyan);
    background: rgba(104, 216, 204, 0.07);
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
}

.track-slot-heading > span.is-optional {
    border-color: var(--line-soft);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
}

.track-slot-fields {
    margin-bottom: 15px;
}

.file-drop {
    position: relative;
    display: grid;
    min-height: 206px;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 24px;
    border: 1px dashed rgba(255, 255, 255, 0.24);
    border-radius: 6px;
    text-align: center;
    background: rgba(255, 255, 255, 0.025);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.file-drop:hover,
.file-drop:focus-within,
.file-drop.is-dragging {
    border-color: var(--bronze-light);
    background: rgba(217, 155, 89, 0.07);
    transform: translateY(-2px);
}

.file-drop input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    opacity: 0;
}

.file-drop svg {
    width: 36px;
    height: 36px;
    color: var(--bronze);
}

.file-drop-audio svg {
    color: var(--cyan);
}

.file-drop strong,
.file-drop span,
.file-drop small,
.file-drop output {
    pointer-events: none;
}

.file-drop strong {
    font-size: 0.98rem;
}

.file-drop span,
.file-drop small {
    color: var(--muted);
    font-size: 0.78rem;
}

.file-drop output {
    display: block;
    max-width: 100%;
    margin-top: 8px;
    padding: 7px 9px;
    overflow: hidden;
    border-radius: 4px;
    color: #c7cbc9;
    background: rgba(0, 0, 0, 0.3);
    font-size: 0.72rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-drop.has-file output {
    color: #08110d;
    background: var(--success);
}

.message-field {
    margin-bottom: 20px;
}

.consent-list {
    display: grid;
    gap: 10px;
}

.consent-list label {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 12px 13px;
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.025);
}

.consent-list input {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 2px 0 0;
    accent-color: var(--bronze);
}

.consent-list b,
.consent-list small {
    display: block;
}

.consent-list b {
    color: #e8e5df;
    font-size: 0.83rem;
}

.consent-list small {
    margin-top: 3px;
    color: #969995;
    font-size: 0.73rem;
    line-height: 1.45;
}

.submit-area {
    display: grid;
    gap: 13px;
    padding: 26px 30px 30px;
}

.submit-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 48px;
    gap: 9px;
    border-radius: 5px;
    font-weight: 900;
}

.submit-button {
    min-width: 190px;
    border: 1px solid #f0bd78;
    color: #17110c;
    background: var(--bronze-light);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), inset 0 -3px 0 rgba(91, 49, 18, 0.23), 0 12px 28px rgba(185, 102, 50, 0.23);
}

.submit-button:hover,
.submit-button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.06);
    outline: none;
}

.submit-button:disabled {
    cursor: wait;
    opacity: 0.62;
    transform: none;
}

.submit-button svg,
.secondary-button svg {
    width: 18px;
    height: 18px;
}

.submit-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 0;
    color: #898d89;
    font-size: 0.73rem;
    line-height: 1.45;
}

.submit-note svg {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-top: 1px;
    color: var(--cyan);
}

.form-status {
    min-height: 20px;
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

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

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

.upload-progress {
    display: grid;
    gap: 8px;
}

.upload-progress > div {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    color: var(--muted);
    font-size: 0.77rem;
    font-weight: 800;
}

.progress-track {
    display: block;
    height: 7px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.09);
}

.progress-track i {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--bronze), var(--magenta));
    transition: width 180ms ease;
}

.success-panel {
    display: grid;
    min-height: 520px;
    place-items: center;
    align-content: center;
    padding: 48px 30px;
    text-align: center;
}

.success-panel > svg {
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
    color: var(--success);
}

.success-panel h2 {
    max-width: 720px;
    margin: 0;
    font-size: 1.8rem;
}

.success-panel > p:not(.eyebrow) {
    max-width: 620px;
    margin: 14px 0 0;
    color: var(--muted);
    line-height: 1.65;
}

.reference-box {
    display: grid;
    gap: 5px;
    min-width: 260px;
    margin: 25px 0;
    padding: 15px 20px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.25);
}

.reference-box span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.reference-box strong {
    color: var(--bronze-light);
    font-size: 1.3rem;
}

.secondary-button {
    border: 1px solid var(--line);
    padding: 0 16px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
}

.review-aside {
    position: sticky;
    top: 108px;
    padding: 6px 0 0 26px;
    border-left: 1px solid var(--line);
}

.review-aside > p,
.review-aside h2 {
    margin-right: 10px;
}

.review-steps {
    display: grid;
    gap: 22px;
    margin: 28px 0;
    padding: 0;
    list-style: none;
}

.review-steps li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 13px;
}

.review-steps li > span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--bronze-light);
    font-size: 0.78rem;
    font-weight: 900;
    background: rgba(217, 155, 89, 0.07);
}

.review-steps strong {
    color: #e9e6e0;
    font-size: 0.9rem;
}

.review-steps p {
    margin: 5px 0 0;
    color: #9da09c;
    font-size: 0.8rem;
    line-height: 1.55;
}

.sound-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.sound-list span {
    padding: 6px 8px;
    border: 1px solid var(--line-soft);
    border-radius: 4px;
    color: #bcb9b3;
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.67rem;
    font-weight: 800;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
    color: var(--bronze-light);
    font-size: 0.82rem;
    font-weight: 800;
}

.contact-link svg {
    width: 17px;
    height: 17px;
}

.portal-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 4px 0;
    border-top: 1px solid var(--line-soft);
    color: #787c79;
    font-size: 0.76rem;
    font-weight: 700;
}

.form-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 1060px) {
    .portal-header {
        grid-template-columns: 1fr auto;
    }

    .portal-nav {
        display: none;
    }

    .portal-intro {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .portal-promises {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 18px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .submission-layout {
        grid-template-columns: 1fr;
    }

    .review-aside {
        position: static;
        padding: 28px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .review-steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    body {
        background-attachment: scroll;
    }

    .portal-shell {
        padding: 0 16px 26px;
    }

    .portal-header {
        min-height: 68px;
    }

    .portal-brand img {
        width: 44px;
        height: 44px;
    }

    .portal-brand strong {
        font-size: 1rem;
    }

    .portal-intro {
        gap: 28px;
        padding: 36px 22px 30px;
        background:
            linear-gradient(rgba(8, 10, 11, 0.84), rgba(8, 10, 11, 0.95)),
            url("../images/magic407-studio-banner-v1.png") center / cover no-repeat;
    }

    .portal-intro h1 {
        font-size: 2.08rem;
        line-height: 1.08;
    }

    .portal-intro-copy > p:last-child {
        font-size: 0.94rem;
    }

    .portal-promises {
        grid-template-columns: 1fr;
    }

    .submission-layout {
        padding-top: 22px;
    }

    .panel-heading {
        display: grid;
        padding: 23px 20px;
    }

    .cms-only-badge {
        width: fit-content;
    }

    form fieldset,
    .submit-area {
        padding-right: 20px;
        padding-left: 20px;
    }

    .two-columns,
    .upload-grid,
    .review-steps {
        grid-template-columns: 1fr;
    }

    .file-drop {
        min-height: 184px;
    }

    .submit-button {
        width: 100%;
    }

    .success-panel {
        min-height: 450px;
        padding: 38px 20px;
    }

    .portal-footer {
        display: grid;
        justify-content: start;
        gap: 5px;
    }
}

@media (max-width: 390px) {
    .portal-shell {
        padding-inline: 10px;
    }

    .portal-brand small {
        display: none;
    }

    .portal-intro h1 {
        font-size: 1.92rem;
    }

    .portal-language button {
        width: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
