/* ==========================================================================
   Fonts
   ========================================================================== */

@font-face {
    font-family: "Geist";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/geist-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Geist";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/geist-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Base
   ========================================================================== */

:root {
    --bg: #0e0a08;
    --surface: #0f0f11;
    --accent: #00c0e8;
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.5);
    --line: rgba(255, 255, 255, 0.8);
    --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --page-width: 960px;
    color-scheme: dark;
}

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

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
}

button,
input {
    font-family: inherit;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 56px;
    margin: 32px 32px 0;
    padding: 0 40px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    background: var(--surface);
    text-align: left;
}

.brand {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text);
    text-decoration: none;
}

.brand-logo {
    display: block;
    flex: 0 0 auto;
    width: 29px;
    height: 44px;
}

.brand-name {
    font-size: 21px;
    font-weight: 500;
    line-height: 1;
}

.header-contact {
    display: flex;
    align-items: center;
    gap: 24px;
    color: var(--accent);
    font-size: 16px;
    line-height: 1;
    text-decoration: none;
}

.contact-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    top: 2px;
    color: inherit;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.contact-cta:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.contact-cta:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 6px;
    border-radius: 4px;
}

.contact-mail {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    white-space: nowrap;
}

.contact-mail-text {
    position: relative;
    top: 2px;
}

.contact-mail-icon {
    display: block;
    flex: 0 0 auto;
}

/* ==========================================================================
   Page 1: hero, process illustration, upload dropzone
   ========================================================================== */

#upload-step {
    width: min(var(--page-width), calc(100% - 40px));
    margin-right: auto;
    margin-left: auto;
}

#upload-step {
    padding-bottom: 24px;
}

.hero-title {
    margin: 0;
    padding-top: 83px;
    font-size: 48px;
    font-weight: 400;
    line-height: 58px;
}

.hero-title .accent {
    color: var(--accent);
}

.process-row {
    --arrow-width: 63px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 25px;
    margin-top: 67px;
}

.process-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 7 / 5;
    object-fit: cover;
    border-radius: 8px;
}

.process-arrow {
    display: block;
    width: var(--arrow-width);
    height: auto;
    overflow: visible;
    fill: none;
    stroke: var(--text);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

#upload-box {
    width: 100%;
    margin-top: 62px;
}

.upload-tile-wrapper {
    position: relative;
}

.upload-tile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    height: 208px;
    min-height: 208px;
    padding: 56px 24px 24px;
    border-radius: 18px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.15s ease;
}

.upload-border {
    position: absolute;
    top: 0.5px;
    left: 0.5px;
    width: calc(100% - 1px);
    height: calc(100% - 1px);
    z-index: 1;
    overflow: visible;
    pointer-events: none;
}

.upload-border rect {
    fill: none;
    stroke: var(--line);
    stroke-width: 1;
    stroke-dasharray: 6.7 5.3;
    transition: stroke 0.15s ease;
}

.upload-tile-wrapper:has(.upload-tile:hover) .upload-border rect {
    stroke: var(--text);
}

.upload-tile.is-dragover {
    background: rgba(0, 192, 232, 0.08);
}

.upload-tile-wrapper:has(.upload-tile.is-dragover) .upload-border rect {
    stroke: var(--accent);
}

.upload-tile:has(.upload-file-input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.upload-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.upload-mark {
    display: block;
    flex: 0 0 auto;
    color: var(--accent);
    line-height: 0;
}

.upload-cloud {
    display: block;
    width: 55px;
    height: 35px;
}

.upload-tile-copy {
    display: flex;
    min-width: 0;
    max-width: 100%;
    flex-direction: column;
    align-items: center;
}

.upload-default-copy {
    margin-top: 31px;
}

.upload-prompt {
    font-size: 15px;
    line-height: 1.3;
}

.upload-prompt-mobile {
    display: none;
}

.upload-prompt strong {
    font-weight: 600;
}

.upload-link {
    margin-left: 4px;
    color: var(--accent);
    font-size: 14.5px;
}

.upload-hint {
    margin-top: 10px;
    color: #5c5f62;
    font-size: 12.2px;
    line-height: 1.3;
    white-space: pre-wrap;
}

.upload-selected-copy {
    gap: 6px;
}

.upload-tile:not(.has-image) .upload-selected-card,
.upload-tile.has-image .upload-default-copy {
    display: none;
}

.upload-tile.has-image {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 42px 39px 31px 26px;
    text-align: left;
}

.upload-selected-card {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 124px;
    align-items: center;
    gap: 24px;
    padding: 20px 22px;
    border: 2px solid #68686a;
    border-radius: 12px;
    background: #19191b;
}

.upload-tile.has-image .upload-selected-copy {
    align-items: flex-start;
}

.upload-selected-copy strong {
    max-width: 100%;
    color: var(--accent);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.upload-file-meta {
    display: flex;
    max-width: 100%;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 10px;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

#uploadFileName {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-tile.has-image .upload-hint {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 13px;
}

.upload-preview {
    display: block;
    flex: 0 0 74px;
    width: 74px;
    max-width: 74px;
    height: 74px;
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}

.upload-clear-button {
    position: absolute;
    z-index: 1;
    top: 32px;
    right: 26px;
    display: grid;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #dedede;
    color: #171719;
    font-size: 20px;
    line-height: 1;
}

.upload-clear-button:hover:not(:disabled) {
    background: #fff;
    filter: none;
}

/* ==========================================================================
   Buttons, status, progress
   ========================================================================== */

button {
    margin: 6px;
    padding: 14px 28px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--accent);
    color: #0e0a08;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    transition: filter 0.15s ease, background-color 0.15s ease;
}

button:hover:not(:disabled) {
    filter: brightness(1.1);
}

button:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
}

button.secondary {
    border-color: var(--line);
    background: transparent;
    color: var(--text);
}

button.secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    filter: none;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

#exampleBtn[hidden] {
    display: none;
}

#upload-box > button {
    margin: 24px 6px 0;
}

