/*
 * The porosity test page (views/porositytest.hbs).
 *
 * These rules lived in two <style> blocks inside the template, re-sent
 * with every page view (cnas#4). They are the same rules, in the same
 * place in the cascade: the template links this sheet where the blocks
 * used to be. The first block was media="screen", so its rules sit
 * inside @media screen {}.
 */

@media screen {
  :root {
      /* Chevu brand kernel tokens (see cloud/public/app.css) */
      --ink: #0f0f1a;
      --ink-soft: #5c6360;
      --green: #3e533f;
      --green-hover: #2c3f2d;
      --sage: #bcd3c2;
      --mist: #eef3ef;
      --cream: #faf9f6;
      --line: #e5e1d8;
  }

  * { box-sizing: border-box; }

  body {
      background: var(--cream);
      color: var(--ink);
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      margin: 0;
      padding: 0;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      -webkit-font-smoothing: antialiased;
  }

  h1, h2, h3, .btnatag {
      font-family: 'Montserrat', 'Inter', sans-serif;
  }

  .formstyle { margin-bottom: 30px; width: 100%; }

  .container { width: 100%; }

  /* Top bar — logo left, language selector top-right. Matches the
     results page (.cx-top / .cx-langs) so the two pages are
     consistent. */
  .cx-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      /* body is a flex column, so `margin:0 auto` would shrink-wrap
         this bar instead of spanning the width; align-self+width
         gives a full 640px bar (logo left, langs right). */
      align-self: center;
      width: 100%;
      max-width: 640px;
      padding: 20px 24px 4px;
  }
  .cx-top img { width: 104px; height: auto; }
  .cx-langs { display: flex; gap: 4px; }
  .cx-langs a {
      font-family: 'Montserrat', 'Inter', sans-serif;
      font-size: 12px;
      font-weight: 700;
      text-decoration: none;
      color: var(--ink-soft);
      padding: 5px 9px;
      border-radius: 999px;
      border: 1px solid transparent;
  }
  .cx-langs a.on {
      color: var(--green-hover);
      background: #fff;
      border-color: var(--sage);
  }

  /* Flat — no card, no border, no shadow. The cream page
     background IS the surface. */
  .container>.formwp {
      max-width: 640px;
      margin: 0 auto 56px;
      padding: 8px 24px 40px;
  }

  h1 {
      font-size: 1.7rem;
      letter-spacing: -.01em;
      margin: 4px 0 12px;
      text-align: center;
  }

  .formwp>p, .formwp form>p {
      color: var(--ink-soft);
      line-height: 1.65;
      text-align: center;
  }

  h2 { font-size: 1.2rem; margin: 30px 0 6px; }
  h3 { font-size: 1.02rem; line-height: 1.5; margin: 26px 0 10px; font-weight: 600; }

  .section-lede {
      color: var(--ink-soft);
      font-size: .92rem;
      margin: -2px 0 18px;
      line-height: 1.5;
  }

  /* ── Progress ─────────────────────────────── */
  #wizard-progress-wrap {
      position: sticky;
      top: 0;
      z-index: 5;
      background: var(--cream);
      padding: 14px 0 16px;
      margin: 0 0 4px;
  }

  #wizard-progress {
      text-align: center;
      font-weight: 600;
      font-size: .82rem;
      letter-spacing: .07em;
      text-transform: uppercase;
      color: var(--ink-soft);
      margin-bottom: 10px;
  }

  #wizard-progress-track {
      height: 6px;
      border-radius: 99px;
      background: var(--mist);
      overflow: hidden;
  }

  #wizard-progress-bar {
      height: 100%;
      width: 33%;
      border-radius: 99px;
      background: var(--green);
      transition: width .35s ease;
  }

  /* ── Inputs — flat mist fill, no border by default ───────── */
  .inputstyle, select, input[type="tel"] {
      width: 100%;
      padding: 0 16px;
      min-height: 50px;
      background: var(--mist);
      border: 1.5px solid transparent;
      border-radius: 12px;
      margin: 10px 0 16px;
      font-size: 16px;
      color: var(--ink);
      transition: border-color .2s ease, background .2s ease;
  }

  .inputstyle:focus, select:focus, input[type="tel"]:focus {
      outline: none;
      border-color: var(--green);
      background: #fff;
  }

  select {
      height: 50px;
      margin-top: 10px;
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%235c6360' stroke-width='1.6' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 16px center;
  }

  label { font-weight: 500; font-size: .92rem; color: var(--ink); }

  .date-grid-wp {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 10px;
  }

  .grid-item { text-align: start; }

  .dobselect {
      width: 100%;
      height: 50px;
      margin: 0;
      border: 1.5px solid transparent;
      border-radius: 12px;
      background: var(--mist);
      padding: 0 14px;
  }

  /* ── Kontak section ───────────────────────── */
  .kontak-section {
      background: var(--mist);
      border-radius: 18px;
      padding: 20px 20px 6px;
      margin: 26px 0 8px;
  }

  .kontak-section h2 {
      margin: 0 0 4px;
      font-size: 1.05rem;
  }

  .kontak-section .section-lede { margin-top: 0; text-align: left; }

  /* Inputs default to the mist fill for contrast against the
     cream page background — but inside this section the
     container itself IS mist, so same-color inputs would be
     invisible. Give them a white fill instead so they read as
     distinct fields against the section's own background. */
  .kontak-section .inputstyle,
  .kontak-section select,
  .kontak-section input[type="tel"] {
      background: #fff;
  }

  .kontak-section .inputstyle:focus,
  .kontak-section select:focus {
      background: #fff;
  }

  /* intl-tel-input: let it fill the flat input style */
  .iti { width: 100%; }
  .iti input.inputstyle { margin-bottom: 0; }

  .direct-call-toggle { margin: 18px 0 4px; }

  .direct-call-toggle p {
      font-weight: 500;
      font-size: .92rem;
      color: var(--ink);
      margin-bottom: 10px;
  }

  .toggle-options { display: flex; gap: 18px; }

  .toggle-options label {
      display: flex;
      align-items: center;
      gap: 7px;
      cursor: pointer;
      font-weight: 400;
      color: var(--ink-soft);
  }

  .toggle-options input[type="radio"] { accent-color: var(--green); width: 18px; height: 18px; }

  .direct-call-group {
      display: none;
      margin-top: 6px;
      animation: fadeIn .25s ease;
  }

  .direct-call-group.visible { display: block; }

  @keyframes fadeIn {
      from { opacity: 0; transform: translateY(-6px); }
      to { opacity: 1; transform: translateY(0); }
  }

  /* ── Buttons ──────────────────────────────── */
  .btnatag {
      display: block;
      width: 100%;
      min-height: 54px;
      border: 0;
      border-radius: 12px;
      background-color: var(--green) !important;
      color: white !important;
      font-size: 1rem;
      font-weight: 600;
      letter-spacing: .03em;
      cursor: pointer;
      margin-top: 10px;
      transition: background-color .2s ease, transform .1s ease;
  }

  .btnatag:hover { background-color: var(--green-hover) !important; }
  .btnatag:active { transform: scale(.99); }

  .btnatag.btn-secondary {
      background-color: var(--mist) !important;
      color: var(--ink) !important;
      margin-bottom: 10px;
  }

  .btnatag.btn-secondary:hover { background-color: var(--sage) !important; }

  #logout { text-align: end; margin: 20px; }
  #logout>a { color: #b3392f; }

  @media (max-width: 640px) {
      .container>.formwp {
          max-width: 100%;
          margin: 0 4px 40px;
          padding: 4px 14px 32px;
      }

      .cx-top { padding: 16px 14px 4px; }
      .cx-top img { width: 92px; }
      .date-grid-wp { gap: 8px; }
  }
}

