@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&display=swap");

:root {
    --bg: #09111f;
    --bg-alt: #0f1d33;
    --surface: rgba(12, 19, 35, 0.72);
    --surface-solid: #12203a;
    --surface-light: rgba(255, 255, 255, 0.08);
    --stroke: rgba(255, 255, 255, 0.14);
    --text: #f6f7fb;
    --text-muted: #b5bed0;
    --accent: #ff8b55;
    --accent-strong: #ff6a2e;
    --success: #43c38c;
    --warning: #ffc369;
    --danger: #ff7272;
    --shadow: 0 22px 60px rgba(3, 7, 18, 0.35);
    --radius-xl: 32px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --container: 1280px;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100dvh;
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 139, 85, 0.22), transparent 28%),
        radial-gradient(circle at top right, rgba(94, 154, 255, 0.18), transparent 26%),
        linear-gradient(180deg, #09111f 0%, #10172b 40%, #0b1324 100%);
}

img,
video {
    display: block;
    max-width: 100%;
}

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

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

.page-operator,
.page-screen,
.page-print {
    min-height: 100dvh;
}

.operator-page {
    width: min(calc(100% - 32px), var(--container));
    margin: 0 auto;
    padding: 18px 0 32px;
}

.hero-card,
.panel,
.screen-caption,
.screen-brand,
.print-toolbar {
    backdrop-filter: blur(18px);
    background: var(--surface);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow);
}

.hero-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-xl);
    margin-bottom: 12px;
}

.hero-copy h1,
.panel-header h2,
.screen-empty h1,
.print-toolbar h1 {
    margin: 8px 0 12px;
    line-height: 1.05;
}

.hero-copy h1 {
    font-size: clamp(1.5rem, 2vw, 2.4rem);
    margin: 4px 0 6px;
}

.hero-copy p,
.panel-header p,
.status-card p,
.screen-empty p,
.screen-caption p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.45;
}

.hero-copy {
    max-width: 700px;
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 0.94rem;
    font-weight: 700;
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.hero-link:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 139, 85, 0.55);
    background: rgba(255, 139, 85, 0.12);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    justify-content: flex-end;
    max-width: 340px;
}

.eyebrow,
.meta-chip,
.screen-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.operator-grid,
.preview-grid {
    display: grid;
    gap: 22px;
}

.operator-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    margin-bottom: 22px;
}

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

.panel {
    border-radius: var(--radius-xl);
    padding: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.panel-header h2 {
    font-size: 1.35rem;
}

.camera-stage {
    position: relative;
    min-height: 460px;
    border-radius: 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(255, 139, 85, 0.15), transparent 40%),
        linear-gradient(180deg, rgba(8, 11, 20, 0.9), rgba(18, 32, 58, 0.84));
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.camera-stage video {
    width: 100%;
    height: 100%;
    min-height: 460px;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 28px;
    box-shadow: inset 0 0 0 1px rgba(255, 139, 85, 0.2);
}

.camera-actions,
.print-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.button {
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 180ms ease, opacity 180ms ease, background-color 180ms ease;
    font-weight: 700;
}

.button:hover {
    transform: translateY(-1px);
}

.button:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
    outline: 3px solid rgba(255, 139, 85, 0.42);
    outline-offset: 2px;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.button.primary,
.button.accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: white;
}

.button.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.button.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.button.wide {
    width: 100%;
}

.file-label {
    display: inline-block;
    margin: 18px 0 8px;
    color: var(--text-muted);
}

.file-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
}

.job-form {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-weight: 700;
}

.field input,
.field select,
.field textarea {
    min-height: 54px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.field select {
    background-color: #20243a;
    color: #f6f7fb;
}

.field textarea {
    min-height: 120px;
    padding: 14px 16px;
    resize: vertical;
    line-height: 1.45;
}

.field select option {
    background-color: #1b2032;
    color: #f6f7fb;
}

.field select option:checked {
    background-color: #2c3658;
    color: #ffffff;
}

.field-hint {
    color: var(--text-muted);
    line-height: 1.4;
    font-size: 0.9rem;
}

.status-card {
    margin-top: 22px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.status-head h3 {
    margin: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.status-badge.neutral {
    background: rgba(255, 255, 255, 0.1);
}

.status-badge.queued,
.status-badge.generating,
.status-badge.face_swap,
.status-badge.composing_print {
    background: rgba(255, 195, 105, 0.16);
    color: var(--warning);
}

.status-badge.done {
    background: rgba(67, 195, 140, 0.16);
    color: var(--success);
}

.status-badge.failed {
    background: rgba(255, 114, 114, 0.16);
    color: var(--danger);
}

.job-id {
    margin: 12px 0 18px;
    font-size: 0.92rem;
}

.preview-panel {
    min-height: 430px;
}

.preview-frame {
    position: relative;
    min-height: 330px;
    border-radius: 24px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)),
        rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-frame img {
    width: 100%;
    height: 100%;
    min-height: 330px;
    object-fit: cover;
    display: none;
}

.placeholder-card {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    color: var(--text-muted);
    text-align: center;
}

.screen-page {
    position: relative;
    overflow: hidden;
    background: #050914;
}

.screen-stage {
    position: relative;
    min-height: 100dvh;
    width: 100vw;
    overflow: hidden;
}

.screen-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 15%, rgba(255, 139, 85, 0.25), transparent 26%),
        radial-gradient(circle at 85% 20%, rgba(94, 154, 255, 0.22), transparent 28%),
        linear-gradient(180deg, #08111f 0%, #0c1730 50%, #09111f 100%);
}

.slide-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 300ms ease;
}

.slide-image.visible {
    opacity: 1;
}

.screen-empty,
.screen-caption,
.screen-brand {
    position: relative;
    z-index: 2;
}

.screen-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    max-width: 760px;
    margin: auto;
    padding: 28px;
}

.screen-empty h1 {
    font-size: clamp(2.6rem, 5vw, 5rem);
}

.screen-fullscreen-button {
    margin: 20px auto 0;
    min-height: 54px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.screen-caption {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    display: grid;
    gap: 12px;
    padding: 22px 24px;
    border-radius: 30px;
}

.screen-caption h2 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
}

.screen-brand {
    position: absolute;
    left: 50%;
    top: 24px;
    transform: translateX(-50%);
    min-height: 64px;
    padding: 0 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.print-page {
    min-height: 100dvh;
    padding: 24px;
    background: #f2eee6;
    color: #1b2335;
}

.print-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 20px 24px;
    border-radius: 26px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.78);
    color: #1b2335;
}

.print-toolbar h1 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.print-sheet {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
    border-radius: 24px;
    background: white;
    box-shadow: 0 24px 80px rgba(24, 30, 48, 0.15);
}

.print-sheet img {
    width: 100%;
    height: auto;
    border-radius: 18px;
}

@media (max-width: 1024px) {
    .operator-grid,
    .preview-grid {
        grid-template-columns: 1fr;
    }

    .hero-card,
    .print-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .operator-page {
        width: min(calc(100% - 20px), var(--container));
        padding: 12px 0 20px;
    }

    .hero-card,
    .panel,
    .screen-caption {
        padding: 16px;
    }

    .camera-stage,
    .camera-stage video {
        min-height: 320px;
    }

    .screen-stage {
        min-height: 100dvh;
    }

    .screen-caption {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }

    .screen-brand {
        top: 20px;
        max-width: calc(100% - 40px);
        text-align: center;
    }
}

@media print {
    body {
        background: white;
    }

    .no-print {
        display: none !important;
    }

    .print-page {
        padding: 0;
        background: white;
    }

    .print-sheet {
        max-width: none;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }
}
