/* Consultant suprafete (/consultant-suprafete) — view: frontend/views/surface-advisor/index.php + _result.php.
   Foloseste variabilele temei (custom.css): --accent #0f3258, --accent-soft, --color-bg, --color-border, --gray. */

.sa {
    --sa-accent: var(--accent, #0f3258);
    --sa-accent-dark: var(--accent-dark, #0a2340);
    --sa-cyan: #00a8d6;
    --sa-soft: #eef3f8;
    --sa-line: #e4e1dc;
    --sa-muted: var(--gray, #6b7280);
    --sa-ink: var(--black, #202020);
    --sa-sticky-top: 96px;
    padding-bottom: 3rem;
    color: var(--sa-ink);
}

/* ------------------------------------------------------------------ antet */
.sa-hero { max-width: 760px; padding: 2rem 0 1.5rem; }
.sa-hero h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .75rem; color: var(--sa-accent); }
.sa-lead { font-size: 1.0625rem; line-height: 1.6; color: #3f4650; margin: 0 0 1rem; max-width: 62ch; }
.sa-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; list-style: none; padding: 0; margin: 0; font-size: .875rem; color: #3f4650; }
.sa-facts li { display: inline-flex; align-items: center; gap: .45rem; }
.sa-facts li::before { content: ""; width: 1rem; height: 1rem; flex: none; border-radius: 50%; background: var(--sa-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.6L12 5.4' fill='none' stroke='%230f3258' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 75% no-repeat; }

/* ------------------------------------------------------------------ asezare: intrebari | recomandare */
.sa-layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "aside" "contact"; }
.sa-main { grid-area: main; min-width: 0; }
.sa-aside { grid-area: aside; min-width: 0; }
.sa-contact { grid-area: contact; }

@media (min-width: 992px) {
    .sa-layout { grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); grid-template-areas: "main aside" "contact aside"; align-items: start; column-gap: 1.75rem; }
    .sa-aside { position: sticky; top: var(--sa-sticky-top); max-height: calc(100vh - var(--sa-sticky-top) - 1rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border-radius: .875rem; }
}

/* ------------------------------------------------------------------ panouri si pasi */
.sa-panel, .sa-card { background: #fff; border: 1px solid var(--sa-line); border-radius: .875rem; padding: 1.5rem; }
.sa-panel + .sa-panel { margin-top: 1.25rem; }
.sa-step-title { display: flex; align-items: center; gap: .65rem; font-size: 1.1875rem; font-weight: 700; line-height: 1.3; margin: 0 0 1.1rem; color: var(--sa-ink); }
.sa-step { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 1.875rem; height: 1.875rem; border-radius: 50%; background: var(--sa-accent); color: #fff; font-weight: 700; font-size: .875rem; }
.sa-hint { font-size: .8125rem; line-height: 1.5; color: var(--sa-muted); margin: .4rem 0 0; }
.sa-hint--top { margin: -.5rem 0 1.25rem; font-size: .875rem; }

/* ------------------------------------------------------------------ poza */
.sa-photo { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem; border-radius: .75rem; background: var(--sa-soft); }
.sa-preview { width: 112px; aspect-ratio: 1; flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: .625rem; border: 1.5px dashed #b9c5d3; background: #fff; color: #7a8aa0; }
.sa-preview canvas, .sa-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sa-photo-body { flex: 1; min-width: 0; }
.sa-photo-title { font-weight: 600; margin: 0 0 .6rem; line-height: 1.4; }
.sa-photo-btn { min-height: 42px; display: inline-flex; align-items: center; }
#saPhoto:focus-visible + .sa-hint, .sa-photo-btn:focus-within { outline: 2px solid var(--sa-accent); outline-offset: 2px; }
.sa-status { font-size: .875rem; margin-top: .6rem; }
.sa-status:empty { display: none; }
.sa-progress { height: .45rem; background: #fff; border-radius: 1rem; overflow: hidden; margin-top: .5rem; }
.sa-progress > div { height: 100%; width: 0; background: var(--sa-accent); transition: width .2s; }
.sa-guess-box { margin-top: .75rem; }
.sa-guess-title { font-size: .8125rem; font-weight: 600; color: #3f4650; }
.sa-guess { list-style: none; padding: 0; margin: .35rem 0 0; }
.sa-guess li { display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; font-size: .875rem; }
.sa-guess .bar { flex: none; width: 90px; height: .4rem; background: #fff; border-radius: 1rem; overflow: hidden; }
.sa-guess .bar > span { display: block; height: 100%; background: var(--sa-accent); }
.sa-or { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0 1rem; font-size: .8125rem; color: var(--sa-muted); }
.sa-or::before, .sa-or::after { content: ""; flex: 1; height: 1px; background: var(--sa-line); }

/* ------------------------------------------------------------------ materialele: placi cu mostre de textura */
.sa-materials { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: .625rem; }
.sa-material { position: relative; display: block; margin: 0; cursor: pointer; }
.sa-material input { position: absolute; opacity: 0; pointer-events: none; }
.sa-material-card { display: flex; flex-direction: column; height: 100%; border: 1.5px solid var(--sa-line); border-radius: .75rem; overflow: hidden; background: #fff; transition: border-color .15s, box-shadow .15s; }
.sa-material:hover .sa-material-card { border-color: #b9c5d3; }
.sa-material input:checked + .sa-material-card { border-color: var(--sa-accent); box-shadow: 0 0 0 1.5px var(--sa-accent); }
.sa-material input:focus-visible + .sa-material-card { outline: 3px solid rgba(0, 168, 214, .45); outline-offset: 2px; }
.sa-material input:checked + .sa-material-card::after { content: ""; position: absolute; top: .45rem; right: .45rem; width: 1.375rem; height: 1.375rem; border-radius: 50%; background: var(--sa-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.6L12 5.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 70% no-repeat; box-shadow: 0 0 0 2px #fff; }
.sa-material-name { display: block; padding: .55rem .65rem 0; font-size: .875rem; font-weight: 600; line-height: 1.3; }
.sa-material-sub { display: block; padding: .15rem .65rem 0; font-size: .75rem; line-height: 1.35; color: var(--sa-muted); }
.sa-material-card > :last-child { padding-bottom: .6rem; }
/* mostrele de material (.sa-swatch, .sa-swatch--<material>, --photo) sunt in custom.css: le folosesc si pagina consultantului, si banda din homepage */

/* ------------------------------------------------------------------ intrebari */
.sa-q { border: 0; padding: 0; margin: 0 0 1.35rem; min-width: 0; }
.sa-q:last-child { margin-bottom: 0; }
#saBlack { margin: 1.25rem 0 0; }
.sa-q-title { display: block; width: 100%; float: none; font-size: .9375rem; font-weight: 600; margin: 0 0 .55rem; padding: 0; color: var(--sa-ink); }
.sa-q-title small { font-weight: 400; font-size: .8125rem; color: var(--sa-muted); margin-left: .25rem; }
.sa-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.sa-option { position: relative; margin: 0; }
.sa-option input { position: absolute; opacity: 0; pointer-events: none; }
.sa-option span { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: .45rem .9rem; border: 1px solid var(--sa-line); border-radius: 2rem; font-size: .875rem; line-height: 1.3; cursor: pointer; background: #fff; transition: border-color .15s, background-color .15s; }
.sa-option:hover span { border-color: #b9c5d3; }
.sa-option input:checked + span { border-color: var(--sa-accent); background: var(--sa-accent); color: #fff; font-weight: 600; }
.sa-option input:focus-visible + span { outline: 3px solid rgba(0, 168, 214, .45); outline-offset: 2px; }
/* bifele (probleme): patrat in fata, ca sa se vada ca se pot alege mai multe */
.sa-option--check span::before { content: ""; width: .95rem; height: .95rem; flex: none; border: 1.5px solid #9aa6b4; border-radius: .25rem; background: #fff center / 80% no-repeat; }
.sa-option--check input:checked + span::before { border-color: #fff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.2l2.8 2.8L12.5 4.8' fill='none' stroke='%230f3258' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

.sa-area-field { position: relative; max-width: 220px; }
.sa-area-field .form-control { padding-right: 3rem; min-height: 44px; }
.sa-area-field span { position: absolute; right: .9rem; top: 50%; transform: translateY(-50%); color: var(--sa-muted); font-size: .875rem; pointer-events: none; }

/* ------------------------------------------------------------------ recomandarea */
#saResult.sa-updating { opacity: .55; transition: opacity .15s; }
.sa-empty { border-style: dashed; border-color: #c6d0dc; background: #fbfcfd; }
.sa-empty p { color: #3f4650; margin: 0 0 .75rem; line-height: 1.55; }
.sa-empty-list { margin: 0; padding-left: 1.1rem; color: var(--sa-muted); font-size: .875rem; line-height: 1.6; }
.sa-result { border-color: var(--sa-accent); border-top-width: 4px; }
.sa-pick { border: 1px solid var(--sa-line); border-radius: .75rem; padding: 1rem; margin-bottom: .75rem; }
.sa-pick.sa-principal { background: var(--sa-soft); border-color: transparent; }
.sa-role { font-size: .8125rem; font-weight: 700; color: var(--sa-accent); }
.sa-principal .sa-role { color: var(--sa-accent-dark); }
.sa-product { display: flex; gap: .875rem; align-items: flex-start; }
.sa-product img { width: 76px; height: 76px; object-fit: contain; background: #fff; border-radius: .5rem; flex: none; }
.sa-product h3 { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.sa-notes { padding-left: 1.1rem; }
.sa-notes li { margin-bottom: .35rem; font-size: .875rem; line-height: 1.5; }
.sa-result h3.h6 { font-weight: 700; }
#saResult > .sa-card.text-danger { font-size: .9375rem; }

/* ------------------------------------------------------------------ cererea de consultanta */
.sa-contact-intro { color: #3f4650; margin: -.4rem 0 1.25rem; line-height: 1.55; max-width: 62ch; }
.sa-contact .form-control { min-height: 44px; }
.sa-submit { min-height: 46px; padding-left: 1.5rem; padding-right: 1.5rem; }
.sa-contact-thumb { width: 72px; height: 72px; flex: none; border-radius: .5rem; overflow: hidden; background: #f3f4f6; }
.sa-contact-thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.sa .form-check-input { width: 1.15rem; height: 1.15rem; margin-top: .15rem; }
.sa .form-check-label { padding-left: .25rem; }

/* ------------------------------------------------------------------ intrebari frecvente + text SEO
   O singura coloana, pe toata latimea, fiecare in panoul alb al pasilor de sus. Randurile sunt lungi pe ecran mare,
   asa ca textul e putin mai mare si mai aerisit (1.0625rem / 1.8). */
.sa-more { margin-top: 3rem; display: grid; gap: 1.25rem; }
.sa-faq, .sa-seo { background: #fff; border: 1px solid var(--sa-line); border-radius: .875rem; padding: 1.75rem 2rem; }
.sa-faq h2, .sa-seo h2 { scroll-margin-top: 100px; }
.sa-faq h2 { font-size: 1.5rem; font-weight: 700; margin: 0 0 .75rem; color: var(--sa-accent); }
.sa-faq-list { display: block; }
.sa-faq-item + .sa-faq-item { border-top: 1px solid var(--sa-line); }
.sa-faq-item summary { cursor: pointer; padding: 1.05rem 0; font-weight: 600; font-size: 1.0625rem; line-height: 1.45; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; }
.sa-faq-item summary::-webkit-details-marker { display: none; }
.sa-faq-item summary::after { content: ""; flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--sa-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 3.5v9M3.5 8h9' stroke='%230f3258' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / 55% no-repeat; transition: transform .2s, background-color .2s; }
.sa-faq-item[open] summary::after { transform: rotate(45deg); background-color: #dde7f1; }
.sa-faq-item summary:hover { color: var(--sa-accent); }
.sa-faq-item summary:focus-visible { outline: 3px solid rgba(0, 168, 214, .45); outline-offset: 2px; border-radius: .25rem; }
.sa-faq-answer { padding: 0 3.25rem 1.25rem 0; color: #3f4650; font-size: 1.0625rem; line-height: 1.8; }

.sa-seo { font-size: 1.0625rem; }
.sa-seo h2 { font-size: 1.5rem; font-weight: 700; margin: 2.25rem 0 .75rem; color: var(--sa-accent); }
.sa-seo h2:first-child { margin-top: 0; }
.sa-seo h3 { font-size: 1.1875rem; font-weight: 700; margin: 1.5rem 0 .5rem; color: var(--sa-ink); }
.sa-seo p, .sa-seo li { line-height: 1.8; color: #3f4650; }
.sa-seo p { margin: 0 0 1rem; }
.sa-seo ul, .sa-seo ol { margin: 0 0 1rem; padding-left: 1.25rem; }
.sa-seo li { margin-bottom: .45rem; }
.sa-seo li::marker { color: var(--sa-accent); }
.sa-seo strong { color: var(--sa-ink); }
.sa-seo a { color: var(--sa-accent); text-decoration: underline; text-decoration-color: rgba(15, 50, 88, .35); text-underline-offset: 3px; }
.sa-seo a:hover { text-decoration-color: currentColor; }
.sa-seo > :last-child { margin-bottom: 0; }
/* ------------------------------------------------------------------ bara de jos (telefon): recomandarea curenta */
.sa-bar { position: fixed; z-index: 1030; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 150%);
    width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: .75rem; padding: .6rem .6rem .6rem 1rem;
    background: var(--sa-accent); color: #fff; border-radius: .75rem; box-shadow: 0 8px 24px rgba(14, 42, 71, .28);
    transition: transform .25s ease; visibility: hidden; }
.sa-bar.is-visible { transform: translate(-50%, 0); visibility: visible; }
.sa-bar-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.3; }
.sa-bar-text strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-bar .btn { flex: none; background: #fff; color: var(--sa-accent); border: 0; font-weight: 600; min-height: 40px; padding: .45rem 1rem; }
.sa-bar.is-updated .sa-bar-text strong { animation: sa-flash .6s ease; }
@keyframes sa-flash { from { opacity: .2; } to { opacity: 1; } }
@media (min-width: 992px) { .sa-bar { display: none; } }

@media (prefers-reduced-motion: reduce) {
    .sa-bar, .sa-faq-item summary::after, .sa-material-card, .sa-option span { transition: none; }
    .sa-bar.is-updated .sa-bar-text strong { animation: none; }
}

/* ------------------------------------------------------------------ telefon */
@media (max-width: 575.98px) {
    .sa { padding-left: 16px; padding-right: 16px; }
    .sa-hero { padding: 1.25rem 0 1rem; }
    .sa-lead { font-size: 1rem; }
    .sa-panel, .sa-card { padding: 1.1rem; border-radius: .75rem; }
    .sa-step-title { font-size: 1.0625rem; }
    /* poza: miniatura mica langa text, butonul pe toata latimea */
    .sa-photo { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: .75rem; padding: .875rem; }
    .sa-preview { width: 64px; }
    .sa-photo-body { display: contents; }
    .sa-photo-title { align-self: center; margin: 0; font-size: .9375rem; }
    .sa-photo-btn, .sa-photo .sa-hint, .sa-status, .sa-progress, .sa-guess-box { grid-column: 1 / -1; }
    .sa-photo-btn { width: 100%; justify-content: center; min-height: 46px; font-size: 15px; }
    .sa-photo .sa-hint, .sa-status, .sa-progress, .sa-guess-box { margin-top: 0; }
    /* materialele: 3 pe rand, mostra mai joasa */
    .sa-materials { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
    .sa-swatch { aspect-ratio: 2 / 1; }
    .sa-material-name { padding: .4rem .45rem 0; font-size: .8125rem; }
    .sa-material-sub { display: none; }
    .sa-material-card > :last-child { padding-bottom: .45rem; }
    .sa-material input:checked + .sa-material-card::after { width: 1.15rem; height: 1.15rem; top: .3rem; right: .3rem; }
    .sa-option span { padding: .55rem .9rem; font-size: 14px; }
    .sa .form-control, .sa .form-select { font-size: 16px; }
    .sa-area-field { max-width: none; }
    .sa-submit { width: 100%; }
    .sa-pick { padding: .875rem; }
    .sa-product { gap: .75rem; }
    .sa-product img { width: 60px; height: 60px; }
    #saResult .btn { min-height: 42px; }
    .sa-more { margin-top: 2rem; }
    .sa-faq, .sa-seo { padding: 1.25rem 1.1rem; border-radius: .75rem; }
    .sa-faq-item summary { font-size: 1rem; gap: 1rem; }
    .sa-faq-answer, .sa-seo { font-size: 1rem; }
    .sa-faq-answer { padding-right: 0; }
    .sa-seo h2 { font-size: 1.3125rem; }
    .sa-bar { left: 72px; right: 12px; width: auto; transform: translateY(150%); }
    .sa-bar.is-visible { transform: translateY(0); }
}
