/* ==========================================================================
   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 var(--line);
    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;
    font-size: 16px;
    line-height: 1;
}

.contact-cta {
    position: relative;
    top: 2px;
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.contact-mail {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    white-space: nowrap;
}

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

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

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

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

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

#preview-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, 1.504fr) auto minmax(0, 1.393fr) auto minmax(0, 1.418fr);
    align-items: center;
    column-gap: 25px;
    margin-top: 67px;
}

.process-image {
    display: block;
    width: 100%;
    height: auto;
}

.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;
    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 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;
    min-height: 200px;
    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,
#regenerateBtn {
    scroll-margin-bottom: 120px;
}

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

.progress-container {
    width: 100%;
    height: 8px;
    margin-top: 15px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    display: none;
}

.progress-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

#preview-model-container {
    position: relative;
    width: 100%;
    height: 450px;
    margin-top: 24px;
    overflow: hidden;
    border-radius: 20px;
    display: none;
    background: #f4f4f9;
    scroll-margin-top: 24px;
}

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

#preview-model-message {
    position: absolute;
    inset: auto 16px 16px;
    padding: 8px 12px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    color: #40564f;
    font-size: 13px;
    pointer-events: none;
}

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

#continueBtn {
    margin: 24px 0 0;
}

/* ==========================================================================
   Pages 2 and 3 (interim light cards until they are redesigned)
   ========================================================================== */

#slice-step,
#order-step {
    width: min(700px, calc(100% - 32px));
    margin-top: 40px;
    padding: 28px 24px 32px;
    border-radius: 20px;
    background: #fff;
    color: #1f2a26;
    color-scheme: light;
}

#slice-step button.secondary,
#order-step button.secondary {
    border-color: #1f2a26;
    color: #1f2a26;
}

#slice-step button.secondary:hover:not(:disabled),
#order-step button.secondary:hover:not(:disabled) {
    background: rgba(31, 42, 38, 0.08);
}

#print-stats {
    margin-top: 10px;
    color: #28a745;
    font-weight: bold;
    line-height: 1.5;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading-spinner {
    display: block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
    border: 3px solid rgba(40, 167, 69, 0.25);
    border-top-color: #28a745;
    border-radius: 50%;
    animation: spinner-rotation 0.8s linear infinite;
}

.price-calculation-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.price-calculation-progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    max-width: 320px;
    font-size: 0.9em;
}

.price-calculation-progress-label {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.price-calculation-progress-track {
    display: block;
    height: 8px;
    overflow: hidden;
    background: rgba(40, 167, 69, 0.2);
    border-radius: 4px;
}

.price-calculation-progress-bar {
    display: block;
    height: 100%;
    background: #28a745;
    border-radius: 4px;
    transition: width 0.4s ease;
}

@keyframes spinner-rotation {
    to {
        transform: rotate(360deg);
    }
}

.order-box {
    display: none;
    margin-top: 20px;
}

.print-volume-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 22px 0 12px;
    text-align: left;
}

.print-volume-heading h2,
.print-volume-heading p {
    margin: 0;
}

.print-volume-heading h2 {
    font-size: 20px;
}

.build-volume-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 8px;
    color: #40564f;
    font-size: 14px;
    text-align: left;
}

.build-volume-heading strong {
    flex: 0 0 auto;
}

.model-color-control {
    min-width: 0;
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    text-align: left;
}

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

.model-color-label {
    color: #65726d;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

#selected-model-color {
    color: #40564f;
    font-size: 14px;
}

.model-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.model-color-swatch {
    position: relative;
    display: inline-flex;
    width: 42px;
    height: 42px;
    cursor: pointer;
}

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

.model-color-swatch span {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    border: 1px solid rgba(38, 51, 46, 0.14);
    border-radius: 50%;
    background: var(--swatch-color);
    color: #fff;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.model-color-swatch span::after {
    content: "";
}

.model-color-swatch input:checked + span {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
    transform: scale(0.92);
}