#upload-box > #btn {
    display: inline-flex;
    min-height: 37px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 9px 11px;
    border-radius: 11px;
    background: #f4f4f4;
    color: #171719;
    font-size: 14px;
    font-weight: 500;
}

#upload-box:not(:has(.upload-tile.has-image)) #btn {
    display: none;
}

#btn {
    scroll-margin-bottom: 120px;
}

#status {
    margin-top: 20px;
    font-weight: 500;
}

/* ==========================================================================
   Page 2: generating and model preview
   ========================================================================== */

#preview-step {
    position: relative;
    --viewer-bleed: clamp(0px, calc((100vw - min(1076px, 100vw - 80px)) / 2 - 24px), 280px);
    display: grid;
    grid-template-columns: minmax(300px, 29.6%) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
        "sidebar main"
        "footer footer";
    column-gap: 7.4%;
    align-items: start;
    width: min(1076px, calc(100% - 80px));
    flex: 1 0 auto;
    margin: 0 auto;
    padding: 30px 0 24px;
    text-align: left;
}

.preview-back {
    position: absolute;
    top: 30px;
    left: 0;
    z-index: 3;
    margin: 0;
}

.preview-sidebar {
    display: flex;
    align-self: center;
    grid-area: sidebar;
    flex-direction: column;
    justify-content: center;
}

.preview-title {
    margin: 0 0 34px;
    font-size: clamp(22px, 2.15vw, 31px);
    font-weight: 400;
    line-height: 40px;
    outline: none;
    text-align: center;
    white-space: nowrap;
}

.photo-card {
    position: relative;
    z-index: 2;
    padding: 16px;
    border: 1px solid #585858;
    border-radius: 8px;
    background: #171718;
    text-align: center;
}

.photo-card-meta,
.photo-card-hint {
    margin: 0;
    font-size: 11px;
    line-height: 17px;
    overflow-wrap: anywhere;
}

.photo-card-meta {
    color: #f1f0ed;
    font-size: 11.5px;
}

.photo-card-meta span + span {
    margin-left: 6px;
}

.photo-card-hint {
    margin-top: 4px;
    color: var(--text-muted);
}

.photo-card-hint-mobile {
    display: none;
}

.photo-card-image {
    display: block;
    width: 100%;
    margin: 8px 0 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 2px;
    background: #fff;
    line-height: 0;
}

.photo-card-image:disabled {
    cursor: default;
    opacity: 1;
}

.photo-card-image:not(:disabled) {
    cursor: pointer;
}

.photo-card-image.is-dragover {
    outline: 2px dashed var(--text-muted);
    outline-offset: -2px;
}

.photo-card-image img {
    pointer-events: none;
    display: block;
    width: 100%;
    height: auto;
    max-height: 390px;
    object-fit: contain;
}

.photo-card-close {
    position: absolute;
    top: -12px;
    right: -12px;
    display: grid;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f2f2f2;
    color: #161616;
    line-height: 0;
}

.preview-main {
    position: relative;
    grid-area: main;
    align-self: stretch;
    min-width: 0;
    margin-top: 0;
}

/* Taken out of the flow so the stage height, and thus the photo card position, is the same in both modes. */
.generation-progress {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
}

.preview-stage {
    position: relative;
    height: 100%;
    min-height: clamp(340px, 58svh, 560px);
}

.generation-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

/* Same reach as the print preview on the next page: fills the stage and bleeds into the right margin and down. */
#preview-model-container {
    position: absolute;
    inset: 0 calc(-1 * var(--viewer-bleed)) -20px 0;
    max-height: 800px;
    overflow: hidden;
}

#preview-model-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#preview-model-message {
    position: absolute;
    top: 50%;
    left: 50%;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 12px;
    pointer-events: none;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    z-index: 1;
}

#preview-model-message[hidden] {
    display: none;
}

.generation-status {
    margin: 33px 0 0;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
}

.progress-container {
    position: relative;
    width: 100%;
    height: 12px;
    margin-top: 9px;
    overflow: hidden;
    border-radius: 3px;
    background: #f2f2f2;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--accent);
    transition: width 0.6s ease;
}

.progress-label {
    position: absolute;
    top: 0;
    right: 7px;
    display: flex;
    height: 100%;
    align-items: center;
    color: #111;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.link-button {
    display: block;
    margin: 15px auto 0;
    padding: 4px 10px;
    border: 0;
    border-radius: 4px;
    background: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
}

.link-button:hover:not(:disabled) {
    color: var(--text);
    filter: none;
}

.preview-footer {
    grid-area: footer;
    min-height: 73px;
    margin-top: 44px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 21px;
}

.preview-continue-mobile {
    display: none;
}

.preview-actions button,
.slice-actions button {
    display: inline-flex;
    min-height: 31px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    padding: 6px 10px;
    border: 0;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.2;
}

#regenerateBtn {
    background: #141414;
    color: var(--text);
}

#regenerateBtn:hover:not(:disabled) {
    background: #1f1f21;
    filter: none;
}

#continueBtn,
#continueToOrderBtn,
#retrySliceBtn {
    background: #f2f2f2;
    color: #151515;
}

.preview-note {
    margin: 24px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 16px;
    text-align: center;
}

.preview-note:empty {
    display: none;
}

#preview-step[data-mode="generating"] #preview-model-container,
#preview-step[data-mode="generating"] .preview-footer {
    visibility: hidden;
}

#preview-step[data-mode="ready"] .generation-canvas,
#preview-step[data-mode="ready"] .generation-progress {
    display: none;
}

/* Without the photo card (after a reload, or the example model) the content is centred. */
#preview-step:has(.photo-card[hidden]) {
    grid-template-columns: minmax(0, 568px);
    grid-template-areas:
        "sidebar"
        "main"
        "footer";
    grid-template-rows: auto auto auto;
    align-content: center;
    justify-content: center;
}

#preview-step:has(.photo-card[hidden]) .preview-sidebar {
    align-items: center;
}

#preview-step:has(.photo-card[hidden]) .preview-actions {
    justify-content: center;
}

