/* ==========================================================================
   Cookie consent (#1182): bottom banner + settings view + the inline prompt
   under viv-auth's social sign-in buttons. Tokens come from main.css :root.
   Text/ground pairs (WCAG AA, checked in the #1182 decision sub-issue):
   black-10 / black-20 / grey-40 on white, white on teal, teal on white.
   ========================================================================== */
.vivce-consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 9500;
  padding: 0 16px 16px;
  pointer-events: none;
}

.vivce-consent__card {
  pointer-events: auto;
  box-sizing: border-box;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 22px 24px 24px;
  background: var(--color-white, #ffffff);
  color: var(--color-black-10, #18191C);
  border: 1px solid var(--color-grey-90, #E3E4E7);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 22px 44px -20px rgba(16, 86, 106, 0.38), 0 0 54px rgba(0, 0, 0, 0.07);
  font-family: var(--font-body, "Inter", sans-serif);
  opacity: 0;
  transform: translateY(24px);
}

.vivce-consent.is-open .vivce-consent__card {
  opacity: 1;
  transform: none;
}

.vivce-consent__title {
  margin: 0 0 8px;
  font-family: var(--font-display, "Montserrat", sans-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-navy-deep, #0B3F4E);
}

/* Programmatic focus target when a view opens; it is not operable, so no ring. */
.vivce-consent__title:focus {
  outline: none;
}

.vivce-consent__text {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-black-20, #2F3137);
}

.vivce-consent__link,
.vivce-consent__textbtn {
  color: var(--color-teal, #0D7377);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.vivce-consent__link:hover,
.vivce-consent__textbtn:hover {
  color: var(--color-teal-deep, #0A5C5F);
  text-decoration-thickness: 2px;
}

.vivce-consent__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.vivce-consent__actions .button {
  min-height: 44px;
  padding: 8px 20px;
  font-size: 15px;
}

.vivce-consent__textbtn {
  margin-left: auto;
  padding: 8px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.vivce-consent__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.vivce-consent__close {
  flex: none;
  width: 40px;
  height: 40px;
  margin: -8px -8px 0 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--color-grey-40, #5E626E);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.vivce-consent__close:hover {
  background: var(--color-wash, #E6F4F4);
  color: var(--color-navy-deep, #0B3F4E);
}

.vivce-consent__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--color-grey-90, #E3E4E7);
}

.vivce-consent__row:last-of-type {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-grey-90, #E3E4E7);
}

.vivce-consent__row-text label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-black-10, #18191C);
}

.vivce-consent__row-text p {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-grey-40, #5E626E);
}

/* The on/off switch: a styled checkbox, 3:1 against white in both states. */
.vivce-consent__switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 44px;
  height: 24px;
  margin: 2px 0 0;
  border: 2px solid var(--color-grey-40, #5E626E);
  border-radius: 12px;
  background: var(--color-white, #ffffff);
  cursor: pointer;
}

.vivce-consent__switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-grey-40, #5E626E);
}

.vivce-consent__switch:checked {
  border-color: var(--color-teal, #0D7377);
  background: var(--color-teal, #0D7377);
}

.vivce-consent__switch:checked::after {
  left: 22px;
  background: var(--color-white, #ffffff);
}

.vivce-consent__switch:disabled {
  cursor: default;
  border-color: var(--color-teal-deep, #0A5C5F);
  background: var(--color-teal-deep, #0A5C5F);
}

/* Inline prompt printed under .viv-auth-social-buttons when a click needs consent first. */
.vivce-consent-inline {
  margin: 12px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--color-wash-line, #C9E6E4);
  border-radius: var(--radius-lg, 12px);
  background: var(--color-wash, #E6F4F4);
  color: var(--color-black-10, #18191C);
}

.vivce-consent-inline p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
}

.vivce-consent-inline .vivce-consent__actions .button {
  min-height: 40px;
}

@media (prefers-reduced-motion: no-preference) {
  .vivce-consent__card {
    transition: opacity 0.2s ease, transform 0.25s ease;
  }

  .vivce-consent__switch::after {
    transition: left 0.15s ease;
  }
}

@media (max-width: 640px) {
  .vivce-consent {
    padding: 0;
  }

  .vivce-consent__card {
    width: 100%;
    padding: 18px 16px 20px;
    border-radius: 12px 12px 0 0;
  }

  .vivce-consent__actions .button {
    width: 100%;
  }

  .vivce-consent__textbtn {
    margin: 4px auto 0;
  }
}
