/* Ideal Age Gate – (C) 2026 IdealPC Sàrl – GNU General Public License version 2 or later */

/* Page hidden while the visitor has not confirmed; the gate stays visible (visibility is inherited). */
/* Visitor has not confirmed yet (class set in <head>): no scrolling, gate shown at once.
   « iag-hide »: the page itself is hidden (option « Hide the page behind »); the gate stays visible. */
html.iag-locked { overflow: hidden !important; }
html.iag-locked body { overflow: hidden !important; }
html.iag-locked.iag-hide body { visibility: hidden !important; }
html.iag-locked .iag { visibility: visible !important; display: flex !important; }

.iag {
  --iag-bg: #ffffff;
  --iag-color: #111111;
  --iag-muted: rgba(0, 0, 0, .62);
  --iag-accept-bg: #111111;
  --iag-accept-fg: #ffffff;
  --iag-deny-bg: transparent;
  --iag-deny-fg: #111111;
  --iag-deny-border: rgba(0, 0, 0, .35);
  --iag-icon-color: currentColor;
  --iag-overlay: rgba(0, 0, 0, .7);
  --iag-radius: 14px;
  --iag-width: 720px;
  --iag-title-size: clamp(22px, 4vw, 30px);
  --iag-text-size: 16px;

  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  background: var(--iag-overlay);
  font-size: var(--iag-text-size);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
.iag[hidden] { display: none; }
.iag.iag-blur { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

.iag-style-dark {
  --iag-bg: #111827;
  --iag-color: #f9fafb;
  --iag-muted: rgba(255, 255, 255, .7);
  --iag-accept-bg: #ffffff;
  --iag-accept-fg: #111827;
  --iag-deny-fg: #f9fafb;
  --iag-deny-border: rgba(255, 255, 255, .45);
}

/* Static preview in the YOOtheme Pro builder */
.iag.iag-inline {
  position: relative;
  inset: auto;
  z-index: auto;
  display: flex;
  min-height: 320px;
  border-radius: 6px;
}

.iag-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--iag-width);
  max-height: calc(100vh - 32px);
  margin: auto;
  overflow: auto;
  border-radius: var(--iag-radius);
  text-align: center;
}
/* Colours: ours, or the UIkit card of the YOOtheme theme. */
.iag:not(.iag-style-yootheme) .iag-box { background: var(--iag-bg); color: var(--iag-color); }
.iag-inline .iag-box { max-height: none; }
.iag-box:focus { outline: none; }
.iag-box.iag-full { max-width: none; }
.iag-box.uk-card { padding: 0; }

.iag-shadow-none { box-shadow: none; }
.iag-shadow-sm { box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.iag-shadow-md { box-shadow: 0 18px 55px rgba(0, 0, 0, .28); }
.iag-shadow-lg { box-shadow: 0 28px 85px rgba(0, 0, 0, .4); }

/* Image */
.iag-image-bottom { flex-direction: column-reverse; }
.iag-image-left, .iag-image-right { flex-direction: row; }
.iag-media { position: relative; flex: 0 0 auto; overflow: hidden; }
.iag-image-top .iag-media, .iag-image-bottom .iag-media { width: 100%; }
.iag-image-left .iag-media, .iag-image-right .iag-media { height: auto !important; align-self: stretch; }
.iag-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.iag-media-overlay { position: absolute; inset: 0; pointer-events: none; }
.iag-media-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; }

/* Content */
.iag-content { flex: 1 1 auto; padding: clamp(22px, 5vw, 36px) clamp(18px, 4vw, 32px); }
.iag-view[hidden] { display: none; }
.iag-logo { display: inline-flex; justify-content: center; margin-bottom: 12px; text-decoration: none; }
.iag-logo img { display: block; max-width: 100%; }
.iag-icon { display: flex; justify-content: center; margin-bottom: 14px; color: var(--iag-icon-color); }
.iag-content[style*="left"] .iag-icon { justify-content: flex-start; }
.iag-content[style*="right"] .iag-icon { justify-content: flex-end; }
.iag-svg { display: block; width: var(--iag-icon); height: var(--iag-icon); }

.iag-title {
  margin: 0 0 14px;
  color: inherit;
  font-size: var(--iag-title-size);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.iag-title:focus { outline: none; }
.iag-style-yootheme .iag-title { text-transform: none; letter-spacing: normal; }
.iag-text { font-size: var(--iag-text-size); }
.iag-text p { margin: 0 0 .7em; }
.iag-text p:last-child { margin-bottom: 0; }
.iag-text a { color: inherit; text-decoration: underline; }

/* Date of birth */
.iag-birth { margin: 20px 0 0; }
.iag-birth fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.iag-legend { padding: 0; margin: 0 auto 8px; font-weight: 700; }
.iag-fields { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.iag-content[style*="left"] .iag-fields { justify-content: flex-start; }
.iag-content[style*="right"] .iag-fields { justify-content: flex-end; }
.iag-field { display: flex; flex-direction: column; text-align: left; font-size: 13px; }
.iag-field label { margin-bottom: 4px; color: var(--iag-muted); }
.iag-style-yootheme .iag-field label { color: inherit; opacity: .75; }
.iag-field-2 input { width: 4.2em; }
.iag-field-4 input { width: 6em; }
.iag-input {
  box-sizing: border-box;
  height: 46px;
  padding: 0 10px;
  border: 1px solid var(--iag-deny-border);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 18px;
  text-align: center;
}
.iag-input:focus { outline: 2px solid currentColor; outline-offset: 1px; }
.iag-field input[aria-invalid="true"] { border-color: #c0392b; }
.iag-error { margin: 10px 0 0; color: #c0392b; font-weight: 600; }
.iag-style-dark .iag-error { color: #ff8a80; }

/* Buttons */
.iag-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
.iag-content[style*="left"] .iag-buttons { justify-content: flex-start; }
.iag-content[style*="right"] .iag-buttons { justify-content: flex-end; }
.iag-buttons.iag-stack { flex-direction: column; align-items: stretch; }
.iag-btn {
  flex: 0 1 auto;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}
.iag-btn:hover { filter: brightness(1.12); }
.iag-btn:active { transform: translateY(1px); }
.iag-btn:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
.iag-btn-accept { background: var(--iag-accept-bg); border-color: var(--iag-accept-bg); color: var(--iag-accept-fg); }
.iag-btn-deny { background: var(--iag-deny-bg); border-color: var(--iag-deny-border); color: var(--iag-deny-fg); }
.iag-size-sm { padding: 9px 16px; min-width: 160px; font-size: 14px; }
.iag-size-md { padding: 13px 20px; min-width: 210px; }
.iag-size-lg { padding: 16px 26px; min-width: 250px; font-size: 18px; }

@media (max-width: 640px) {
  .iag-image-left, .iag-image-right { flex-direction: column; }
  .iag-image-left .iag-media, .iag-image-right .iag-media { width: 100% !important; height: 180px !important; }
  .iag-buttons:not(.iag-stack) .iag-btn, .iag-buttons:not(.iag-stack) .uk-button { flex: 1 1 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .iag-btn { transition: none; }
}

/* Small screens: the confirm button comes first when the buttons are stacked by wrapping. */
@media (max-width: 640px) {
  .iag-buttons [data-iag-action="accept"], .iag-buttons [data-iag-action="leave"] { order: -1; }
}
