/* ==========================================================================
 *  Wienerberger / Tondach roof calculators - page styles (all countries, all roof types)
 *  Look of the newer Wienerberger apps (onboarding, warranty dashboard): the same --wb-* tokens,
 *  black primary actions, red only as accent, square corners, hairline borders, system font.
 *  Self-contained: the pages do not need bootstrap.min.css, style.css, web fonts or jQuery.
 * ========================================================================== */
:root {
  --wb-red: #DC1E24;
  --wb-red-dark: #B81820;
  --wb-primary: #0f172a;
  --wb-primary-hover: #1e293b;
  --wb-primary-active: #020617;
  --wb-text: #0f172a;
  --wb-text-muted: #64748b;
  --wb-text-label: #334155;
  --wb-text-subtle: #94a3b8;
  --wb-bg: #ffffff;
  --wb-bg-subtle: #f8fafc;
  --wb-disabled-bg: #f1f5f9;
  --wb-border: #e2e8f0;
  --wb-border-strong: #cbd5e1;
  --wb-error-bg: #fef2f2;   --wb-error-text: #991b1b;   --wb-error-border: #fecaca;
  --wb-success-bg: #ecfdf5; --wb-success-text: #065f46; --wb-success-border: #a7f3d0;
  --wb-radius: 0px;
  --wb-shadow-focus: 0 0 0 3px rgba(15, 23, 42, 0.12);
  --wb-shadow-error: 0 0 0 3px rgba(220, 30, 36, 0.12);
  --wb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.wb-calc {
  margin: 0;
  font-family: var(--wb-font);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--wb-text);
  background: var(--wb-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
img { border: 0; }
a { color: var(--wb-primary); }
a:hover { color: var(--wb-red); }
button, input, select { margin: 0; font-family: inherit; font-size: inherit; line-height: inherit; }

/* ---------- Page ---------- */
.wb-container { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem 2.5rem; }
.wb-title { margin: 0 0 1.25rem; font-size: 1.5rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; color: var(--wb-text); }

/* Panels: flat, hairline border, no shadow */
.wb-card { margin: 0 0 1rem; background: var(--wb-bg); border: 1px solid var(--wb-border); border-radius: var(--wb-radius); }
.wb-card-body { padding: 1.25rem; }
/* the roof pictures have an off-white background (#fffffb): the same colour around them hides their edges */
.wb-figure { margin: 0; padding: 1rem 1.25rem; text-align: center; background: #ffffff; border-bottom: 1px solid var(--wb-border); }
.wb-figure img { display: inline-block; width: 600px; max-width: 100%; height: auto; vertical-align: top; }

/* Two columns from 768 px, one column on phones */
.wb-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem 1.25rem; }
@media (min-width: 768px) {
  .wb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wb-wide { grid-column: 1 / -1; }
}
.wb-grid + .wb-check { margin-top: 1.25rem; }
.wb-check + .wb-grid, .wb-grid + .wb-grid { margin-top: 1rem; }

/* ---------- Fields ---------- */
.wb-field { min-width: 0; }
/* Side by side, a label on two lines must not push its field lower than the neighbour's:
   label and field box share two rows of the grid (browsers without subgrid simply stack them). */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 768px) {
    .wb-grid { row-gap: 0; margin-bottom: -1rem; }
    .wb-field { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; padding-bottom: 1rem; }
    .wb-field > .wb-label { align-self: end; }
  }
}
.wb-label { display: block; margin: 0 0 0.4rem; font-size: 0.82rem; font-weight: 600; line-height: 1.35; color: var(--wb-text-label); }
.wb-control {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  font-size: 1rem; /* 16 px: phones (iOS) do not zoom into the field */
  line-height: 1.5;
  color: var(--wb-text);
  background-color: var(--wb-bg);
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius);
  box-shadow: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wb-control:focus { outline: 0; border-color: var(--wb-primary); box-shadow: var(--wb-shadow-focus); }