/* ── Question choices — flat mist fill, no border box ─────── */
.choicewp {
    margin-bottom: 10px;
    border-radius: 14px;
    border: 1.5px solid transparent;
    background: var(--mist);
    transition: background .2s ease, border-color .2s ease;
}

.choicewp:hover { background: #e5ede8; }

.choicewp:has(input:checked) {
    background: #e2ece4;
    border-color: var(--green);
}

form {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
}

.choicewp>label {
    display: block;
    cursor: pointer;
    font-weight: 500;
    padding: 15px 16px;
}

.choicewp>label>input {
    position: absolute;
    left: -9999px;
}

.choicewp>label>span {
    display: flex;
    align-items: center;
    line-height: 1.45;
    color: var(--ink);
}

.choicewp>label>span:before {
    display: flex;
    flex-shrink: 0;
    content: "";
    background-color: #fff;
    width: 1.35em;
    height: 1.35em;
    border-radius: 50%;
    margin-right: 14px;
    transition: box-shadow .2s ease;
    box-shadow: inset 0 0 0 2px #a9b3ac;
}

.choicewp>label>input:checked+span:before {
    box-shadow: inset 0 0 0 0.42em var(--green);
}

.choicewp>label>input:focus-visible+span:before {
    box-shadow: inset 0 0 0 2px var(--green),
        0 0 0 3px rgba(62, 83, 63, .18);
}

/* ── Review step — flat, warm, on-brand ───────────────────── */
#review-summary { text-align: left; }

.review-card {
    background: var(--mist);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 14px;
}

.review-card h3 {
    margin: 0 0 10px;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--green);
}

.review-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(15, 15, 26, .06);
    font-size: .95rem;
}

.review-row:last-child { border-bottom: none; }
.review-row .review-label { color: var(--ink-soft); flex-shrink: 0; }
.review-row .review-value { font-weight: 500; text-align: right; }

.review-qa {
    padding: 10px 0;
    border-bottom: 1px solid rgba(15, 15, 26, .06);
}

.review-qa:last-child { border-bottom: none; }
.review-qa .review-q { font-weight: 600; font-size: .9rem; margin-bottom: 3px; }
.review-qa .review-a { color: var(--ink-soft); font-size: .92rem; }

.review-consent {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--mist);
    border-radius: 14px;
    padding: 16px 18px;
    margin: 18px 0 6px;
}

.review-consent input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--green);
    flex-shrink: 0;
}

.review-consent label {
    font-weight: 400;
    font-size: .88rem;
    line-height: 1.5;
    color: var(--ink-soft);
}

/* A failed submit sent the visitor back — same red as the
   field errors, on a soft tint so it reads as a notice. */
.submit-notice {
    background: #fbeceb;
    color: #8a2b23;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 4px 0 18px;
    font-size: .95rem;
    line-height: 1.5;
    text-align: left;
}

@media screen and (-webkit-min-device-pixel-ratio:0) {
    select, textarea, input { font-size: 16px; }
}
