/* ==========================================
   AJÁNLATKÉRŐ VARÁZSLÓ — STÍLUSLAP
   ==========================================
   Kizárólag a quote.html-hez tartozik. Önálló: nem támaszkodik a
   styles.css-re, és a quote.html nem is tölti be azt.

   Márkaszínek: a sötétkék a domináns, a narancs kizárólag az elsődleges
   gombnak (CTA) van fenntartva.

   Szakaszok: 1. oldalváz  2. lépésjelző  3. lépéskonténerek  4. feltöltő
   5. gombok  6. fájllista  7. alkatrésztáblázat  8. űrlap  9. összegzés
   10. hibaállapot  11. mobil
*/

:root {
    --primary: rgb(14, 55, 73);         /* domináns sötétkék */
    --primary-soft: rgb(23, 82, 108);   /* világosabb kék: fókuszgyűrű, ikonok */
    --accent: rgb(253, 126, 20);        /* narancs: kizárólag a CTA gombnak */
    --accent-hover: rgb(228, 152, 32);

    --bg: #ffffff;
    --surface: #ffffff;
    --surface-muted: #f2f5f7;
    --border: #e2e7eb;
    --text-main: #16232d;
    --text-muted: #66757f;

    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 7px;
    --radius-pill: 999px;

    --shadow-md: 0 10px 28px -10px rgba(14, 55, 73, 0.22);
    --transition: 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);

    --font-display: 'Barlow Condensed', 'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body.quote-page {
    margin: 0;
    background-color: var(--bg);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
}

h1, h2, h3, legend, .step-circle, .step-label,
.file-type-badges span, .btn-outline, .btn-cta, #partsTable th {
    font-family: var(--font-display);
}

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

/* ==========================================
   1. OLDALVÁZ, VISSZALINK, LOGÓ
   ========================================== */
.quote-shell {
    max-width: 920px;
    margin: 0 auto;
    padding: 36px 24px 90px 24px;
}

/* A logó középen marad, a visszalink a jobb felső sarokban van rögzítve.
   A logóhely üresen is tartja a magasságát, így az elrendezés nem ugrik meg,
   amikor kép kerül bele. */
/* Három sáv egy sorban: visszalink balra, logó középen, nyelvváltó jobbra.
   A két szélső oszlop egyenlő (1fr), így a logó pontosan középen marad,
   függetlenül attól, hogy a két szélen milyen hosszú a szöveg. */
.quote-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    min-height: 62px;
    margin-bottom: 40px;
}

/* Vizuálisan visszafogott, mégis valódi, látható H1 — az oldal egyetlen
   elsőrendű címsora, a lépésjelző sáv fölött. */
.quote-page-title {
    text-align: center;
    color: var(--primary);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 32px 0;
}

.quote-logo-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 62px;
}

.quote-logo-slot img {
    height: 62px;
    width: auto;
    display: block;
}

.quote-backlink {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color var(--transition);
}
.quote-backlink:hover { color: var(--primary); }

/* Nyelvváltó a fejléc jobb szélén. A quote.html nem tölti be a styles.css-t,
   ezért a főoldali .lang-switcher stílusát itt külön meg kell adni. */
.quote-lang {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 2px;
}
.quote-lang button {
    background: none;
    border: none;
    padding: 4px 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm, 4px);
    transition: color var(--transition), background-color var(--transition);
}
.quote-lang button:hover {
    color: var(--primary);
    background-color: #f0f4f8;
}
.quote-lang button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.info-zone {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #f0f4f8; /* halványkék háttér */
    border-left: 4px solid #1e3a8a; /* hangsúlyos bal szegély */
    padding: 12px 16px;
    border-radius: 4px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.info-icon {
    flex-shrink: 0;
    color: #1e3a8a; /* az ikon színe a szegélyhez igazodik */
    width: 24px;
    height: 24px;
}

.info-text {
    font-size: 14px;
    color: #334155;
    line-height: 1.5;
}

/* ==========================================
   ŰRLAPRÁCS — 2 oszlop, .span-2 a teljes szélességhez
   ========================================== */
.span-2 {
    grid-column: span 2;
}
@media (max-width: 600px) {
    .span-2 {
        grid-column: span 1;
    }
}

/* ==========================================
   2. LÉPÉSJELZŐ
   ========================================== */
.step-indicator {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    max-width: 720px;
    margin: 0 auto 74px auto;
}

.step-indicator-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 96px;
    flex-shrink: 0;
}