.model-color-swatch input:checked + span::after {
    content: "\2713";
    font-size: 20px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.model-color-swatch input:focus-visible + span {
    outline: 3px solid #26332e;
    outline-offset: 5px;
}

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

#model-color-status {
    display: block;
    min-height: 1.2em;
    margin-top: 8px;
    color: #53635d;
    font-size: 13px;
}

#print-volume-viewer {
    position: relative;
    width: 100%;
    height: min(70vh, 620px);
    min-height: 380px;
    overflow: hidden;
    border: 1px solid #d7dfdb;
    border-radius: 8px;
    background: #f3f6f4;
}

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

#print-volume-message {
    position: absolute;
    inset: auto 16px 16px;
    padding: 8px 12px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.94);
    color: #40564f;
    font-size: 13px;
    pointer-events: none;
}

#print-volume-message[hidden] {
    display: none;
}

.model-size-control,
.print-quality-control {
    margin: 16px 0 4px;
    padding: 14px;
    border: 1px solid #d7dfdb;
    border-radius: 8px;
    background: #f7faf8;
    text-align: left;
}

.model-size-control[hidden],
.print-quality-control[hidden] {
    display: none;
}

.model-size-control label {
    display: block;
    margin-bottom: 8px;
    color: #40564f;
    font-size: 14px;
    font-weight: 700;
}

.print-quality-options {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.print-quality-options legend {
    margin-bottom: 8px;
    color: #40564f;
    font-size: 14px;
    font-weight: 700;
}

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

.print-quality-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-height: 40px;
    padding: 10px;
    border: 1px solid #cbd6d0;
    border-radius: 6px;
    background: #fff;
    color: #26332e;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.35;
}

.print-quality-option:has(input:checked) {
    border-color: #28a745;
    background: #e8f5e9;
}

.print-quality-option input {
    flex: 0 0 auto;
    margin: 2px 0 0;
    accent-color: #28a745;
}

.print-quality-option:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.65;
}

@media (max-width: 560px) {
    .print-quality-choices {
        grid-template-columns: 1fr;
    }
}

#print-quality-status {
    display: block;
    min-height: 1.2em;
    margin-top: 6px;
    color: #53635d;
    font-size: 13px;
}

#model-size-slider {
    width: 100%;
    margin: 4px 0 8px;
    accent-color: #28a745;
}

#model-size-status {
    min-height: 1.2em;
    margin-top: 6px;
    line-height: 1.4;
    color: #53635d;
    font-size: 12px;
}

@media (max-width: 480px) {
    .print-volume-heading {
        align-items: start;
        flex-direction: column;
        gap: 6px;
    }

    .build-volume-heading {
        align-items: start;
        flex-direction: column;
        gap: 4px;
    }

    #print-volume-viewer {
        height: min(62vh, 460px);
        min-height: 340px;
    }
}

.order-contact-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: left;
}

.order-box label {
    display: block;
    margin: 0;
    font-weight: 600;
}

.order-box input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.order-price-summary {
    margin: 16px 0;
    padding: 14px;
    border: 1px solid #d7dfdb;
    border-radius: 8px;
    background: #f7faf8;
    text-align: left;
}

.order-price-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 5px 0;
}

.order-price-summary dt,
.order-price-summary dd {
    margin: 0;
}

.order-total {
    margin-top: 6px;
    padding-top: 11px !important;
    border-top: 1px solid #d7dfdb;
    font-size: 18px;
    font-weight: 700;
}

.geowidget-section {
    margin: 20px 0;
}

.geowidget-section p {
    margin-bottom: 10px;
    font-weight: bold;
}

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

#parcel-locker-selection,
#geowidget-status {
    margin-top: 10px;
}

#geowidget-status {
    color: #b42318;
}

#order-status {
    margin-top: 10px;
    color: #b42318;
}

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

#order-submitted {
    display: none;
    margin-top: 30vh;
    padding: 0 20px;
    font-size: 32px;
    font-weight: 600;
    text-transform: lowercase;
}

.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;
    }

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

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

    #upload-box {
        margin-top: clamp(28px, 7vw, 63px);
    }

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

    .upload-tile.has-image {
        min-height: 170px;
        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;
    }

    #preview-model-container {
        height: 360px;
    }
}

@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;
    }
}
