@charset "UTF-8";
/* =============================================================================
   Step 3 — Copertina.
   Le classi sono le stesse usate da step3.js: qui cambia solo la veste.
   ============================================================================= */

#cover-source { margin-bottom: 20px; }
#cover-preview-wrapper { margin-top: 4px; }

/* -----------------------------------------------------------------------------
   Scelta della sorgente (prima pagina tesi / PDF separato)
   -------------------------------------------------------------------------- */
.source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.source-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    padding: 16px;
    border-radius: var(--lxs-radius-sm);
    border: 1px solid var(--lxs-border);
    background: transparent;
    color: var(--lxs-text);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.source-card:hover {
    border-color: var(--lxs-rule);
    background: var(--lxs-surface-2);
}

.source-card i {
    font-size: 1.05rem;
    color: var(--lxs-accent);
    margin-top: 3px;
}

.source-card strong { display: block; font-family: var(--font-ui); font-size: .88rem; font-weight: 600; margin-bottom: 3px; }
.source-card span span { display: block; font-size: .8rem; line-height: 1.45; color: var(--lxs-text-soft); }

/* -----------------------------------------------------------------------------
   Stage anteprima
   -------------------------------------------------------------------------- */
.cover-stage {
    position: relative;
    width: 100%;
    max-width: 340px;
    aspect-ratio: var(--cover-ratio, 320 / 452);
    margin: 0 auto;
    border-radius: var(--lxs-radius-hair);
    overflow: hidden;
    cursor: zoom-in;
    box-shadow: 0 0 0 1px var(--lxs-border);
    background: var(--lxs-surface-2);
    user-select: none;
}

.cover-stage > * {
    position: absolute;
    inset: 0;
}

.cover-material {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: var(--lxs-radius-hair);
    transition: background-image .25s ease-in-out;
    z-index: 1;
}

#cover-engraving-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
    display: none;
}

#cover-engraving-img.ready { display: block; }

.cover-zoom-hint {
    inset: auto 8px 8px auto !important;
    width: auto;
    height: auto;
    background: color-mix(in srgb, var(--lxs-text) 78%, transparent);
    color: var(--lxs-bg);
    padding: 4px 8px;
    border-radius: var(--lxs-radius-sm);
    font-family: var(--font-ui);
    font-size: .72rem;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
    z-index: 3;
}

.cover-stage:hover .cover-zoom-hint { opacity: 1; }

/* -----------------------------------------------------------------------------
   Tipo di copertina (radio card)
   -------------------------------------------------------------------------- */
.blocks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.block-card {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.block-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.block-card .block-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 14px;
    border-radius: var(--lxs-radius-sm);
    border: 1px solid var(--lxs-border);
    background: transparent;
    color: var(--lxs-text);
    min-height: 78px;
    height: 100%;
    transition: border-color .15s ease, background-color .15s ease;
}

.block-card:hover .block-inner { border-color: var(--lxs-rule-soft); }

.block-card input[type="radio"]:checked + .block-inner {
    border-color: var(--lxs-rule);
    background: color-mix(in srgb, var(--lxs-accent) 10%, transparent);
}

.block-card .block-title { font-family: var(--font-ui); font-weight: 600; font-size: .9rem; line-height: 1.2; margin-bottom: 3px; }
.block-card .block-subtitle { font-size: .74rem; color: var(--lxs-text-soft); line-height: 1.25; }
.block-card .block-price {
    margin-top: 6px;
    font-family: var(--font-ui);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--lxs-accent);
    font-size: .8rem;
}

/* -----------------------------------------------------------------------------
   Materiali
   -------------------------------------------------------------------------- */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
}

.material-card {
    position: relative;
    border: 1px solid var(--lxs-border);
    border-radius: var(--lxs-radius-sm);
    overflow: hidden;
    cursor: pointer;
    background: var(--lxs-surface-2);
    aspect-ratio: 3 / 4;
    padding: 0;
    transition: border-color .15s ease;
}

.material-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.material-card .material-label {
    position: absolute;
    inset: auto 0 0 0;
    background: var(--lxs-surface);
    border-top: 1px solid var(--lxs-border);
    color: var(--lxs-text);
    font-family: var(--font-ui);
    font-size: .62rem;
    padding: 3px 3px;
    text-align: center;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1;
}

.material-card:hover { border-color: var(--lxs-rule-soft); }
.material-card.active {
    border-color: var(--lxs-rule);
    box-shadow: inset 0 0 0 1px var(--lxs-rule);
}

/* -----------------------------------------------------------------------------
   Colori incisione
   -------------------------------------------------------------------------- */
#cover-colors { display: flex; flex-wrap: wrap; gap: 8px; }