.step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.step-label {
    margin-top: 9px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color var(--transition);
}

.step-indicator-item.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 6px rgba(14, 55, 73, 0.09);
}
.step-indicator-item.active .step-label { color: var(--primary); }

.step-indicator-item.completed .step-circle {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.step-indicator-item.completed .step-label { color: var(--text-main); }

/* A "skipped" állapot a "completed" helyett olyan lépésnél, ami sosem volt
   értelmezhető — pl. nem volt feltöltött fájl, így a 2. lépésben nem volt mit
   beállítani. A kör és a felirat csak elhalványul, nem kap pipát. */
.step-indicator-item.skipped {
    opacity: 0.45;
    cursor: help;
}

.step-tooltip {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    max-width: calc(100vw - 24px);
    background: var(--primary);
    color: #fff;
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.45;
    padding: 10px 14px;
    border-radius: 8px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    box-shadow: var(--shadow-md);
    z-index: 60;
}
.step-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--primary);
}
.step-indicator-item.skipped:hover .step-tooltip,
.step-indicator-item.skipped:focus-within .step-tooltip {
    opacity: 1;
    visibility: visible;
}

.step-connector {
    flex: 1 1 auto;
    height: 2px;
    background: var(--border);
    margin-top: 18px;
    min-width: 20px;
    transition: background var(--transition);
}
.step-connector.completed { background: var(--accent); }

/* ==========================================
   3. LÉPÉSKONTÉNEREK ÉS CÍMEK
   ========================================== */
.step-container { display: none; }
.step-container.active {
    display: block;
    animation: fadeInUp 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.step-title {
    color: var(--primary);
    font-size: 25px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.step-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0 0 30px 0;
}

/* ==========================================
   4. 1. LÉPÉS — FÁJLFELTÖLTŐ ZÓNA
   ========================================== */
.drop-zone {
    border: 2px dashed #c7d0d8;
    border-radius: var(--radius-lg);
    padding: 54px 30px 40px 30px;
    text-align: center;
    background-color: var(--surface);
    transition: border-color var(--transition), background-color var(--transition);
}

.drop-zone.dragover {
    border-color: var(--accent);
    background-color: #fef8f0;
}

.drop-zone-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--surface-muted);
    color: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px auto;
}
.drop-zone-icon svg { width: 30px; height: 30px; }

.drop-zone h3 {
    color: var(--primary);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 18px 0;
}

.file-type-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}

.file-type-badges span {
    background: var(--surface-muted);
    color: var(--primary);
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.4px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
}

/* ==========================================
   5. GOMBOK
   ========================================== */
.btn-outline {
    background: var(--surface);
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
    padding: 13px 30px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-cta {
    background: var(--accent);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 15.5px;
    padding: 15px 34px;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 6px 18px -4px rgba(228, 152, 32, 0.45);
    transition: all var(--transition);
}
.btn-cta:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px -6px rgba(228, 152, 32, 0.55);
}
.btn-cta:disabled {
    opacity: 0.35;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
.btn-cta:disabled:hover {
    background: var(--accent);
    transform: none;
    box-shadow: none;
}

/* Jelenleg SEHOL nem használt: a "nincs fájlom" gombhoz készült, ami időközben
   kikerült az oldalról. Tömör másodlagos gomb, a CTA-val azonos formában, de
   márkakékben, hogy a narancs maradjon az egyetlen elsődleges akció. */
.btn-solid {
    background: var(--primary);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 15px;
    padding: 15px 30px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-solid:hover {
    background: var(--primary-soft);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14.5px;
    cursor: pointer;
    padding: 10px 4px;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: color var(--transition), text-decoration-color var(--transition);
}
.btn-text:hover {
    color: var(--primary);
    text-decoration-color: currentColor;
}

.flex-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 34px;
}
.flex-buttons-split {
    justify-content: space-between;
    align-items: center;
}

/* ==========================================
   6. FELTÖLTÖTT FÁJLOK LISTÁJA
   ========================================== */
.files-counter {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-soft);
    margin: 26px 2px 10px 2px;
}