@media (max-width: 720px) {
    .photo-card-hint-desktop {
        display: none;
    }

    .photo-card-hint-mobile {
        display: inline;
    }

    #preview-step {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto;
        grid-template-areas:
            "back"
            "title"
            "main"
            "footer"
            "card";
        width: calc(100% - 32px);
            padding: 24px 0;
    }

    .generation-progress {
        position: static;
    }

    .preview-back {
        position: static;
        grid-area: back;
        margin-bottom: 22px;
    }

    .preview-sidebar {
            display: contents;
    }

    .preview-title {
            grid-area: title;
            margin-bottom: 16px;
            font-size: 26px;
            line-height: 34px;
            white-space: normal;
    }

    #preview-step:has(.photo-card[hidden]) {
            grid-template-areas:
                "back"
                "title"
                "main"
                "footer";
            grid-template-rows: auto auto auto auto;
    }

    .photo-card {
            grid-area: card;
    }

    .preview-main {
            grid-area: main;
            margin-top: 0;
    }

    #preview-model-container {
        inset: 0;
    }

    .preview-stage {
        height: clamp(240px, 44svh, 380px);
        aspect-ratio: auto;
        min-height: 0;
    }

    #preview-step[data-mode="ready"] {
        flex: 1 0 auto;
        grid-template-rows: auto auto minmax(clamp(240px, 44svh, 380px), 1fr) auto auto;
    }

    #preview-step[data-mode="ready"]:has(.photo-card[hidden]) {
        grid-template-rows: auto auto minmax(clamp(240px, 44svh, 380px), 1fr) auto;
    }

    #preview-step[data-mode="ready"] .preview-main {
        display: flex;
        min-height: 0;
        flex-direction: column;
    }

    #preview-step[data-mode="ready"] .preview-stage {
        flex: 1;
        height: auto;
    }

    #preview-step[data-mode="ready"] #preview-model-container {
        max-height: none;
    }

    .photo-card:not([hidden]) {
        display: grid;
        width: 100%;
        max-width: 380px;
        grid-template-columns: clamp(104px, 30vw, 128px) minmax(0, 1fr);
        grid-template-rows: auto auto;
        grid-template-areas:
            "image meta"
            "image hint";
        align-items: center;
        gap: 5px 12px;
        margin: 20px auto 0;
        padding: 12px;
        text-align: left;
    }

    .photo-card-meta {
        display: flex;
        grid-area: meta;
        flex-wrap: wrap;
        gap: 4px 8px;
        align-self: end;
    }

    .photo-card-meta span + span {
        margin-left: 0;
    }

    .photo-card-hint {
        grid-area: hint;
        align-self: start;
        margin-top: 0;
    }

    .photo-card-image {
        width: 100%;
        height: clamp(88px, 24vw, 104px);
        grid-area: image;
        margin: 0;
    }

    .photo-card-image img {
        height: 100%;
        max-height: none;
        object-fit: contain;
    }

    .preview-footer {
        min-height: 0;
        margin-top: 0;
        padding-top: 16px;
        border-top: 0;
    }

    .preview-actions {
        flex-direction: row;
        gap: 8px;
        margin-top: 0;
    }

    .preview-actions button {
        flex: 1;
        min-width: 0;
        min-height: 40px;
        gap: 6px;
        padding: 6px 8px;
    }

    .preview-actions button svg {
        flex: 0 0 auto;
        width: 20px;
        height: 20px;
    }

    .preview-continue-desktop {
        display: none;
    }

    .preview-continue-mobile {
        display: inline;
    }

    .preview-note {
        margin-top: 18px;
    }
}

/* ==========================================================================
   Page 3: print parameters
   ========================================================================== */

#slice-step {
    --slice-line: rgba(255, 255, 255, 0.25);
    --slice-field-border: rgba(255, 255, 255, 0.25);
    /* How far the print preview reaches into the free page margin on the right, keeping a 24px gutter. */
    --viewer-bleed: clamp(0px, calc((100vw - min(1076px, 100vw - 80px)) / 2 - 24px), 280px);
    display: grid;
    flex: 1 0 auto;
    grid-template-columns: minmax(300px, 29.6%) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
        "back viewer"
        "title viewer"
        "options viewer"
        "footer footer";
    column-gap: 7.4%;
    align-content: start;
    width: min(1076px, calc(100% - 80px));
    margin: 0 auto;
    padding: 30px 0 24px;
    text-align: left;
}

.back-link {
    display: inline-flex;
    grid-area: back;
    align-items: center;
    gap: 8px;
    justify-self: start;
    margin: 0 0 22px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
    line-height: 16px;
}

.back-link:hover:not(:disabled) {
    color: var(--text);
    filter: none;
}

.slice-title {
    grid-area: title;
    margin: 0 0 44px;
    font-size: clamp(22px, 2.4vw, 33px);
    font-weight: 400;
    line-height: 40px;
    outline: none;
    text-align: center;
}

.slice-options {
    grid-area: options;
    min-width: 0;
}

.slice-option {
    min-width: 0;
}

.slice-option-rule {
    padding-bottom: 15px;
    border-bottom: 1px solid var(--slice-line);
}

.slice-option-after-rule {
    padding-top: 18px;
}

.slice-option-stacked {
    padding-top: 14px;
}

.slice-option-heading {
    display: flex;
    min-height: 22px;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px;
    color: #f2f2f2;
    font-size: 12px;
    line-height: 17px;
}

