/* Check Device Compatibility: centered QR modal + inline verdict banner.
   Layout/treatment adapted from the theme's device-compat-popup styles. */

.compat-check {
  display: inline-block;
}

/* Trigger button — white fill, thin 1px navy border + navy text, medium
   weight, wide padding (matches the live pill). */
.compat-check__btn {
  background: #fff;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  border-radius: var(--radius-btn);
  padding: 0.7rem 3.5rem;
  font-size: 1rem;
  font-weight: 500;
}

/* Inherit the button's colour so the icon turns white on hover (solid petrol
   fill) instead of staying petrol and vanishing against the hovered background. */
.compat-check__btn i {
  color: inherit;
}

.compat-check__dialog {
  /* the global `* { margin: 0 }` reset clobbers the UA stylesheet's
     `margin: auto`, which is what centers a native <dialog> — restore it. */
  margin: auto;
  width: min(472px, calc(100vw - var(--space-4) * 2));
  max-height: min(90vh, 720px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.compat-check__dialog::backdrop {
  background: rgba(18, 48, 61, 0.55);
}

.compat-check__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  border: 0;
  background: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--color-text);
}

/* Tinted header band — depth without leaving the palette. */
.compat-check__band {
  position: relative;
  text-align: center;
  padding: 28px 32px 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 12%, transparent);
  background:
    radial-gradient(120% 90% at 50% -20%, color-mix(in srgb, var(--color-primary) 16%, #fff) 0%, transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 9%, #fff) 0%, #fff 100%);
}

.compat-check__title {
  color: var(--color-primary);
  margin: 0 0 6px;
  font-size: 1.75rem; /* fits "Check Device Compatibility" on one line */
}

.compat-check__subtitle {
  max-width: 30ch;
  margin: 0 auto;
  color: color-mix(in srgb, var(--color-primary) 75%, #000);
  font-weight: 400;
}

.compat-check__body {
  padding: 24px 32px 16px;
  text-align: center;
}

/* QR in a scanner-style frame (on-brand corner marks via 8 gradients). */
.compat-check__qr {
  --b: 3px;   /* corner thickness */
  --s: 24px;  /* corner length    */
  --c: var(--color-primary);
  display: inline-block;
  padding: 14px;
  margin-bottom: 20px;
  border-radius: 16px;
  background:
    linear-gradient(var(--c), var(--c)) 0 0,
    linear-gradient(var(--c), var(--c)) 0 0,
    linear-gradient(var(--c), var(--c)) 100% 0,
    linear-gradient(var(--c), var(--c)) 100% 0,
    linear-gradient(var(--c), var(--c)) 0 100%,
    linear-gradient(var(--c), var(--c)) 0 100%,
    linear-gradient(var(--c), var(--c)) 100% 100%,
    linear-gradient(var(--c), var(--c)) 100% 100%,
    #fff;
  background-repeat: no-repeat;
  background-size:
    var(--b) var(--s), var(--s) var(--b),
    var(--b) var(--s), var(--s) var(--b),
    var(--b) var(--s), var(--s) var(--b),
    var(--b) var(--s), var(--s) var(--b);
}

.compat-check__qr svg {
  display: block;
  width: 170px;
  height: 170px;
}

/* Dial tip as a highlighted callout. */
.compat-check__tip {
  display: flex;
  align-items: center;
  gap: 13px;
  max-width: 420px;
  margin: 0 auto 20px;
  padding: 13px 18px;
  border-radius: 12px;
  text-align: left;
  background: color-mix(in srgb, var(--color-action) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--color-action) 22%, transparent);
  color: color-mix(in srgb, var(--color-primary) 85%, #000);
  font-size: var(--text-body);
  line-height: 1.5;
}

.compat-check__tip i {
  flex: 0 0 auto;
  font-size: 20px;
  color: var(--color-action-hover);
}

.compat-check__tip b {
  color: var(--color-primary);
}

.compat-check__cta {
  min-width: 200px;
}

/* Mobile verdict banner — the trigger <button> morphed in place into a bordered
   box (mirrors the trigger's shape) with a state-coloured icon + text: green
   (supports) / amber (may support) / red (does not support). --v is the state
   colour, set per modifier below. Reset the button chrome since it's no longer
   a control. */
.compat-check__banner {
  --v: var(--color-sale);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0.7rem 1.5rem;
  border: 1px solid color-mix(in srgb, var(--v) 45%, var(--color-border));
  border-radius: var(--radius-btn);
  background: color-mix(in srgb, var(--v) 6%, #fff);
  color: var(--v);
  font: inherit;
  font-weight: 500;
  appearance: none;
  cursor: default;
}

.compat-check__banner i {
  font-size: 1.2rem;
  color: inherit;
}

.compat-check__banner--supports { --v: var(--color-sale); }
.compat-check__banner--maybe { --v: var(--color-warning); }
.compat-check__banner--unsupported { --v: var(--color-danger); }

@media (max-width: 575px) {
  .compat-check__band {
    padding: 24px 20px 18px;
  }

  .compat-check__body {
    padding: 20px 20px 14px;
  }
}