#cover-colors button {
    width: 32px;
    height: 32px;
    border-radius: var(--lxs-radius-sm);
    border: 1px solid var(--lxs-border-strong);
    cursor: pointer;
    padding: 0;
    transition: border-color .15s ease, box-shadow .15s ease;
    background-color: var(--lxs-border-strong);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#cover-colors button:hover { border-color: var(--lxs-rule); }
#cover-colors button.active {
    border-color: var(--lxs-rule);
    box-shadow: inset 0 0 0 2px var(--lxs-bg);
}

/* -----------------------------------------------------------------------------
   Zoom
   -------------------------------------------------------------------------- */
#cover-zoom {
    position: fixed;
    inset: 0;
    background: var(--lxs-scrim);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 20px;
}

#cover-zoom.is-open { display: flex; }

#cover-zoom canvas {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: var(--lxs-radius-sm);
    box-shadow: 0 8px 40px color-mix(in srgb, var(--lxs-scrim) 70%, transparent);
    background: var(--lxs-surface-2);
    display: block;
}

#cover-zoom-close {
    position: absolute;
    top: 18px;
    right: 24px;
    background: transparent;
    border: none;
    color: var(--lxs-scrim-ink);
    font-size: 2.6rem;
    line-height: 1;
    cursor: pointer;
}

#cover-zoom-close:hover { color: var(--lxs-danger); }

/* -----------------------------------------------------------------------------
   Dropzone della copertina
   -------------------------------------------------------------------------- */
#cover-dropzone {
    margin: 0;
    min-height: 210px;
    border: 1px dashed var(--lxs-rule-soft);
    border-radius: var(--lxs-radius-sm);
    background-color: transparent;
    transition: background-color .15s ease, border-color .15s ease;
    cursor: pointer;
}

#cover-dropzone:hover,
#cover-dropzone.dz-drag-hover {
    background-color: var(--lxs-surface-2);
    border-color: var(--lxs-rule);
}

#cover-dropzone.dz-disabled { opacity: .6; pointer-events: none; }

#cover-dropzone .dz-message {
    text-align: center;
    color: var(--lxs-text-soft);
    padding: 38px 20px;
    margin: 0;
}

#cover-dropzone .dz-message i {
    color: var(--lxs-accent);
    margin-bottom: 14px;
    display: block;
    font-size: 1.5rem;
}

#cover-dropzone .dz-message p { margin: 0; font-size: .95rem; }

.cover-upload-info { margin-bottom: 16px; }

#cover-upload-wrapper { margin: 0 0 20px; }

#cover-upload-retry { margin-top: 16px; }

.cover-upload-retry-note {
    margin-top: 10px;
    font-size: .82rem;
    color: var(--lxs-text-soft);
    max-width: 520px;
    margin-inline: auto;
}

/* -----------------------------------------------------------------------------
   Dati per l'incisione (righe di testo + logo)
   -------------------------------------------------------------------------- */
.cover-lines {
    padding: 16px;
    border: 1px solid var(--lxs-rule-soft);
    border-radius: var(--lxs-radius-sm);
    background: transparent;
}

.cover-lines__head { margin-bottom: 12px; }

.cover-lines__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-family: var(--font-ui);
    font-size: .9rem;
    font-weight: 600;
}

.cover-lines__title i { color: var(--lxs-accent); }

.cover-lines .notice { margin-bottom: 14px; }

.cover-lines .copies-stepper { max-width: 240px; }

.cover-lines__hint {
    margin: 8px 0 0;
    font-size: .78rem;
    line-height: 1.45;
    color: var(--lxs-text-soft);
}

.cover-lines__logo {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--lxs-border);
}

.cover-lines__logo-price {
    display: block;
    font-size: .78rem;
    color: var(--lxs-text-soft);
}

/* -----------------------------------------------------------------------------
   Preventivo della copertina: dettagli e, in fondo, il totale
   -------------------------------------------------------------------------- */
.cover-quote {
    margin-top: 18px;
    padding: 8px 16px 12px;
    border: 1px solid var(--lxs-rule-soft);
    border-radius: var(--lxs-radius-sm);
    background: transparent;
}

.cover-quote .price-rows { margin: 0; }

.cover-quote__unit {
    margin-left: 6px;
    font-size: .76rem;
    color: var(--lxs-text-soft);
    white-space: nowrap;
}

/* -----------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .cover-stage { max-width: 300px; }
}

/* L'anteprima resta a vista mentre si compone la copertina: la colonna dei
   controlli è molto più alta e altrimenti il foglio scorre via. */
@media (min-width: 992px) {
    .cover-side { position: sticky; top: 24px; }
}

@media (max-width: 575.98px) {
    .blocks-grid { grid-template-columns: 1fr; }
    .materials-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .cover-stage { max-width: 260px; }
    #cover-colors button { width: 30px; height: 30px; }
}
