/* Tesla Card Image Uploader — dark theme */

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

:root {
    --bg: #0d0d0d;
    --bg-card: #181818;
    --bg-input: #222;
    --bg-hover: #2a2a2a;
    --text: #f0f0f0;
    --text-muted: #888;
    --text-disabled: #555;
    --red: #e82127;
    --red-hover: #ff3b3b;
    --red-dim: rgba(232, 33, 39, .15);
    --border: #333;
    --radius: 8px;
    --font: 'Gotham', 'Century Gothic', system-ui, -apple-system, sans-serif;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--red);
    text-decoration: none;
}
a:hover {
    color: var(--red-hover);
    text-decoration: underline;
}

/* Layout */

.container {
    max-width: 520px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

/* Header */

.header {
    text-align: center;
    margin-bottom: 32px;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.header-sub {
    margin-top: 6px;
    font-size: .875rem;
    color: var(--text-muted);
}

/* Stepper */

.stepper {
    margin-bottom: 32px;
}

.stepper-list {
    display: flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    gap: 0;
}

.stepper-step {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: .4;
    transition: opacity .2s;
}

.stepper-step.active {
    opacity: 1;
}

.stepper-step.done {
    opacity: .7;
}

.stepper-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: border-color .2s, background .2s, color .2s;
}

.stepper-step.active .stepper-number {
    border-color: var(--red);
    background: var(--red);
    color: #fff;
}

.stepper-step.done .stepper-number {
    border-color: var(--red);
    color: var(--red);
}

.stepper-label {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.stepper-divider {
    width: 32px;
    height: 2px;
    background: var(--border);
    margin: 0 12px;
    flex-shrink: 0;
}

/* Step sections */

.step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    margin-bottom: 24px;
}

.step[hidden] {
    display: none;
}

.step-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.step-desc {
    font-size: .875rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Form elements */

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-select,
.form-input {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font);
    font-size: .95rem;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color .15s;
    appearance: none;
    -webkit-appearance: none;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-select:disabled,
.form-input:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.form-select:focus,
.form-input:focus {
    border-color: var(--red);
}

.form-select option {
    background: var(--bg-input);
    color: var(--text);
}

.form-select option:disabled {
    color: var(--text-disabled);
}

/* Buttons */

.btn {
    display: inline-block;
    padding: 11px 28px;
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .15s, opacity .15s;
}

.btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--red);
    color: #fff;
    width: 100%;
    margin-top: 6px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--red-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    width: 100%;
    margin-top: 8px;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text);
}

.btn-link {
    background: none;
    border: none;
    color: var(--red);
    font-family: var(--font);
    font-size: inherit;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover {
    color: var(--red-hover);
}

/* Status messages */

.status-msg {
    font-size: .85rem;
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.status-msg[hidden] {
    display: none;
}

.status-msg.pending {
    background: rgba(255, 180, 0, .1);
    border: 1px solid rgba(255, 180, 0, .3);
    color: #ffb400;
}

.status-msg.complete {
    background: rgba(0, 200, 100, .1);
    border: 1px solid rgba(0, 200, 100, .3);
    color: #00c864;
}

/* Notices */

.notice {
    padding: 18px 20px;
    border-radius: var(--radius);
    font-size: .9rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.notice p + p {
    margin-top: 8px;
}

.notice-info {
    background: var(--red-dim);
    border: 1px solid rgba(232, 33, 39, .3);
}

.upload-tips ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.upload-tips li {
    margin-top: 4px;
    font-size: .85rem;
    color: var(--text-muted);
}

.upload-tips li strong {
    color: var(--text);
}

.notice-placeholder {
    background: rgba(255, 255, 255, .04);
    border: 1px dashed var(--border);
    text-align: center;
    padding: 40px 20px;
}

.notice-small {
    font-size: .8rem;
    color: var(--text-muted);
}

/* Loading overlay */

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .4s ease;
}

.loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, .15);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto 12px;
}