.uploaded-files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 13px 16px;
    animation: fadeInUp 0.3s ease;
}

.file-item-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}
.file-item-icon svg { width: 18px; height: 18px; }

.file-item-info { flex: 1; min-width: 0; }

.file-item-name {
    font-weight: 600;
    font-size: 14.5px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-size {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* 3D fájlok (STEP/STP) párosítási sávja: hozzárendelt PDF neve, vagy
   "hiányzik" jelzés — mindkettő ejtési célpont is húzáskor. */
.pdf-pairing-slot {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12.5px;
}
.pdf-pairing-slot--filled {
    background: var(--surface-muted);
    border: 1px solid var(--border);
}
.pdf-pairing-slot--empty {
    background: #fff5f5;
    border: 1px dashed #e53e3e;
    color: #dc2626;
    font-weight: 600;
}
.pdf-pairing-label { color: var(--text-muted); flex-shrink: 0; }
.pdf-pairing-name {
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pdf-pairing-unassign {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 5px;
    flex-shrink: 0;
}
.pdf-pairing-unassign:hover { background: var(--border); color: var(--text-main); }

.file-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 4px 9px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.file-item-remove:hover {
    background: #fdecec;
    color: #dc2626;
}

/* ==========================================
   7. 2. LÉPÉS — ALKATRÉSZTÁBLÁZAT
   ========================================== */
.file-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 14px;
}

/* 8 oszlop (alkatrész, anyag, vastagság, mennyiség, 4 megmunkálás-jelölő) nem
   fér el olvashatóan egy keskeny telefon szélességében. Ahelyett hogy minden
   oszlopot a kijelzőhöz igazítva összenyomnánk, a táblázat kap egy minimum
   szélességet — ez alatt a .file-table-wrapper overflow-x:auto-ja görgethetővé
   teszi, az oszlopok pedig a százalékos arányuk szerint, olvasható méretben
   jelennek meg görgetve. Széles kártyánál (min-width felett) a width:100%
   érvényesül, a viselkedés változatlan marad. */
#partsTable {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: var(--surface);
    table-layout: fixed;
}

#partsTable th:nth-child(1), #partsTable td:nth-child(1) { width: 21%; }
#partsTable th:nth-child(2), #partsTable td:nth-child(2) { width: 15%; }
#partsTable th:nth-child(3), #partsTable td:nth-child(3) { width: 11%; }
#partsTable th:nth-child(4), #partsTable td:nth-child(4) { width: 9%; }
#partsTable th:nth-child(5), #partsTable td:nth-child(5),
#partsTable th:nth-child(6), #partsTable td:nth-child(6),
#partsTable th:nth-child(7), #partsTable td:nth-child(7),
#partsTable th:nth-child(8), #partsTable td:nth-child(8) { width: 11%; }

#partsTable thead th {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.35;
    padding: 16px 10px;
    text-align: center;
    word-break: break-word;
}
#partsTable thead th:first-child { text-align: left; padding-left: 18px; }

#partsTable td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 14.5px;
    text-align: center;
    color: var(--text-main);
    word-break: break-word;
}
#partsTable tbody tr:last-child td { border-bottom: none; }
#partsTable tbody tr:nth-child(even) { background: var(--surface-muted); }
#partsTable td:first-child { text-align: left; font-weight: 600; padding-left: 18px; }