.slice-option-value {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 11px;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.quantity-control button,
.quantity-control input {
    width: 40px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 1px solid #585858;
    border-radius: 8px;
    background: #171718;
    color: var(--text);
    font-size: 16px;
    text-align: center;
}

.quantity-control input {
    width: 64px;
    appearance: textfield;
    -moz-appearance: textfield;
}

.quantity-control input::-webkit-inner-spin-button,
.quantity-control input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.quantity-control input:disabled {
    opacity: 0.5;
}

.slice-option-status {
    display: block;
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 16px;
}

.slice-option-status:empty {
    margin: 0;
}

.info-wrap {
    position: relative;
    display: inline-flex;
}

.info-button {
    display: grid;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #f2f2f2;
    line-height: 0;
}

.info-button:hover:not(:disabled) {
    color: var(--accent);
    filter: none;
}

.info-button[aria-expanded="true"],
.info-button[aria-expanded="true"]:hover:not(:disabled) {
    background: #242424;
    color: var(--accent);
}

.info-popover {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    z-index: 20;
    width: 272px;
    max-width: calc(100vw - 24px);
    padding: 16px;
    border: 1px solid #585858;
    border-radius: 8px;
    background: #171718;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.info-popover.is-below {
    top: calc(100% + 6px);
    bottom: auto;
}

.info-popover strong {
    display: block;
    margin: 0 0 10px;
    color: #f2f2f2;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
}

.info-popover p {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.7;
}

.model-color-swatches {
    display: grid;
    grid-template-columns: repeat(7, 28px);
    gap: 12px 9px;
}

.model-color-swatch {
    position: relative;
    display: block;
    width: 28px;
    height: 28px;
    cursor: pointer;
}

.model-color-swatch input,
.slice-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.model-color-swatch span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--swatch-color);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    transition: box-shadow 0.15s ease;
}

.model-color-swatch:hover input:not(:disabled) + span {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 0 0 2px var(--bg), 0 0 0 4px rgba(255, 255, 255, 0.35);
}

.model-color-swatch input:checked + span {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 0 0 2px var(--bg), 0 0 0 4px #f2f2f2;
}

.model-color-swatch input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 6px;
}

.model-color-swatch input:disabled + span {
    cursor: not-allowed;
    opacity: 0.5;
}

.slice-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.slice-choice {
    position: relative;
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border: 1px solid var(--slice-field-border);
    border-radius: 7px;
    color: #f2f2f2;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    transition: border-color 0.15s ease;
}

.slice-choice:hover:has(input:not(:disabled)) {
    border-color: rgba(255, 255, 255, 0.55);
}

.slice-choice:has(input:checked) {
    border-color: #f2f2f2;
    box-shadow: inset 0 0 0 1px #f2f2f2;
}

.slice-choice:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.slice-choice:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.5;
}

.size-slider {
    --value: 0;
    --track: linear-gradient(
        to right,
        var(--accent) calc(7px + (100% - 14px) * var(--value)),
        #3b3b3b calc(7px + (100% - 14px) * var(--value))
    );
    display: block;
    width: 100%;
    height: 20px;
    margin: 0 0 4px;
    padding: 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.size-slider::-webkit-slider-runnable-track {
    height: 7px;
    border-radius: 4px;
    background: var(--track);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.size-slider::-moz-range-track {
    height: 7px;
    border-radius: 4px;
    background: var(--track);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.size-slider::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    margin-top: -3.5px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    -webkit-appearance: none;
    appearance: none;
}

.size-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
}

.size-slider:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.size-slider:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* The slot keeps the preview's place in the layout. The preview itself fills the slot and reaches past it
   to the right and down, so it can be larger without moving any other element. */
.slice-viewer {
    position: relative;
    grid-area: viewer;
    min-width: 0;
    min-height: clamp(340px, 58svh, 560px);
}

#print-volume-viewer {
    position: absolute;
    inset: 0 calc(-1 * var(--viewer-bleed)) -20px 0;
    max-height: 800px;
    overflow: hidden;
}

#print-volume-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.build-volume-dimension {
    display: none;
}

.viewer-controls-hint {
    left: 8px;
    border: 1px solid var(--slice-field-border, rgba(255, 255, 255, 0.25));
    border-radius: 8px;
    background: #050d0b;
    pointer-events: none;
}

.viewer-controls-hint {
    position: absolute;
    bottom: 8px;
    display: flex;
    gap: 16px;
    padding: 9px 13px;
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 15px;
}

.viewer-controls-hint span {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.viewer-controls-hint .viewer-control-touch {
    display: none;
}

.viewer-controls-hint svg {
    flex-shrink: 0;
    color: #f2f2f2;
}

#order-viewer .viewer-controls-hint {
    display: none;
}

@media (hover: none) and (pointer: coarse) {
    .viewer-controls-hint {
        gap: 10px;
        padding: 8px 10px;
    }

    .viewer-controls-hint .viewer-control-mouse {
        display: none;
    }

    .viewer-controls-hint .viewer-control-touch {
        display: flex;
    }
}

.model-dimension-inputs {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 12px;
}

.model-dimension-inputs input {
    width: 56px;
    min-width: 0;
    padding: 6px 2px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
}

.model-dimension-inputs input::-webkit-inner-spin-button,
.model-dimension-inputs input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.model-dimension-inputs input:hover:not(:disabled),
.model-dimension-inputs input:focus-visible {
    border-color: var(--slice-field-border);
    background: #171718;
}

.model-dimension-inputs input:disabled {
    opacity: 0.5;
}

#print-volume-message {
    position: absolute;
    top: 12px;
    left: 50%;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 12px;
    pointer-events: none;
    transform: translateX(-50%);
    white-space: nowrap;
}

.slice-footer {
    display: flex;
    grid-area: footer;
    min-height: 73px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 44px;
    border-top: 1px solid var(--slice-line);
}

.slice-price {
    min-width: 0;
}

.price-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 12px;
    color: #f2f2f2;
    line-height: 24px;
}

.price-summary-label {
    font-size: 15px;
}

.price-summary-value {
    font-size: 17px;
    font-weight: 600;
}

.slice-status {
    margin: 4px 0 0;
    color: #ff8a80;
    font-size: 12px;
    line-height: 17px;
}

.slice-status:empty {
    margin: 0;
}

.slice-actions {
    display: flex;
    flex: 0 1 340px;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    min-width: 0;
}

.price-progress {
    flex: 1 1 auto;
    min-width: 0;
}

.price-progress-status {
    margin: 0;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
}

