/* Formulário público /r/{slug} — quadro responsivo sem overflow */
body.review-form-body {
  max-width: 100%;
}

.rf {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  display: grid;
  /* Horizontal: sempre centrado. Vertical: centra se couber; se extrapolar, vira start (scroll ok) */
  justify-items: center;
  align-items: safe center;
  padding: 1rem;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  overflow-x: clip;
  background:
    radial-gradient(circle at top right, rgba(225, 29, 143, 0.08), transparent 36%),
    radial-gradient(circle at bottom left, rgba(91, 60, 196, 0.1), transparent 42%),
    linear-gradient(160deg, #f7f6fb, #ebe8f4);
}

.rf-frame {
  width: min(960px, 100%);
  max-width: 100%;
  background: #fff;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  /* Clip só nas laterais — overflow-y hidden cortava o botão em telas baixas */
  overflow-x: clip;
  overflow-y: visible;
  display: grid;
  grid-template-columns: 1fr;
}

.rf-media {
  position: relative;
  min-height: 220px;
  max-height: 280px;
  background: #111;
  overflow: hidden;
}
.rf-media__img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.rf-media__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(10, 8, 18, 0.78));
  pointer-events: none;
}
.rf-media__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 1rem 1.15rem 1.15rem;
  color: #fff;
}
.rf-media__meta strong {
  display: block;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 400;
  margin: 0.35rem 0 0.2rem;
}
.rf-media__meta p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.35;
}
.rf-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
}

.rf-panel {
  padding: 1.25rem 1.15rem 1.4rem;
  min-width: 0;
}
.rf-panel__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.rf-panel__brand .brand { margin: 0; }
.rf-secure {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  white-space: nowrap;
}
.rf-panel__head h1 {
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  margin-bottom: 0.55rem;
}
.rf-panel__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin-bottom: 0.45rem;
}
.rf-panel__meta strong { font-size: 0.92rem; }
.rf-panel__date {
  font-size: 0.78rem;
  color: var(--muted);
}
.rf-panel__desc {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.rf-panel__link { margin: 0 0 0.85rem; }

.rf-identity {
  display: grid;
  gap: 0.85rem;
}
.rf-avatar-field {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.45rem;
}
.rf-avatar-field__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
.rf-avatar-picker {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.rf-avatar-preview {
  position: relative;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 1rem;
  border: 1.5px dashed var(--line);
  background: var(--bg);
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}
.rf-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rf-avatar-preview__ph {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1;
}
.rf-avatar-preview:not(.is-empty) {
  border-style: solid;
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
}
.rf-avatar-picker__meta {
  min-width: 0;
  display: grid;
  gap: 0.35rem;
}
.rf-avatar-picker__meta input[type="file"] {
  width: 100%;
  max-width: 100%;
  font-size: 0.82rem;
}
.rf-avatar-clear {
  justify-self: start;
  border: 0;
  background: none;
  padding: 0;
  color: var(--brand);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rf-form .btn--block { width: 100%; }

/* Compat: páginas antigas que ainda usam .public-page */
.public-page {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem;
  overflow-x: clip;
  background:
    radial-gradient(circle at top right, rgba(225, 29, 143, 0.1), transparent 36%),
    radial-gradient(circle at bottom left, rgba(91, 60, 196, 0.14), transparent 40%),
    linear-gradient(160deg, #f7f6fb, #ebe8f4);
}
.public-card {
  width: min(520px, 100%);
  max-width: 100%;
  background: #fff;
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  overflow: hidden;
}
.public-card--center { text-align: center; }
.public-card h1 { font-size: 1.8rem; }

.form-logo {
  width: 100%;
  max-width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 14px;
  margin: 0 0 1rem;
}

.rating-field {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
  min-width: 0;
}
.rating-stars {
  position: relative;
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.15rem;
  max-width: 100%;
  overflow: hidden;
}
.rating-stars input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  clip: rect(0, 0, 0, 0);
}
.rating-stars label {
  font-size: 2rem;
  color: #d4d0dc;
  cursor: pointer;
  line-height: 1;
  margin: 0;
  flex: 0 0 auto;
}
.rating-stars label:hover,
.rating-stars label:hover ~ label,
.rating-stars input:checked ~ label {
  color: var(--star);
}

.badge-event {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  vertical-align: middle;
}
.receipt-box {
  text-align: left;
  background: var(--bg);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  border: 1px solid var(--line);
}
.voucher-box {
  text-align: center;
  border: 1px dashed var(--brand);
  background: var(--brand-soft);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
}
.voucher-code {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--brand-dark);
}
.flash--voucher {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.photo-field { margin-bottom: 1rem; }
.photo-field__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.photo-field__head label { margin: 0; }
.photo-field input[type="file"] { width: 100%; max-width: 100%; }
.photo-previews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.photo-preview {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f3f4f6;
}
.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-preview__dismiss {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 17, 17, 0.78);
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

@media (min-width: 860px) {
  .rf {
    padding: 1.5rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  }
  .rf--has-media .rf-frame {
    grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
    align-items: start;
    /* Cresce com o formulário; não trava em 100dvh (cortava o submit) */
    min-height: 0;
  }
  .rf--has-media.rf--media_right .rf-frame {
    grid-template-columns: minmax(0, 0.58fr) minmax(0, 0.42fr);
  }
  .rf--has-media.rf--media_right .rf-media {
    order: 2;
  }
  .rf--has-media.rf--media_right .rf-panel {
    order: 1;
  }
  .rf-media {
    min-height: 100%;
    max-height: none;
    height: 100%;
    align-self: stretch;
    border-radius: 22px 0 0 22px;
  }
  .rf--has-media.rf--media_right .rf-media {
    border-radius: 0 22px 22px 0;
  }
  .rf-media__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
  .rf-panel {
    padding: 1.6rem 1.75rem 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
  .rf-identity {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 859px) {
  .rf {
    padding: 0.75rem;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  }
  .rf-frame {
    border-radius: 18px;
  }
  .rf-media {
    border-radius: 18px 18px 0 0;
  }
}
