/* Complaints form + printable QR poster — Joy Land */

html:has(body.complaints-page) {
  overflow-x: clip;
  max-width: 100%;
}

body.complaints-page {
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
}

.complaints-page .site-header,
.complaints-page main,
.complaints-page .site-footer,
.complaints-page .complaint-hero,
.complaints-page .complaint-section,
.complaints-page .container {
  max-width: 100%;
  box-sizing: border-box;
}

.complaints-page .site-header {
  background: rgba(251, 248, 251, 0.92);
}

.complaint-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3.5rem) 0 clamp(1.25rem, 3vw, 2.25rem);
  background:
    radial-gradient(900px 380px at 80% -10%, rgba(196, 163, 90, 0.22), transparent 60%),
    linear-gradient(165deg, #3f2140 0%, #6b3a6a 48%, #27595a 120%);
  color: #fff;
}

.complaint-hero__glow {
  position: absolute;
  inset: auto 0 -35% 35%;
  height: 220px;
  max-width: 100%;
  background: radial-gradient(circle, rgba(74, 143, 144, 0.35), transparent 70%);
  pointer-events: none;
}

.complaint-hero__inner {
  position: relative;
  max-width: 40rem;
}

.complaint-kicker {
  margin: 0 0 .5rem;
  font-size: .8rem;
  letter-spacing: .04em;
  opacity: .88;
  color: #e4c078;
}

.complaint-hero h1 {
  margin: 0 0 .55rem;
  font-size: clamp(1.55rem, 5.5vw, 2.6rem);
  line-height: 1.3;
  font-weight: 800;
}

.complaint-lead {
  margin: 0;
  font-size: clamp(.95rem, 2.8vw, 1.05rem);
  line-height: 1.7;
  opacity: .92;
  max-width: 36rem;
}

.complaint-section {
  padding: 1.25rem 0 3rem;
  background: linear-gradient(180deg, #f3eaf3 0%, #fbf8fb 35%, #fbf8fb 100%);
}

.complaint-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, .75fr);
  gap: 1.25rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

.complaint-form-wrap {
  background: #fff;
  border-radius: 20px;
  padding: clamp(1rem, 3vw, 1.35rem);
  box-shadow: 0 18px 50px rgba(63, 33, 64, 0.1);
  border: 1px solid rgba(107, 58, 106, 0.08);
  min-width: 0;
  width: 100%;
}

.complaint-flash {
  margin-bottom: 1rem;
}

.complaint-flash ul {
  margin: 0;
  padding-inline-start: 1.2rem;
}

/* NEVER use left:-9999px — expands page width on mobile RTL and squeezes content */
.complaint-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  inset: 0 auto auto 0 !important;
}