.loading-text {
    color: var(--text-muted);
    font-family: var(--font);
    font-size: .9rem;
}

/* Spinner */

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* Error */

.error-text {
    color: var(--red);
    font-size: .85rem;
    margin-top: 8px;
}

/* Dev button */

.btn-dev {
    width: 100%;
    margin-top: 8px;
    background: transparent;
    color: #555;
    border: 1px dashed #333;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.btn-dev:hover {
    color: #888;
    border-color: #555;
    background: rgba(255, 255, 255, .03);
}

/* Footer */

.footer {
    text-align: center;
    padding-top: 16px;
    font-size: .8rem;
    color: var(--text-disabled);
}

/* Upload step — wider container */

.container.container-wide {
    max-width: 960px;
}

/* Upload counter */

.upload-counter {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-align: center;
}

/* Upload wizard */

.upload-wizard {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

/* Sidebar */

.upload-sidebar {
    width: 220px;
    flex-shrink: 0;
}

.upload-sidebar-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.upload-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    border-left: 3px solid transparent;
    font-size: .82rem;
    color: var(--text-muted);
    user-select: none;
}

.upload-sidebar-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.upload-sidebar-item.active {
    border-left-color: var(--red);
    background: var(--red-dim);
    color: var(--text);
}

.upload-sidebar-item.done {
    color: #2ea043;
}

.upload-sidebar-item.done .upload-sidebar-num {
    background: #2ea043;
    border-color: #2ea043;
    color: #fff;
}

.upload-sidebar-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    font-size: .7rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: background .15s, border-color .15s, color .15s;
}

.upload-sidebar-item.active .upload-sidebar-num {
    border-color: var(--red);
    background: var(--red);
    color: #fff;
}

.upload-sidebar-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-sidebar-header {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    padding: 12px 12px 4px;
    list-style: none;
}

.upload-sidebar-header:first-child {
    padding-top: 0;
}

/* Main wizard area */

.upload-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.upload-guide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
}

/* iPhone mockup frame */

.phone-mockup {
    position: relative;
    width: 160px;
    flex-shrink: 0;
    background: #1a1a1a;
    border: 2.5px solid #3a3a3a;
    border-radius: 32px;
    padding: 14px 8px 16px;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.05),
        0 12px 40px rgba(0,0,0,.6),
        inset 0 1px 0 rgba(255,255,255,.08);
}

.phone-notch {
    width: 44px;
    height: 12px;
    background: #1a1a1a;
    border-radius: 12px;
    margin: 0 auto 8px;
    border: 1px solid #333;
    position: relative;
}

.phone-notch::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #111;
    border: 1px solid #3a3a3a;
    top: 2.5px;
    right: 8px;
}

.phone-screen {
    border-radius: 18px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 9 / 19.5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-screen img {
    width: 100%;
    height: auto;
    display: block;
}

.phone-home-bar {
    width: 38%;
    height: 4px;
    background: #555;
    border-radius: 2px;
    margin: 10px auto 0;
}

.upload-guide svg {
    max-width: 200px;
    height: auto;
}

.upload-guide-img {
    max-width: 200px;
    max-height: 400px;
    height: auto;
    border-radius: 8px;
}

.upload-guide-fallback {
    text-align: center;
    color: var(--text-muted);
    font-size: .9rem;
    padding: 40px 20px;
}

.upload-instructions {
    background: var(--red-dim);
    border: 1px solid rgba(232, 33, 39, .25);
    border-radius: var(--radius);
    padding: 14px 18px;
}

.upload-instructions-title {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.upload-instructions-steps {
    list-style: none;
    counter-reset: step;
}

.upload-instructions-steps li {
    counter-increment: step;
    font-size: .8rem;
    color: var(--text-muted);
    padding: 3px 0 3px 24px;
    position: relative;
    line-height: 1.5;
}

.upload-instructions-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(232, 33, 39, .2);
    color: var(--red);
    font-size: .65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 4px;
}

.upload-dropzone-area {
    min-height: 100px;
}

/* Wizard nav */

.upload-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.upload-nav-btn {
    width: auto;
    min-width: 100px;
    margin-top: 0;
}

.upload-nav-indicator {
    font-size: .8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Dropzone */

.upload-dropzone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 6px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--red);
    background: var(--red-dim);
}