#partsTable td select,
#partsTable td input[type="number"] {
    width: 100%;
    padding: 9px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 13.5px;
    background: #fff;
}

#partsTable td input[type="checkbox"] {
    width: 19px;
    height: 19px;
    accent-color: var(--primary);
    cursor: pointer;
}

.field-error-msg {
    color: #dc2626;
    font-size: 13.5px;
    font-weight: 600;
    margin: 0 0 14px 2px;
}

/* ==========================================
   8. 3. LÉPÉS — KAPCSOLAT ÉS SZÁMLÁZÁS
   ========================================== */
fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 22px 22px 22px;
    margin-bottom: 22px;
    background: var(--surface);
}

legend {
    background: var(--primary);
    color: #fff;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

label {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-main);
    display: inline-block;
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-family: inherit;
    background: var(--surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-soft);
    box-shadow: 0 0 0 3px rgba(23, 82, 108, 0.14);
}

textarea { resize: vertical; }

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    margin-right: 10px;
    vertical-align: middle;
}

.checkbox-row {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 4px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.form-grid .span-2 { grid-column: span 2; }

.type-toggle {
    display: flex;
    gap: 14px;
}

.type-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface);
    transition: all var(--transition);
}
.type-option input { margin: 0; }
.type-option:has(input:checked) {
    border-color: var(--primary);
    background: #eef4f7;
    color: var(--primary);
}

/* ==========================================
   9. 4. LÉPÉS — ÖSSZEGZÉS
   ========================================== */
.summary-block {
    text-align: center;
    padding: 40px 10px 10px 10px;
}

.summary-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--surface-muted);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px auto;
}
.summary-icon svg { width: 28px; height: 28px; }

.summary-block h3 {
    color: var(--primary);
    font-size: 24px;
    margin: 0 0 10px 0;
}
.summary-block p {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0 0 6px 0;
}

#statusMessage {
    margin-top: 16px;
    font-weight: 600;
}

/* ==========================================
   10. HIBAÁLLAPOT
   ========================================== */
.input-error {
    border-color: #e53e3e !important;
    box-shadow: none !important;
    background-color: #fff5f5 !important;
}
.type-option.input-error { background-color: #fff5f5 !important; }

/* ==========================================
   11. MOBIL NÉZET
   ========================================== */
@media (max-width: 700px) {
    .quote-shell { padding: 26px 16px 70px 16px; }

    .step-indicator-item { width: 72px; }
    .step-circle { width: 32px; height: 32px; font-size: 13px; }
    .step-label { font-size: 11.5px; }

    .drop-zone { padding: 42px 18px 30px 18px; }

    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: span 1; }

    .type-toggle { flex-direction: column; }

    .flex-buttons-split {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 14px;
    }
    .flex-buttons-split .btn-cta,
    .flex-buttons-split .btn-outline,
    .flex-buttons-split .btn-solid {
        width: 100%;
        text-align: center;
    }
    .flex-buttons-split .btn-text { text-align: center; }
}

@media (max-width: 480px) {
    /* Keskeny kijelzőn egymás alá kerül: logó, alatta a visszalink és a
       nyelvváltó egy sorban, hogy ne szoruljon össze a három elem. */
    .quote-header {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "logo logo"
            "back lang";
        gap: 12px 14px;
        justify-items: center;
    }
    .quote-logo-slot { grid-area: logo; }
    .quote-backlink { grid-area: back; justify-self: start; }
    .quote-lang { grid-area: lang; justify-self: end; }

    .step-label { display: none; }
    .step-indicator-item.active .step-label { display: block; }
    .step-indicator-item { width: auto; }

    /* Keskenyebb buborék, hogy a szélén lévő lépéseknél is kisebb eséllyel
       lógjon ki a kijelző szélén túlra. */
    .step-tooltip { width: 200px; }

    #partsTable thead th { padding: 12px 4px; font-size: 10.5px; }
    #partsTable td { padding: 10px 3px; }
    #partsTable td input[type="checkbox"] { width: 17px; height: 17px; }
}