/* ===================================
   BENEFIT BOARD: THE TARIFF CARD
   First content section after the hero and the language switch. One card ported one to one from the app's popup tariff card
   (frontend possible-insurance-item-compact, popup mode): the card chrome of _card-shell.scss and
   _badges.scss, the header of _header.scss, the tiles and highlights of _tiles.scss, the stacked
   split of _layouts.scss, and the "Tarifleistungen" footer of tariff-details-panel.component.scss.
   The toggle and the panel of the third row live in benefit-card-panel.css, the detail list
   (bd-*) in benefit-detail-list.css, the area dialogs in benefit-area-dialog.css. Every value is
   the app's; the page palette plays no part on this card.
   Mobile first: the base rules are the 375 px layout (the app's stacked split below 480 px), the
   50/50 split comes through min-width. The app's colours sit on --tp-* custom properties, defined
   on the .tariff-board root by benefit-detail-list.css (the list renders inside and outside the
   card, so that stylesheet reaches every root); the campaign host (.bb-site) re-colours them there.
   =================================== */

.tariff-board {
  box-sizing: border-box;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 16px 8px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--tp-ink);
}
.tariff-board *,
.tariff-board *::before,
.tariff-board *::after {
  box-sizing: inherit;
}

.tariff-board__inner {
  display: grid;
  gap: 20px;
}

.tariff-num {
  font-variant-numeric: tabular-nums;
}

/* --- Card shell (_card-shell.scss + the popup padding of _badges.scss): frosted glass, soft shadow --- */
.tariff-card {
  position: relative;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: box-shadow 0.2s ease;
}
.tariff-card:hover {
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* The content stack of the popup card (.compact-content): header row, then the split. */
.tariff-card__content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

/* --- Header (_header.scss): the identity block flush left; no price, no grade chip on the website --- */
.tariff-card__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
  width: 100%;
}

/* .insurer-section: logo above, tariff name under it, left-aligned. */
.tariff-card__identity {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}

/* A fixed logo box, as in the app: tiny logos scale up, tall ones down, every logo sits left. */
.tariff-card__logo {
  width: 112px;
  height: 52px;
  max-height: none;
  object-fit: contain;
  object-position: left center;
}

/* Tariff name with the benefit grade right beside it, under the logo; the grade wraps below on narrow cards. */
.tariff-card__identity-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
  width: 100%;
}

/* The insurer name is hidden: the logo already names the insurer (.insurer-title). */
.tariff-card__insurer {
  display: none;
}

/* .tarif-name of the popup card: two lines at most. */
.tariff-card__tariff {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.2px;
  color: var(--tp-ink);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* --- Split row (.benefits-split-row): stacked below 480 px (_layouts.scss), 50/50 from there --- */
.tariff-card__split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--tp-line);
  align-items: stretch;
}

.tariff-card__tiles-col,
.tariff-card__highlights-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

/* The highlights as one row of chips under the tiles, also on wide screens. */
.tariff-card__highlights-col {
  align-items: center;
}