@media (max-width: 720px) {
    #slice-step {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto;
        grid-template-areas:
            "back"
            "title"
            "viewer"
            "options"
            "footer";
        width: calc(100% - 32px);
        padding: 24px 0;
    }

    .slice-title {
        margin-bottom: 16px;
        font-size: 26px;
        line-height: 34px;
    }

    #model-size-control {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .slice-viewer {
        min-height: 0;
        height: clamp(260px, 42svh, 380px);
        margin-bottom: 24px;
    }

    #print-volume-viewer {
        inset: 0;
    }

    .slice-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-top: 32px;
        padding: 20px 0 0;
    }

    .slice-actions {
        flex: none;
    }

    .slice-actions button {
        flex: 1 1 auto;
    }
}

/* ==========================================================================
   Page 4: order summary
   ========================================================================== */

#order-step {
    --order-line: rgba(255, 255, 255, 0.25);
    --order-field-border: #585858;
    --order-field-bg: #171718;
    --order-error: #ff8a80;
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    width: min(1076px, calc(100% - 80px));
    margin: 0 auto;
    padding: 30px 0 24px;
    text-align: left;
}

#order-step .back-link {
    align-self: flex-start;
}

.order-title {
    margin: 0 0 30px;
    font-size: clamp(22px, 2.4vw, 33px);
    font-weight: 400;
    line-height: 40px;
    outline: none;
}

.order-subheading {
    display: none;
}

.order-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    column-gap: 7.4%;
}

.order-summary,
.order-form {
    min-width: 0;
}

/* The slot for the print volume viewer, which is moved here from the print parameters page. */
.order-viewer {
    position: relative;
    aspect-ratio: 1.47;
    margin-bottom: 21px;
}

#order-step #print-volume-viewer {
    inset: 0;
    max-height: none;
}

.order-specs,
.order-price-lines,
.order-total {
    margin: 0;
    border-top: 1px solid var(--order-line);
}

.order-specs {
    padding: 8px 0 0;
}

.order-price-lines {
    padding: 0 0 8px;
    border-top: 0;
}

.order-pricing {
    margin: 0;
}

.order-specs > div,
.order-price-lines > div,
.order-total > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.order-specs > div {
    min-height: 34px;
    font-size: 11px;
    line-height: 16px;
}

.order-price-lines > div {
    min-height: 34px;
    font-size: 11px;
    line-height: 16px;
}

.order-total > div {
    min-height: 56px;
    font-size: 16px;
    line-height: 24px;
}

.order-specs dt,
.order-total dt {
    color: var(--text-muted);
}

.order-specs dd,
.order-total dd {
    margin: 0;
    color: #f2f2f2;
    font-weight: 600;
    text-align: right;
}

.order-section h2 {
    margin: 0 0 16px;
    color: #f2f2f2;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
}

.order-section + .order-section,
.order-confirm {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--order-line);
}

.order-contact-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.order-field-wide {
    grid-column: 1 / -1;
}

.order-field label {
    display: block;
    margin: 0 0 7px;
    color: #f2f2f2;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
}

.geowidget-section.is-local-test #open-parcel-locker-dialog {
    opacity: 1;
    cursor: pointer;
}

.order-field input {
    display: block;
    width: 100%;
    height: 38px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--order-field-border);
    border-radius: 8px;
    background: var(--order-field-bg);
    color: #f2f2f2;
    font-size: 11px;
    transition: border-color 0.15s ease;
}

.order-field input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.order-field input:hover {
    border-color: rgba(255, 255, 255, 0.55);
}

.order-field input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.order-field input:user-invalid {
    border-color: var(--order-error);
}

.delivery-option {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    gap: 0;
}

.delivery-brand {
    display: block;
    width: 82px;
    height: auto;
    flex: 0 0 82px;
}

.terms-consent input {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    margin: 0;
    accent-color: var(--accent);
    color-scheme: light;
}

.delivery-option-text {
    display: none;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
}

.delivery-option-title {
    color: #f2f2f2;
    font-size: 11px;
    font-weight: 600;
    line-height: 15px;
}

.geowidget-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid var(--order-field-border);
    border-radius: 2px;
}

.order-discount-field {
    margin-top: 14px;
}

.parcel-locker-button {
    display: flex;
    width: auto;
    max-width: none;
    min-height: 76px;
    flex: 1 1 0;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--order-field-border);
    border-radius: 2px;
    background: #171a1a;
    color: #f2f2f2;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    text-align: left;
}

.parcel-locker-button.is-selected {
    border-color: #3a4141;
}

.parcel-locker-pin {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 50%;
    background: #073b41;
    color: var(--accent);
}

.parcel-locker-button #parcel-locker-selection:not(.is-selected) {
    flex: 1 1 auto;
}

#parcel-locker-selection.is-selected {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    line-height: 16px;
}

.parcel-locker-button #parcel-locker-selection strong {
    color: #f2f2f2;
    font-size: 13px;
    font-weight: 700;
}

.parcel-locker-button .parcel-locker-address {
    margin-top: 0;
    font-size: 10px;
    font-weight: 400;
    line-height: 14px;
}

.parcel-locker-change {
    display: block;
    flex: 0 0 auto;
    padding-left: 4px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
}

.parcel-locker-button:hover:not(:disabled) {
    border-color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.08);
}

.parcel-locker-button #parcel-locker-selection:not(.is-selected) {
    color: #fff;
}

.parcel-locker-button:focus-visible,
.parcel-locker-dialog-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.parcel-locker-dialog {
    --order-field-border: #585858;
    --order-bg: #0f0f11;
    width: min(1160px, calc(100vw - 48px));
    max-width: none;
    height: min(820px, calc(100dvh - 48px));
    max-height: none;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--order-field-border);
    border-radius: 14px;
    background: var(--order-bg, #101010);
    color: #f2f2f2;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.6);
}

.parcel-locker-dialog::backdrop {
    background: rgba(0, 0, 0, 0.76);
    backdrop-filter: blur(4px);
}