.wb-control:disabled { background-color: var(--wb-disabled-bg); color: var(--wb-text-muted); }
select.wb-control {
  padding-right: 2.25rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23334155' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
}
select.wb-control::-ms-expand { display: none; }
select.wb-control:-moz-focusring { color: transparent; text-shadow: 0 0 0 var(--wb-text); }
.wb-control.is-invalid { border-color: var(--wb-red); }
.wb-control.is-invalid:focus { border-color: var(--wb-red); box-shadow: var(--wb-shadow-error); }
.wb-hint { margin: 0.35rem 0 0; font-size: 0.8rem; line-height: 1.4; color: var(--wb-text-muted); }
.wb-feedback { margin: 0.35rem 0 0; font-size: 0.8125rem; line-height: 1.4; color: var(--wb-error-text); }

/* ---------- Checkboxes: square, black when ticked ---------- */
.wb-check { position: relative; margin: 0.75rem 0; padding-left: 1.875rem; min-height: 1.3rem; }
.wb-check-input {
  position: absolute;
  top: 0.05rem;
  left: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  cursor: pointer;
  background-color: var(--wb-bg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  border: 1px solid var(--wb-border-strong);
  border-radius: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.wb-check-input:checked {
  background-color: var(--wb-primary);
  border-color: var(--wb-primary);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}
.wb-check-input:focus { outline: 0; border-color: var(--wb-primary); box-shadow: var(--wb-shadow-focus); }
.wb-check-input.is-invalid { border-color: var(--wb-red); }
.wb-check-input.is-invalid:focus { box-shadow: var(--wb-shadow-error); }
.wb-check-label { display: block; font-size: 0.875rem; line-height: 1.5; color: var(--wb-text-label); cursor: pointer; }
.wb-check-input.is-invalid + .wb-check-label { color: var(--wb-error-text); }
/* larger touch targets on phones and tablets */
@media (max-width: 991.98px) {
  .wb-check { padding-left: 2.1rem; min-height: 1.4rem; }
  .wb-check-input { top: 0; width: 1.35rem; height: 1.35rem; }
}

/* ---------- Consent text, messages, button ---------- */
.wb-legal { margin: 1rem 0 0; font-size: 0.8rem; line-height: 1.5; color: var(--wb-text-muted); }
.wb-legal a { color: var(--wb-text-label); text-decoration: underline; text-underline-offset: 2px; }
.wb-legal a:hover { color: var(--wb-red); }

.wb-alert { margin: 1.25rem 0 0; padding: 0.75rem 1rem; font-size: 0.875rem; border: 1px solid transparent; border-radius: var(--wb-radius); }
.wb-alert:empty { display: none; }
.wb-alert-danger { background: var(--wb-error-bg); color: var(--wb-error-text); border-color: var(--wb-error-border); }
.wb-alert-success { background: var(--wb-success-bg); color: var(--wb-success-text); border-color: var(--wb-success-border); }

.wb-actions { margin-top: 1.25rem; }
.wb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  border: 1px solid transparent;
  border-radius: var(--wb-radius);
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.wb-btn-primary { color: #fff; background-color: var(--wb-primary); border-color: var(--wb-primary); }
.wb-btn-primary:hover { color: #fff; background-color: var(--wb-primary-hover); border-color: var(--wb-primary-hover); }
.wb-btn-primary:active { background-color: var(--wb-primary-active); border-color: var(--wb-primary-active); }
.wb-btn:focus { outline: 0; }
.wb-btn:focus-visible { outline: 2px solid var(--wb-primary); outline-offset: 2px; }
.wb-btn:disabled { opacity: 0.65; cursor: default; }
.wb-btn-primary:disabled, .wb-btn-primary:disabled:hover { background-color: var(--wb-primary); border-color: var(--wb-primary); }
.wb-btn-lg { min-height: 48px; padding: 0.8rem 1.1rem; font-size: 0.95rem; }
/* the calculate button spans the whole form on every screen, so nobody overlooks it */
.wb-actions .wb-btn { display: flex; width: 100%; }

/* Spam trap, never shown */
.wb-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Phones ---------- */
@media (max-width: 575.98px) {
  .wb-container { padding: 1rem 1rem 2rem; }
  .wb-title { font-size: 1.35rem; margin-bottom: 1rem; }
  .wb-card-body { padding: 1rem; }
  .wb-figure { padding: 0.75rem; }
}