.complaint-form {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.complaint-form .req {
  color: var(--jl-danger, #b44a3c);
}

.complaint-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem 1rem;
  margin-top: .9rem;
  align-items: start;
}

.complaint-grid .field {
  margin-top: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.complaint-form .field {
  margin-top: .9rem;
}

.complaint-form > .field:first-of-type {
  margin-top: 0;
}

.complaint-form label {
  display: block;
  margin-bottom: .35rem;
  font-weight: 700;
  color: var(--jl-forest-deep, #3f2140);
  line-height: 1.35;
  font-size: .95rem;
}

.complaint-form input,
.complaint-form select,
.complaint-form textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(63, 33, 64, 0.14);
  border-radius: 12px;
  padding: .7rem .9rem;
  min-height: 48px;
  background: #fbf8fb;
  font: inherit;
  font-size: 16px; /* prevent iOS zoom */
  color: var(--jl-ink, #2a1f2a);
  text-align: right;
  direction: rtl;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.complaint-form textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.55;
}

.complaint-form input::placeholder,
.complaint-form textarea::placeholder {
  color: #9a8b9a;
  opacity: 1;
  text-align: right;
  direction: rtl;
}

.complaint-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b3a6a' d='M1.1 1.1 6 6 10.9 1.1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left .9rem center;
  background-color: #fbf8fb;
  padding-left: 2.2rem;
}

.complaint-form input:focus,
.complaint-form select:focus,
.complaint-form textarea:focus {
  outline: none;
  border-color: rgba(107, 58, 106, 0.45);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(107, 58, 106, 0.12);
}

.complaint-submit {
  margin-top: 1.1rem;
  width: 100%;
  min-height: 50px;
  font-size: 1.05rem;
}

.complaint-privacy {
  margin: .7rem 0 0;
  font-size: .84rem;
  color: var(--jl-muted, #6b5e6b);
  text-align: center;
  line-height: 1.5;
}

.complaint-aside {
  display: grid;
  gap: .85rem;
  min-width: 0;
}

.complaint-aside__card,
.complaint-aside__qr {
  background: #fff;
  border-radius: 18px;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(107, 58, 106, 0.08);
  box-shadow: 0 10px 28px rgba(63, 33, 64, 0.06);
}

.complaint-aside__card h2 {
  margin: 0 0 .35rem;
  font-size: 1.05rem;
  color: var(--jl-forest-deep, #3f2140);
}

.complaint-aside__hint {
  margin: 0 0 .75rem;
  color: var(--jl-muted, #6b5e6b);
  line-height: 1.55;
  font-size: .9rem;
}

.complaint-aside__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .75rem;
}

.complaint-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: #f3eaf3;
  color: #3f2140;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  border: 1px solid rgba(107, 58, 106, 0.1);
}

.complaint-chip--wa {
  background: #e8f6ef;
  color: #1f6b45;
}

.complaint-aside__mail {
  display: block;
  color: var(--jl-forest, #6b3a6a);
  font-weight: 600;
  font-size: .88rem;
  word-break: break-all;
  text-decoration: none;
}

.complaint-aside__qr {
  text-align: center;
}

.complaint-aside__qr img {
  display: inline-block;
  width: 120px;
  height: 120px;
  border-radius: 14px;
  background: #fbf8fb;
  padding: .4rem;
  border: 1px solid rgba(63, 33, 64, 0.08);
}

.complaint-aside__qr p {
  margin: .55rem 0 .7rem;
  font-size: .86rem;
  color: var(--jl-muted, #6b5e6b);
}

/* —— Mobile first priority —— */
@media (max-width: 900px) {
  .complaint-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .complaint-aside {
    order: 2;
  }

  .complaint-form-wrap {
    order: 1;
  }

  /* QR useless after scanning — hide on phones */
  .complaint-aside__qr {
    display: none;
  }
}

@media (max-width: 640px) {
  .complaint-section {
    padding: 1rem 0 5.5rem; /* room for mobile book bar */
  }

  .complaint-section > .container,
  .complaint-hero > .container {
    width: 100%;
    max-width: 100%;
    padding-inline: .85rem;
    margin-inline: 0;
    box-sizing: border-box;
  }

  .complaint-hero {
    padding: 1.35rem 0 1.1rem;
  }

  .complaint-hero h1 {
    font-size: 1.55rem;
  }

  .complaint-lead {
    font-size: .92rem;
    line-height: 1.65;
  }

  .complaint-form-wrap {
    border-radius: 16px;
    padding: .95rem .9rem 1.1rem;
    box-shadow: 0 8px 24px rgba(63, 33, 64, 0.08);
  }

  /* Stack fields on small phones for readable width */
  .complaint-grid {
    grid-template-columns: 1fr;
    gap: .85rem;
    margin-top: .85rem;
  }

  .complaint-form .field {
    margin-top: .85rem;
  }

  .complaint-form label {
    font-size: .92rem;
  }

  .complaint-form input,
  .complaint-form select,
  .complaint-form textarea {
    min-height: 48px;
    border-radius: 11px;
    padding: .7rem .85rem;
  }

  .complaint-form textarea {
    min-height: 130px;
    rows: 5;
  }

  .complaint-aside__card {
    border-radius: 16px;
    padding: .9rem .95rem;
  }

  .complaint-aside__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .45rem;
  }

  .complaint-chip--wa {
    grid-column: 1 / -1;
  }

  .complaint-chip {
    width: 100%;
    box-sizing: border-box;
  }

  .complaint-submit {
    min-height: 52px;
    border-radius: 12px;
  }
}

/* Keep two columns on mid phones if wide enough (landscape / large phones) */
@media (min-width: 480px) and (max-width: 640px) {
  .complaint-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Printable poster */
.complaint-poster-page {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(800px 400px at 10% 0%, rgba(196, 163, 90, 0.15), transparent 55%),
    linear-gradient(180deg, #f3eaf3, #fbf8fb 40%, #eef6f6);
  padding: 1rem;
}

.poster-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.complaint-poster {
  width: min(420px, 100%);
  margin: 0 auto;
  padding: 1.6rem 1.25rem 1.35rem;
  border-radius: 24px;
  background:
    linear-gradient(165deg, #ffffff 0%, #fbf8fb 55%, #f3eaf3 100%);
  box-shadow: 0 24px 60px rgba(63, 33, 64, 0.14);
  border: 1px solid rgba(107, 58, 106, 0.1);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.complaint-poster::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, #6b3a6a, #c4a35a, #4a8f90);
}

.complaint-poster__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  margin-bottom: 1rem;
}

.complaint-poster__brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.complaint-poster__brand strong {
  display: block;
  font-size: 1.25rem;
  color: #3f2140;
}

.complaint-poster__brand span {
  display: block;
  font-size: .78rem;
  color: #6b5e6b;
}

.complaint-poster__eyebrow {
  margin: 0;
  color: #c4a35a;
  font-weight: 700;
  letter-spacing: .06em;
  font-size: .78rem;
}

.complaint-poster h1 {
  margin: .4rem 0 .6rem;
  font-size: clamp(1.4rem, 5vw, 1.85rem);
  color: #3f2140;
  line-height: 1.3;
}

.complaint-poster__text {
  margin: 0 auto 1.1rem;
  max-width: 28ch;
  color: #6b5e6b;
  line-height: 1.65;
  font-size: .95rem;
}

.complaint-poster__qr {
  display: inline-flex;
  padding: .7rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(63, 33, 64, 0.1);
  box-shadow: 0 10px 30px rgba(63, 33, 64, 0.08);
}

.complaint-poster__qr img {
  display: block;
  width: min(220px, 62vw);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

.complaint-poster__url {
  margin: .9rem 0 .3rem;
  font-size: .85rem;
  font-weight: 700;
  color: #6b3a6a;
  word-break: break-all;
}

.complaint-poster__mail {
  margin: 0;
  font-weight: 700;
  color: #27595a;
  direction: ltr;
  font-size: .9rem;
}

.complaint-poster__foot {
  margin: 1rem 0 0;
  font-size: .78rem;
  color: #8a7a8a;
}

@media print {
  .no-print,
  .poster-toolbar {
    display: none !important;
  }

  .complaint-poster-page {
    background: #fff;
    padding: 0;
  }

  .complaint-poster {
    box-shadow: none;
    border: 1px solid #ddd;
    width: 100%;
    max-width: none;
    break-inside: avoid;
  }
}