.parcel-locker-dialog-content {
    display: flex;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    padding: 18px;
}

.parcel-locker-dialog-header {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 0 0 14px;
    text-align: left;
}

.parcel-locker-dialog-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
}

.parcel-locker-dialog-header p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.parcel-locker-dialog-close {
    display: grid;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--order-field-border);
    border-radius: 8px;
    background: transparent;
    color: #f2f2f2;
    cursor: pointer;
    line-height: 0;
}

.parcel-locker-dialog-close svg {
    display: block;
}

.parcel-locker-dialog-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

#geowidget-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--order-field-border);
    border-radius: 8px;
}

#geowidget-container:empty {
    display: none;
}

#geowidget-container inpost-geowidget {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
}

#parcel-locker-selection {
    display: block;
    min-width: 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 16px;
    overflow-wrap: anywhere;
}

#parcel-locker-selection.is-selected {
    color: #f2f2f2;
}

.parcel-locker-address {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
}

#geowidget-status {
    margin-top: 8px;
    color: var(--order-error);
    font-size: 11px;
    line-height: 16px;
}

#geowidget-status:empty {
    margin: 0;
}

.terms-consent {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    color: #f2f2f2;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    line-height: 16px;
}

.terms-consent a {
    text-underline-offset: 2px;
}

.terms-consent a:hover {
    color: var(--accent);
}

#orderBtn {
    display: flex;
    width: 100%;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 9px 16px;
    border-radius: 8px;
    background: #f2f2f2;
    color: #151515;
    font-size: 13px;
    font-weight: 500;
}

#order-status {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 17px;
    text-align: center;
}

#order-status.is-error {
    color: var(--order-error);
}

#order-status:empty {
    margin: 0;
}

.order-payment-note {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 16px;
    text-align: center;
}

/* The summary stays in view next to the long delivery form, as long as the whole of it fits the window. */
@media (min-width: 821px) and (min-height: 700px) {
    .order-summary {
        position: sticky;
        top: 24px;
    }
}

@media (max-width: 820px) {
    .order-title {
        margin-bottom: 20px;
        font-size: 26px;
        line-height: 34px;
    }

    .order-layout {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 32px;
    }

    .order-viewer {
        aspect-ratio: auto;
        height: clamp(240px, 42svh, 380px);
    }

    /* Below 16px, iOS zooms the page in when an input gets focus. */
    .order-field input {
        font-size: 16px;
    }

    .parcel-locker-dialog {
        width: calc(100vw - 24px);
        height: calc(100dvh - 24px);
        border-radius: 12px;
    }

    .parcel-locker-dialog-content {
        padding: 12px;
    }
}

@media (max-width: 720px) {
    #order-step {
        width: calc(100% - 32px);
        padding: 24px 0;
    }

    .order-title {
        margin: 0 0 8px;
        font-size: 30px;
        line-height: 1.1;
    }

    .order-layout {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0;
    }

    .order-summary,
    .order-form {
        display: contents;
    }

    .order-viewer {
        grid-row: 1;
        aspect-ratio: 1.47;
        height: auto;
        margin-bottom: 30px;
    }

    #order-step #print-volume-viewer {
        border: 1px solid var(--order-line);
    }

    .order-subheading {
        display: block;
        margin: 0 0 12px;
        color: #f2f2f2;
        font-size: 18px;
        font-weight: 400;
        line-height: 24px;
    }

    .order-specs-heading {
        grid-row: 2;
        margin-bottom: 12px;
        padding-top: 24px;
        border-top: 1px solid var(--order-line);
    }

    .order-specs {
        grid-row: 3;
        padding: 0 0 24px;
        border: 0;
        border-bottom: 1px solid var(--order-line);
    }

    .order-specs > div {
        min-height: 48px;
        font-size: 12px;
    }

    .order-contact-section {
        grid-row: 4;
    }

    .order-delivery-section {
        grid-row: 5;
    }

    .order-pricing {
        grid-row: 6;
        margin-top: 30px;
    }

    .order-pricing-heading {
        margin-bottom: 0;
        padding: 24px 0 12px;
        border-top: 1px solid var(--order-line);
    }

    .order-price-lines {
        padding: 0 0 8px;
        border: 0;
    }

    .order-price-lines > div {
        min-height: 42px;
        font-size: 12px;
    }

    .order-total > div {
        min-height: 64px;
        font-size: 16px;
    }

    .order-total dd {
        font-size: 23px;
    }

    .order-confirm {
        grid-row: 7;
    }
}

@media (max-width: 520px) {
    .order-contact-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .parcel-locker-dialog {
        width: 100vw;
        height: 100dvh;
        margin: 0;
        border: 0;
        border-radius: 0;
    }
}

/* ==========================================================================
   Discount survey: the offer on the order page and the survey page
   ========================================================================== */

.survey-offer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 192, 232, 0.45);
    border-radius: 8px;
    background: rgba(0, 192, 232, 0.07);
}

.survey-offer-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 16px;
}

.survey-offer-text strong {
    color: #f2f2f2;
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
}

button.survey-offer-button {
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.survey-offer-done {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 0;
    color: var(--accent);
    font-size: 12px;
    line-height: 16px;
}

.survey-offer-done svg {
    flex: 0 0 auto;
}

#survey-step {
    --order-line: rgba(255, 255, 255, 0.25);
    --order-field-border: #585858;
    --order-field-bg: #171718;
    --order-error: #ff8a80;
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    width: min(760px, calc(100% - 80px));
    margin: 0 auto;
    padding: 30px 0 24px;
    text-align: left;
}

#survey-step .back-link {
    align-self: flex-start;
}

#survey-step .order-title {
    margin-bottom: 12px;
}

.survey-intro {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 20px;
}

.survey-required {
    color: var(--accent);
}

.survey-optional {
    color: var(--text-muted);
    font-weight: 400;
}

.survey-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--order-line);
}

.survey-section h2 {
    margin: 0 0 4px;
    color: #f2f2f2;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
}

.survey-section-prompt {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 18px;
}