.upload-dropzone.filled {
    border-style: solid;
    border-color: #2ea043;
    cursor: default;
}

.upload-dropzone-empty {
    text-align: center;
    padding: 8px;
    width: 100%;
}

.upload-reference {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    margin-bottom: 6px;
    opacity: .45;
    background: repeating-conic-gradient(#333 0% 25%, #222 0% 50%) 50% / 10px 10px;
    transition: opacity .2s;
}

.upload-dropzone:hover .upload-reference {
    opacity: .65;
}

.upload-dropzone-icon {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.upload-dropzone-text {
    font-size: .65rem;
    color: var(--text-disabled);
}

/* Thumbnail preview */

.upload-thumb-wrap {
    position: relative;
    width: 100%;
    padding: 4px;
}

.upload-thumb {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    background: repeating-conic-gradient(#333 0% 25%, #222 0% 50%) 50% / 12px 12px;
}

.upload-remove {
    position: absolute;
    top: 0;
    right: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    border: none;
    font-size: .7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .15s;
}

.upload-thumb-wrap:hover .upload-remove {
    opacity: 1;
}

/* Upload progress */

.upload-progress {
    margin-top: 16px;
    margin-bottom: 16px;
}

.upload-progress-text {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-align: center;
}

.upload-progress-track {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: var(--red);
    border-radius: 3px;
    width: 0%;
    transition: width .3s;
}

/* Success notice */

.notice-success {
    background: rgba(46, 160, 67, .1);
    border: 1px solid rgba(46, 160, 67, .3);
    text-align: center;
}

/* Mobile */

@media (max-width: 768px) {
    .upload-wizard {
        flex-direction: column;
        gap: 16px;
    }

    .upload-sidebar {
        width: 100%;
    }

    .upload-sidebar-list {
        flex-direction: row;
        gap: 4px;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .upload-sidebar-item {
        flex-shrink: 0;
        padding: 6px 10px;
        border-left: none;
        border-bottom: 3px solid transparent;
        border-radius: 6px 6px 0 0;
        font-size: .75rem;
    }

    .upload-sidebar-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--red);
    }

    .upload-sidebar-header {
        flex-shrink: 0;
        padding: 6px 8px;
        display: flex;
        align-items: center;
        font-size: .65rem;
    }

    .upload-sidebar-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px 16px 40px;
    }

    .step {
        padding: 22px 18px;
    }

    .stepper-label {
        font-size: .7rem;
    }

    .stepper-divider {
        width: 20px;
        margin: 0 6px;
    }

    .upload-guide {
        padding: 12px;
    }

    .upload-instructions {
        padding: 10px 14px;
    }

    .upload-nav-btn {
        min-width: 80px;
    }
}

/* ── Stagger animations ───────────────────────────────────────── */

@keyframes stagger-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes stagger-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

@keyframes phone-in {
    from {
        opacity: 0;
        transform: scale(.92) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.stagger-in {
    animation: stagger-in .35s cubic-bezier(.22, .61, .36, 1) both;
}

.stagger-out {
    animation: stagger-out .2s cubic-bezier(.55, .06, .68, .19) both;
}

.phone-animate-in {
    animation: phone-in .4s cubic-bezier(.22, .61, .36, 1) both;
}

/* Step-level stagger: children animate in sequence */
.step.stagger-children > .step-title       { animation-delay: 0ms; }
.step.stagger-children > .step-desc        { animation-delay: 50ms; }
.step.stagger-children > .form-group:nth-child(3) { animation-delay: 100ms; }
.step.stagger-children > .form-group:nth-child(4) { animation-delay: 150ms; }
.step.stagger-children > .form-group:nth-child(5) { animation-delay: 200ms; }
.step.stagger-children > .notice           { animation-delay: 100ms; }
.step.stagger-children > .upload-counter   { animation-delay: 80ms; }
.step.stagger-children > .upload-wizard    { animation-delay: 120ms; }
.step.stagger-children > .btn              { animation-delay: 250ms; }

.step.stagger-children > * {
    animation: stagger-in .35s cubic-bezier(.22, .61, .36, 1) both;
}

/* Upload wizard content stagger */
.upload-main.stagger-content > .upload-guide        { animation-delay: 0ms; }
.upload-main.stagger-content > .upload-instructions  { animation-delay: 80ms; }
.upload-main.stagger-content > .upload-dropzone-area { animation-delay: 140ms; }
.upload-main.stagger-content > .upload-nav           { animation-delay: 180ms; }

.upload-main.stagger-content > * {
    animation: stagger-in .3s cubic-bezier(.22, .61, .36, 1) both;
}

/* ── Preview modal ──────────────────────────────────────────── */

.preview-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, .85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: preview-fade-in .25s ease both;
}

.preview-modal[hidden] {
    display: none;
}

@keyframes preview-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.preview-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: preview-slide-in .3s cubic-bezier(.22, .61, .36, 1) both;
}

@keyframes preview-slide-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.preview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}