/* --- Tiles (_tiles.scss): equal tracks, three in one row, four as a 2 x 2 grid --- */
.tariff-card__tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.tariff-card__tiles[data-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tariff-card__tiles[hidden] {
  display: none;
}

.tariff-card__tile {
  --tile-bg: var(--tp-tile-bg);
  --tile-bg-hover: var(--tp-tile-bg-hover);
  --tile-ink: var(--tp-mint);
  --tile-label: var(--tp-tile-label);
  display: flex;
  min-width: 0;
}
.tariff-card__tile[data-coverage="excluded"],
.tariff-card__tile[data-coverage="unstated"] {
  --tile-bg: var(--tp-tile-grey-bg);
  --tile-bg-hover: var(--tp-tile-grey-bg-hover);
  --tile-ink: var(--tp-tile-grey-ink);
  --tile-label: var(--tp-tile-grey-label);
}

/* .benefit-item.benefit-item--button: filled, calm, borderless; the value first, the label under it. */
.tariff-card__tile-button {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 11px 6px 10px;
  border: 0;
  border-radius: 12px;
  background: var(--tile-bg);
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.tariff-card__tile-button:hover {
  background: var(--tile-bg-hover);
}
.tariff-card__tile-button:focus-visible {
  outline: 2px solid rgba(var(--tp-dialog-mint-rgb), 0.45);
  outline-offset: 2px;
}

/* .benefit-info-hint: the tiny info mark in the corner, shown on hover and focus only. */
.tariff-card__info-hint {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 12px;
  height: 12px;
  color: var(--tile-ink);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.tariff-card__tile-button:is(:hover, :focus-visible) .tariff-card__info-hint {
  opacity: 1;
}

/* .benefit-figure: value and the bracketed share on one line. */
.tariff-card__figure {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  column-gap: 4px;
  min-width: 0;
  max-width: 100%;
}

/* .benefit-value */
.tariff-card__value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.2px;
  color: var(--tile-ink);
}
/* .benefit-value--muted: the state word ("Nicht versichert", "Keine Angabe") is a sentence, not a figure. */
.tariff-card__tile[data-coverage="excluded"] .tariff-card__value,
.tariff-card__tile[data-coverage="unstated"] .tariff-card__value {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
}

/* .benefit-share */
.tariff-card__share {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--tile-ink);
  opacity: 0.8;
}

/* .benefit-label */
.tariff-card__label {
  max-width: 100%;
  overflow-wrap: break-word;
  hyphens: auto;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: var(--tile-label);
  text-align: center;
}

/* .benefit-flatrate: the uncapped area as a small, luminous bonus pill with a CSS-drawn check. */
.tariff-card__flatrate {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 3px;
  margin-top: 4px;
  padding: 1px 7px 1px 5px;
  border-radius: 999px;
  background: var(--tp-green);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(var(--tp-green-rgb), 0.35);
}
.tariff-card__flatrate::before {
  content: '\2713';
  font-size: 9px;
  line-height: 1;
}

/* --- Highlights (.detailed-benefits-section of _legacy.scss, items of _tiles.scss) --- */
.tariff-card__highlights {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 8px;
  margin: 0;
  padding: 0;
}

/* One chip per highlight: a soft pill with the check (or the GOZ+ chip) in front. */
.tariff-card__highlight {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 12px 4px 6px;
  border-radius: 999px;
  background: var(--tp-mint-soft);
}

/* .checkbox-icon.checked: the mint-green check circle */
.tariff-card__check {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--tp-green);
}

/* .detailed-benefit-text */
.tariff-card__highlight-text {
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(0, 0, 0, 0.62);
}

/* .detailed-benefit-item--goz: the reimbursement beyond the GOZ maximum rate, bold text behind the chip. */
.tariff-card__highlight--goz {
  align-items: center;
}
.tariff-card__highlight--goz .tariff-card__highlight-text {
  font-weight: 700;
  color: var(--tp-goz-ink);
}

/* The "GOZ+" chip of the detail rows (.bd-area__goz in benefit-detail-list.css): a light mint pill with
   the check, so the line reads like the GOZ+ mark the rows below repeat. */
.tariff-card__goz-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px 1px 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tp-mint) 12%, transparent);
  color: var(--tp-mint);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.5;
}
.tariff-card__goz-icon {
  width: 12px;
  height: 12px;
  flex: none;
}

/* --- Age and price in the header, coupled with the hero calculator --- */
/* The monthly price on top, the age under it, both flush right. */
.tariff-card__price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}
.tariff-card__age {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tariff-card__age-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tp-ink-3);
}
.tariff-card__amount {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.tariff-card__price-period {
  font-size: 13px;
  font-weight: 600;
  color: var(--tp-ink-3);
}
.tariff-card__price-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--tp-accent, #0E8377);
}

/* Narrow screens: the price block takes its own row, the price left and the age right of it. */
@media (max-width: 480px) {
  .tariff-card__price {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
  }
}

/* --- Wider layouts --- */
@media (min-width: 481px) {
  .tariff-board {
    padding: 56px 24px 8px;
  }
  /* The card spans the page column under its centred section title. Scoped by the section: the
     shared title rule in tariff-page-tokens.css loads later and aligns left. */
  .tariff-board .tariff-board__title {
    text-align: center;
  }
  /* A compact column instead of the full page width: name, price, tiles and extras stay close together;
     the effective price under the card keeps the same width (tariff-basics.css). */
  .tariff-card {
    width: 100%;
    max-width: 820px;
    margin-inline: auto;
    border-radius: 16px;
  }
}

/* All benefits in detail, behind the toggle under the highlights: benefit-card-panel.css. */

@media (prefers-reduced-motion: reduce) {
  .tariff-card,
  .tariff-card__info-hint {
    transition: none;
  }
}
