/* Biometric consent, before a Didit ID check. Uses the app tokens. */

.consent-root,
.consent-root * {
  box-sizing: border-box;
}

.consent-root {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: flex;
  justify-content: center;
  background: var(--aisle-cream, #F7F1E6);
  color: var(--aisle-ink, #1C1917);
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
}

.consent-root [hidden] {
  display: none !important;
}

html.consent-lock,
html.consent-lock body {
  overflow: hidden;
}

.consent-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  height: 100%;
  min-height: 0;
  background: var(--aisle-cream, #F7F1E6);
}

.consent-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 8px;
}

img.consent-logo.aisle-lockup {
  height: 28px;
  max-height: 28px;
  width: auto;
  margin: 0;
}

.consent-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--aisle-sage, #D7E6D4);
  color: var(--aisle-ink, #1C1917);
  cursor: pointer;
}

.consent-close svg {
  width: 16px;
  height: 16px;
  display: block;
}

.consent-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 20px 16px;
}

.consent-draft {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 8px;
  border: 2px dashed var(--aisle-muted, #8A837A);
  border-radius: 8px;
  color: var(--rt-muted, #5F5A54);
  font-size: var(--aisle-caption-size, 13px);
  font-weight: var(--aisle-caption-weight, 500);
  line-height: 1.3;
}

.consent-eyebrow {
  margin: 0 0 6px;
  color: var(--rt-muted, #5F5A54);
  font-size: var(--aisle-section-size, 12px);
  font-weight: var(--aisle-section-weight, 700);
  letter-spacing: var(--aisle-section-track, 0.06em);
  text-transform: uppercase;
}

.consent-title {
  margin: 0 0 8px;
  color: var(--aisle-ink, #1C1917);
  font-size: var(--aisle-title-size, 28px);
  font-weight: var(--aisle-title-weight, 700);
  line-height: var(--aisle-title-lh, 1.15);
  letter-spacing: var(--aisle-title-track, -0.4px);
}

.consent-title-sm {
  margin: 0 0 8px;
  color: var(--aisle-ink, #1C1917);
  font-size: var(--aisle-title-sm-size, 24px);
  font-weight: var(--aisle-title-sm-weight, 700);
  line-height: 1.15;
  letter-spacing: -0.3px;
}

.consent-intro,
.consent-sheet-copy {
  margin: 0 0 16px;
  color: var(--aisle-ink, #1C1917);
  font-size: var(--aisle-body-size, 15px);
  font-weight: var(--aisle-body-weight, 400);
  line-height: var(--aisle-body-lh, 1.45);
}

.consent-em {
  color: #1C1917;
  font-weight: 600;
}

.consent-sections {
  background: var(--aisle-white, #FFFFFF);
  border-radius: 18px;
  padding: 4px 16px;
}

.consent-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 2px solid #F0EADF;
}

.consent-row:first-child {
  border-top: 0;
}

.consent-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--aisle-sage, #D7E6D4);
  color: var(--aisle-produce-on-sage, #1A6B43);
}

.consent-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.consent-row h2,
.consent-subhead {
  margin: 0 0 4px;
  color: var(--aisle-ink, #1C1917);
  font-size: var(--aisle-sub-size, 16px);
  font-weight: var(--aisle-sub-weight, 600);
  line-height: 1.3;
}

.consent-row p,
.consent-row li,
.consent-field {
  margin: 0;
  color: var(--rt-muted, #5F5A54);
  font-size: var(--aisle-body-size, 15px);
  font-weight: var(--aisle-body-weight, 400);
  line-height: var(--aisle-body-lh, 1.45);
}

.consent-row ul {
  margin: 6px 0;
  padding-left: 18px;
}

.consent-row li + li {
  margin-top: 4px;
}

.consent-follow {
  margin-top: 8px;
}

.consent-mark {
  background: #F0EADF;
  color: var(--aisle-ink, #1C1917);
  border-radius: 4px;
  padding: 0 2px;
}

.consent-learn {
  display: flex;
  flex-direction: column;
  margin: 8px 0 0;
}

.consent-learn-label {
  margin: 12px 0 0;
}

.consent-link {
  color: var(--aisle-produce, #1F7A4D);
  font-size: var(--aisle-body-size, 15px);
  font-weight: 600;
  line-height: 1.35;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-learn .consent-link {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.consent-wa {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: var(--aisle-sage, #D7E6D4);
  color: var(--aisle-ink, #1C1917);
}

.consent-wa .consent-eyebrow {
  color: var(--aisle-produce-on-sage, #1A6B43);
}

.consent-wa .consent-intro,
.consent-wa .consent-field,
.consent-wa .consent-plain {
  color: var(--aisle-ink, #1C1917);
}

.consent-wa .consent-link {
  color: var(--aisle-produce-on-sage, #1A6B43);
}

.consent-wa .consent-mark {
  background: #FFFFFF;
}

.consent-field {
  margin: 8px 0 0;
}

.consent-field b,
.consent-label-strong {
  font-weight: 600;
  color: var(--aisle-ink, #1C1917);
}

.consent-subhead {
  margin: 16px 0 4px;
}

.consent-plain {
  margin: 8px 0 0;
  color: var(--aisle-ink, #1C1917);
  font-size: var(--aisle-body-size, 15px);
  font-weight: 400;
  line-height: var(--aisle-body-lh, 1.45);
}

.consent-policy-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
}

.consent-check {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 12px;
  border: 2px solid #E7DFD2;
  border-radius: 14px;
  background: var(--aisle-white, #FFFFFF);
  cursor: pointer;
}

.consent-wa .consent-check {
  border-color: #FFFFFF;
}

.consent-check.is-on {
  border-color: var(--aisle-produce, #1F7A4D);
}

.consent-check input {
  position: absolute;
  width: 24px;
  height: 24px;
  margin: 0;
  opacity: 0;
}

.consent-tick {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin-top: 1px;
  border: 2px solid var(--rt-muted, #5F5A54);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--aisle-white, #FFFFFF);
  color: var(--aisle-white, #FFFFFF);
}

.consent-tick svg {
  display: none;
  width: 16px;
  height: 16px;
}

.consent-check.is-on .consent-tick {
  background: var(--aisle-produce, #1F7A4D);
  border-color: var(--aisle-produce, #1F7A4D);
}

.consent-check.is-on .consent-tick svg {
  display: block;
}

.consent-check input:focus-visible + .consent-tick {
  outline: 2px solid var(--aisle-produce, #1F7A4D);
  outline-offset: 2px;
}

.consent-check-copy {
  min-width: 0;
  color: var(--aisle-ink, #1C1917);
  font-size: var(--aisle-body-size, 15px);
  font-weight: var(--aisle-body-weight, 400);
  line-height: var(--aisle-body-lh, 1.45);
  overflow-wrap: anywhere;
}

.consent-required {
  display: block;
  width: fit-content;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--aisle-sage, #D7E6D4);
  color: var(--aisle-produce-on-sage, #1A6B43);
  font-size: var(--aisle-caption-size, 13px);
  font-weight: 600;
  line-height: 1.3;
}

.consent-biometric {
  margin-top: 16px;
}

.consent-footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  padding: 8px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--aisle-cream, #F7F1E6);
}

.consent-hint,
.consent-helper,
.consent-error {
  margin: 0;
  color: var(--rt-muted, #5F5A54);
  font-size: var(--aisle-caption-size, 13px);
  font-weight: var(--aisle-caption-weight, 500);
  line-height: 1.4;
  text-align: center;
}

.consent-hint {
  margin-bottom: 8px;
}

.consent-helper {
  margin-top: 8px;
}

.consent-error {
  margin-top: 8px;
  color: var(--tomato, #C9362A);
}

.consent-agree,
.consent-notnow,
.consent-continue,
.consent-verify {
  box-sizing: border-box;
  width: 100%;
  height: 52px;
  border-radius: 14px;
  padding: 0 16px;
  font-family: inherit;
  font-size: var(--aisle-btn-size, 16px);
  font-weight: var(--aisle-btn-weight, 600);
  line-height: 1.2;
  cursor: pointer;
}

.consent-notnow {
  margin-top: 10px;
}

.consent-agree,
.consent-continue {
  border: 2px solid var(--tomato, #C9362A);
  background: var(--tomato, #C9362A);
  color: #FFFFFF;
}

.consent-agree[aria-disabled="true"] {
  border-color: #E9E2D6;
  background: #E9E2D6;
  color: var(--rt-muted, #5F5A54);
}

.consent-notnow,
.consent-verify {
  border: 2px solid var(--aisle-ink, #1C1917);
  background: transparent;
  color: var(--aisle-ink, #1C1917);
}

.consent-sheet-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.consent-scrim {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 23, 0.38);
}

.consent-sheet {
  position: relative;
  max-height: 88%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: var(--aisle-cream, #F7F1E6);
}

.consent-grabber {
  width: 36px;
  height: 4px;
  margin: 2px auto 12px;
  border-radius: 2px;
  background: #E7DFD2;
}

.consent-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.consent-sheet-actions .consent-continue,
.consent-sheet-actions .consent-verify {
  margin: 0;
}

.consent-legal {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  background: var(--aisle-cream, #F7F1E6);
}

.consent-legal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
}

.consent-legal-back {
  border: 0;
  background: transparent;
  color: var(--aisle-produce, #1F7A4D);
  font-family: inherit;
  font-size: var(--aisle-btn-size, 16px);
  font-weight: var(--aisle-btn-weight, 600);
  min-height: 44px;
  padding: 0 8px;
  cursor: pointer;
}

.consent-legal-title {
  min-width: 0;
  color: var(--aisle-ink, #1C1917);
  font-size: var(--aisle-caption-size, 13px);
  font-weight: var(--aisle-caption-weight, 500);
}

.consent-legal iframe {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: #FFFFFF;
}

@media (min-width: 960px) {
  .consent-root:not(.is-native) {
    align-items: center;
    padding: 24px 16px;
  }

  .consent-root:not(.is-native) .consent-screen {
    flex: 0 1 auto;
    width: 560px;
    max-width: 560px;
    height: auto;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 28px 32px 20px;
    border-radius: 24px;
    background: var(--aisle-white, #FFFFFF);
  }

  .consent-root:not(.is-native) .consent-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }

  .consent-root:not(.is-native) .consent-top,
  .consent-root:not(.is-native) .consent-scroll,
  .consent-root:not(.is-native) .consent-footer {
    padding-left: 0;
    padding-right: 0;
  }

  .consent-root:not(.is-native) .consent-top {
    padding-top: 0;
  }

  .consent-root:not(.is-native) .consent-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "hint notnow agree"
      "helper helper helper"
      "error error error";
    column-gap: 10px;
    row-gap: 8px;
    align-items: center;
    padding-bottom: 0;
    background: var(--aisle-white, #FFFFFF);
  }

  .consent-root:not(.is-native) .consent-sections {
    background: var(--aisle-cream, #F7F1E6);
  }

  .consent-root:not(.is-native) .consent-hint {
    grid-area: hint;
    margin: 0;
    text-align: left;
  }

  .consent-root:not(.is-native) .consent-notnow {
    grid-area: notnow;
    width: auto;
    min-width: 128px;
    height: 48px;
    margin: 0;
    background: var(--aisle-white, #FFFFFF);
  }

  .consent-root:not(.is-native) .consent-agree {
    grid-area: agree;
    width: auto;
    min-width: 128px;
    height: 48px;
  }

  .consent-root:not(.is-native) .consent-helper {
    grid-area: helper;
    margin: 0;
  }

  .consent-root:not(.is-native) .consent-error {
    grid-area: error;
  }
}