.survey-question {
    min-width: 0;
    margin: 0 0 20px;
    padding: 0;
    border: 0;
}

.survey-question-title {
    display: block;
    margin: 0 0 8px;
    padding: 0;
    color: #f2f2f2;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
}

.survey-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.survey-rating-scroll {
    overflow-x: auto;
    padding: 2px 3px 6px;
}

.survey-rating-scroll:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.survey-rating-matrix {
    min-width: 680px;
}

.survey-rating-header,
.survey-rating-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.8fr) repeat(4, minmax(88px, 1fr));
    gap: 8px;
    align-items: center;
}

.survey-rating-header {
    padding: 0 0 10px;
    border-bottom: 1px solid var(--order-line);
    color: var(--text-muted);
    font-size: 10px;
    line-height: 14px;
    text-align: center;
}

.survey-rating-header [role="columnheader"]:first-child {
    text-align: left;
}

.survey-rating-row {
    margin: 0;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid var(--order-line);
}

.survey-rating-row .survey-question-title {
    margin: 0;
    font-weight: 400;
}

.survey-rating-cell {
    display: flex;
    justify-content: center;
}

.survey-rating-choice {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    cursor: pointer;
}

.survey-rating-label {
    display: none;
}

.survey-rating-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.survey-rating-dot {
    width: 19px;
    height: 19px;
    border: 1px solid #929292;
    border-radius: 50%;
    background: var(--order-field-bg);
}

.survey-rating-choice:hover .survey-rating-dot {
    border-color: #f2f2f2;
}

.survey-rating-choice:has(input:checked) .survey-rating-dot {
    border: 5px solid var(--accent);
    background: #f2f2f2;
}

.survey-rating-choice:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-radius: 50%;
}

.survey-feature-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--order-line);
}

.survey-feature-row .survey-question-title {
    margin: 0;
    font-weight: 400;
}

.survey-feature-choices {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
}

.survey-feature-choice {
    display: inline-flex;
    min-width: 76px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border: 1px solid var(--order-field-border);
    border-radius: 7px;
    background: var(--order-field-bg);
    color: #f2f2f2;
    cursor: pointer;
    font-size: 13px;
    line-height: 18px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.survey-feature-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.survey-feature-choice:hover {
    border-color: rgba(255, 255, 255, 0.55);
}

.survey-feature-choice:has(input:checked) {
    border-color: var(--accent);
    background: rgba(0, 192, 232, 0.12);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.survey-feature-choice:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.survey-choice {
    position: relative;
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: 1px solid var(--order-field-border);
    border-radius: 8px;
    background: var(--order-field-bg);
    color: #f2f2f2;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.25;
    text-align: center;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.survey-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.survey-choice:hover {
    border-color: rgba(255, 255, 255, 0.55);
}

.survey-choice:has(input:checked) {
    border-color: var(--accent);
    background: rgba(0, 192, 232, 0.12);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.survey-choice:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.survey-question select {
    display: block;
    width: 100%;
    height: 38px;
    margin: 0;
    padding: 0 32px 0 12px;
    border: 1px solid var(--order-field-border);
    border-radius: 8px;
    background: var(--order-field-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f2f2f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    appearance: none;
    color: #f2f2f2;
    font-family: inherit;
    font-size: 12px;
    transition: border-color 0.15s ease;
}

.survey-section[aria-labelledby="survey-section-about_you"] .survey-question-select {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(200px, 0.75fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.survey-section[aria-labelledby="survey-section-about_you"] .survey-question-title {
    margin: 0;
}

.survey-question select:hover {
    border-color: rgba(255, 255, 255, 0.55);
}

.survey-question select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.survey-question-error {
    display: none;
    margin: 6px 0 0;
    color: var(--order-error);
    font-size: 11px;
    line-height: 16px;
}

.survey-question.is-missing .survey-question-error {
    display: block;
}

.survey-question.is-missing .survey-choice {
    border-color: var(--order-error);
}

.survey-question.is-missing .survey-feature-choice {
    border-color: var(--order-error);
}

.survey-question.is-missing .survey-rating-dot {
    border-color: var(--order-error);
}

.survey-rating-row .survey-question-error,
.survey-feature-row .survey-question-error,
.survey-section[aria-labelledby="survey-section-about_you"] .survey-question-error {
    grid-column: 1 / -1;
}

.survey-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
    padding-top: 20px;
    border-top: 1px solid var(--order-line);
}

.survey-actions button {
    margin: 0;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

#surveySubmitBtn {
    background: #f2f2f2;
    color: #151515;
}

#survey-status {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 17px;
    text-align: right;
}

#survey-status.is-error {
    color: var(--order-error);
}

#survey-status:empty {
    margin: 0;
}

@media (max-width: 820px) {
    /* Below 16px, iOS zooms the page in when a field gets focus. */
    .survey-question select {
        font-size: 16px;
    }
}

@media (max-width: 720px) {
    #survey-step {
        width: calc(100% - 32px);
        padding: 24px 0;
    }

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

    .survey-choice {
        min-height: 44px;
    }

    .survey-rating-matrix {
        min-width: 0;
    }

    .survey-rating-header {
        display: none;
    }

    .survey-rating-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .survey-rating-row .survey-question-title {
        grid-column: 1 / -1;
        margin-bottom: 2px;
    }

    .survey-rating-cell {
        min-width: 0;
    }

    .survey-rating-choice {
        display: flex;
        width: 100%;
        height: auto;
        min-height: 44px;
        justify-content: flex-start;
        gap: 7px;
        padding: 6px 8px;
        border: 1px solid var(--order-field-border);
        border-radius: 8px;
    }

    .survey-rating-label {
        display: block;
        min-width: 0;
        color: #f2f2f2;
        font-size: 11px;
        line-height: 14px;
    }

    .survey-rating-choice:has(input:checked) {
        border-color: var(--accent);
        background: rgba(0, 192, 232, 0.12);
        box-shadow: inset 0 0 0 1px var(--accent);
    }

    .survey-rating-choice:has(input:focus-visible) {
        border-radius: 8px;
    }

    .survey-feature-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .survey-feature-choice {
        min-width: 0;
        min-height: 44px;
        flex: 1 1 0;
        padding: 6px 10px;
    }

    .survey-feature-choices {
        width: 100%;
    }

    .survey-section[aria-labelledby="survey-section-about_you"] .survey-question-select {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .survey-actions {
        flex-direction: column-reverse;
    }

    .survey-actions button {
        width: 100%;
    }

    #survey-status {
        text-align: center;
    }
}

@media (max-width: 520px) {
    .survey-offer {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ==========================================================================
   Order complete + footer
   ========================================================================== */

#order-submitted {
    --order-line: rgba(255, 255, 255, 0.25);
    display: none;
    width: min(100%, 550px);
    margin: clamp(32px, 8vh, 72px) auto 0;
    padding: 0 20px;
    text-align: center;
}

.order-submitted-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 28px;
    color: var(--accent);
}

.order-submitted-icon svg {
    display: block;
}

#order-submitted h1 {
    margin: 0 0 20px;
    font-size: 33px;
    font-weight: 400;
    line-height: 40px;
}

.order-submitted-lead {
    margin: 0 0 32px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 20px;
    overflow-wrap: anywhere;
}

.order-submitted-details,
.order-submitted-total {
    margin: 0;
    text-align: left;
}

.order-submitted-specs {
    padding: 8px 0 12px;
    border-top: 1px solid var(--order-line);
}

.order-submitted-customer {
    padding: 8px 0;
}

.order-submitted-details > div,
.order-submitted-total > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.order-submitted-details > div {
    min-height: 34px;
    font-size: 11px;
    line-height: 16px;
}

.order-submitted-total {
    border-block: 1px solid var(--order-line);
}

.order-submitted-total > div {
    min-height: 56px;
    font-size: 16px;
    line-height: 24px;
}

.order-submitted-details dt,
.order-submitted-total dt {
    color: var(--text-muted);
}

.order-submitted-details dd,
.order-submitted-total dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: #f2f2f2;
    font-weight: 600;
    text-align: right;
}