.preview-close:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.preview-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* Mode toggle (offcharge / oncharge) */

.preview-mode-toggle {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 16px;
}

.preview-mode-btn {
    flex: 1;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.preview-mode-btn:hover {
    color: var(--text);
}

.preview-mode-btn.active {
    background: var(--red);
    color: #fff;
}

/* Car image compositing area */

.preview-car {
    position: relative;
    width: 100%;
    aspect-ratio: 417 / 262;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

.preview-car img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Toggle control buttons */

.preview-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.preview-toggle {
    padding: 7px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    user-select: none;
}

.preview-toggle:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.preview-toggle.active {
    background: var(--red-dim);
    border-color: var(--red);
    color: var(--red);
}

.preview-toggle:disabled {
    opacity: .3;
    cursor: not-allowed;
}

/* ── Upload actions row ─────────────────────────────────────── */

.upload-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.upload-actions .btn {
    flex: 1;
}

/* ── Verify results ────────────────────────────────────────── */

.verify-results {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    background: var(--bg-input);
}

.verify-item {
    font-size: .875rem;
    padding: 6px 0;
}

.verify-item + .verify-item {
    border-top: 1px solid var(--border);
}

.verify-item--pass {
    color: #4caf50;
}

.verify-item--warn {
    color: #ffa726;
}

.verify-item-list {
    margin: 6px 0 0 20px;
    font-size: .8rem;
    color: var(--text-muted);
    list-style: disc;
}

.verify-item-list li {
    padding: 1px 0;
}

/* ── Contributor modal ─────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn .2s ease;
}

.modal-overlay[hidden] {
    display: none;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    max-width: 420px;
    width: 100%;
    animation: modalSlideIn .25s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.modal-desc {
    font-size: .875rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
}

/* Checkbox */

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .9rem;
    cursor: pointer;
    padding: 10px 0;
    user-select: none;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--red);
    cursor: pointer;
    flex-shrink: 0;
}

/* Contributor fields */

.contributor-fields {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.contributor-type-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.radio-pill {
    display: flex;
    cursor: pointer;
    user-select: none;
}

.radio-pill input {
    display: none;
}

.radio-pill span {
    padding: 6px 14px;
    font-size: .8rem;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    background: var(--bg-input);
    transition: all .15s;
}

.radio-pill input:checked + span {
    background: var(--red-dim);
    border-color: var(--red);
    color: var(--red);
}

.radio-pill:hover span {
    background: var(--bg-hover);
    color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
    .stagger-in,
    .stagger-out,
    .phone-animate-in,
    .step.stagger-children > *,
    .upload-main.stagger-content > *,
    .preview-modal,
    .preview-modal-content,
    .modal-overlay,
    .modal-box {
        animation: none !important;
    }
}