.order-submitted-details dd[data-payment-status="paid"] {
    color: #6fcf7f;
}

.order-submitted-details dd[data-payment-status="pending"] {
    color: #f2c14e;
}

.order-submitted-details dd[data-payment-status="failed"] {
    color: #ef6b6b;
}

.order-submitted-note {
    margin: 20px 0 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 18px;
}

.order-restart-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    margin-top: 28px;
    padding: 9px 18px;
    border-radius: 8px;
    background: #f2f2f2;
    color: #151515;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: filter 0.15s ease;
}

.order-restart-link:hover {
    filter: brightness(1.1);
}

.order-restart-link:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
}

@media (max-width: 820px) {
    #order-submitted h1 {
        font-size: 26px;
        line-height: 34px;
    }

    .order-parcel-line {
        display: block;
    }

    .order-parcel-separator {
        display: none;
    }
}

.order-complete #upload-step,
.order-complete #preview-step,
.order-complete #slice-step,
.order-complete #order-step {
    display: none !important;
}

.order-complete #order-submitted {
    display: block !important;
}

.site-footer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 24px;
    margin: auto 0 0;
    padding: 48px 20px 28px;
    text-align: center;
}

.footer-link {
    display: inline-block;
    margin: 0;
    padding: 2px 0;
    color: var(--text-muted);
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-link:hover {
    color: var(--text);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1000px) {
    .site-header {
        margin-right: 20px;
        margin-left: 20px;
        padding: 0 32px;
    }

    .process-row {
        --arrow-width: clamp(22px, 6.3vw, 63px);
        column-gap: clamp(8px, 2.5vw, 25px);
    }
}

@media (max-width: 720px) {
    .site-header {
        height: 64px;
        margin: 16px 16px 0;
        padding: 0 20px;
    }

    .brand-logo {
        width: 30px;
        height: 46px;
    }

    .brand-name {
        font-size: 18px;
    }

    .header-contact {
        gap: 16px;
    }

    .contact-mail-text {
        display: none;
    }

    #upload-step {
        display: flex;
        flex: 1 0 auto;
        flex-direction: column;
        justify-content: center;
        padding-top: 48px;
    }

    .hero-title {
        padding-top: 0;
        font-size: clamp(28px, 7.4vw, 48px);
        line-height: 1.2;
    }

    .process-row {
        margin-top: clamp(28px, 7vw, 64px);
    }

    #upload-box {
        margin-top: clamp(40px, 9vw, 64px);
    }

    .upload-tile {
        padding-top: 40px;
    }

    .upload-default-copy .upload-prompt-desktop {
        display: none;
    }

    .upload-default-copy .upload-prompt-mobile {
        display: inline;
    }

    .upload-tile.has-image {
        padding: 34px 12px 20px;
    }

    .upload-tile.has-image .upload-selected-copy {
        align-items: flex-start;
    }

    .upload-selected-card {
        min-height: 102px;
        gap: 12px;
        padding: 12px;
    }

    .upload-preview {
        flex-basis: 64px;
        width: 64px;
        max-width: 64px;
        height: 64px;
    }

    .upload-selected-copy strong {
        font-size: 17px;
    }

    .upload-file-meta {
        gap: 0 6px;
        font-size: 13px;
    }

    .upload-tile.has-image .upload-hint {
        font-size: 12px;
    }

    .upload-clear-button {
        top: 5px;
        right: 5px;
    }
}

@media (hover: none) and (pointer: coarse) {
    #upload-box .upload-prompt-desktop {
        display: none;
    }

    #upload-box .upload-prompt-mobile {
        display: inline;
    }
}

@media (max-width: 400px) {
    .site-header {
        padding: 0 16px;
    }

    .brand-name {
        font-size: 16px;
    }

    .header-contact {
        gap: 12px;
        font-size: 13px;
    }

    .upload-prompt {
        display: flex;
        flex-direction: column;
    }
}
