/* ============================================================
   write-review.css — Write a review (view #3).
   Page prefix: .wr-*  (write review).
   Tokens only (var(--*)); hover / focus / responsive / layout live
   here. Single column, never scrolls horizontally at 375px.
   ============================================================ */

.wr-page {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-6) 0 var(--space-11);
}

.wr-back { margin-bottom: var(--space-5); }

.wr-head { margin-bottom: var(--space-6); }
.wr-head-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
.wr-head-sub {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  margin: var(--space-2) 0 0;
}

.wr-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* ---- Business strip ---- */
.wr-biz {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--surface-card);
  border: var(--border-thin) solid var(--border-subtle);
  border-radius: var(--radius-xl);
}
.wr-biz-mark {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: var(--surface-brand-tint);
  color: var(--green-800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  font-size: var(--text-base);
}
.wr-biz-titles { flex: 1; min-width: 0; }
.wr-biz-name {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--ink);
}
.wr-biz-verified {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--green-700);
}
.wr-biz-domain {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ---- Notices (dedup / not-listed / sign-in / duplicate) ---- */
.wr-notice {
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  border: var(--border-thin) solid var(--border-subtle);
  background: var(--surface-card);
}
.wr-notice--info {
  background: var(--surface-brand-tint);
  border-color: var(--green-200);
}
.wr-notice--warn {
  background: var(--fb-amber-bg);
  border-color: var(--fb-amber-bg);
}
.wr-notice-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin: 0 0 var(--space-2);
}
.wr-notice-body {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  margin: 0 0 var(--space-5);
}
.wr-notice-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--text-inverse);
  font-size: 13.5px;
  font-weight: var(--weight-bold);
  text-decoration: none;
}
.wr-notice-btn:hover { background: var(--button-primary-bg-hover); text-decoration: none; }

/* ---- Form ---- */
.wr-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.wr-field { display: flex; flex-direction: column; gap: var(--space-2); }

.wr-label {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
}
.wr-req { color: var(--red-600); font-weight: var(--weight-bold); }
.wr-optional { color: var(--text-tertiary); font-weight: var(--weight-regular); }
.wr-count {
  margin-left: auto;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.wr-count--over { color: var(--red-600); }

/* Text inputs / textarea / date. */
.wr-input {
  width: 100%;
  box-sizing: border-box;
  border: var(--border-thin) solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  font-family: inherit;
  color: var(--text-primary);
  background: var(--white);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
}
.wr-input:focus-visible {
  border-color: var(--color-brand);
  box-shadow: var(--shadow-focus);
}
.wr-input--err { border-color: var(--red-600); }
.wr-textarea { min-height: 160px; resize: vertical; }
.wr-date { max-width: 220px; }

.wr-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: var(--leading-normal);
  margin: 0;
}

.wr-err {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--red-600);
  margin: 0;
}

/* ---- Star picker ---- */
.wr-stars {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.wr-star {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  line-height: 1;
}
.wr-star-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.wr-star-glyph {
  font-size: 34px;
  line-height: 1;
  color: var(--star-empty);
  transition: color var(--duration-fast) var(--ease-standard);
  padding: 0 2px;
}
.wr-star-glyph--on { color: var(--star); }
.wr-star-input:focus-visible + .wr-star-glyph {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}
.wr-stars-caption {
  margin-left: var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
}

/* Screen-reader-only. */
.wr-vh {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Identity + email-optional note ---- */
.wr-identity {
  background: var(--surface-subtle);
  border: var(--border-thin) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}
.wr-identity-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.wr-identity-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.wr-identity-name {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--ink);
}
.wr-identity-name--muted { color: var(--text-tertiary); font-style: italic; }
.wr-identity-note {
  font-size: var(--text-xs);
  line-height: var(--leading-relaxed);
  color: var(--text-tertiary);
  margin: var(--space-2) 0 0;
}

/* Guest identity (editable display name + optional email). */
.wr-identity--edit {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Live "name is available" confirmation. */
.wr-ok {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--green-700);
  margin: 0;
}

/* Display-name suggestion chips (from consumerDisplayNameValidate). */
.wr-suggests {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-1) 0 0;
}
.wr-suggest-btn {
  background: var(--surface-subtle);
  border: var(--border-thin) solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
}
.wr-suggest-btn:hover { background: var(--surface-brand-tint); }

/* ---- Photo uploader ---- */
.wr-photos { display: flex; flex-direction: column; gap: var(--space-3); }
.wr-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  border: var(--border-med) dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color var(--duration-fast) var(--ease-standard),
              background var(--duration-fast) var(--ease-standard);
}
.wr-drop:hover { border-color: var(--color-brand); background: var(--surface-brand-tint); }
.wr-drop--drag { border-color: var(--color-brand); background: var(--surface-brand-tint); }
.wr-drop--disabled { cursor: not-allowed; opacity: 0.6; }
.wr-drop--disabled:hover { border-color: var(--border-default); background: transparent; }
.wr-drop-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.wr-drop:focus-visible {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: var(--shadow-focus);
}
.wr-drop-mark { display: flex; color: var(--text-tertiary); }
.wr-drop-label { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-secondary); }
.wr-drop-hint { font-size: var(--text-xs); color: var(--text-tertiary); }

/* Thumbnails (uploaded images) — square previews with a remove cross. */
.wr-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}
.wr-thumb {
  position: relative;
  width: 84px;
  height: 84px;
}
.wr-thumb-view {
  width: 100%;
  height: 100%;
  padding: 0;
  border: var(--border-thin) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-subtle);
  cursor: pointer;
  display: block;
}
.wr-thumb-view:focus-visible {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: var(--shadow-focus);
}
.wr-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* PDF attachment tile (no image preview) — a centered file glyph on a subtle fill. */
.wr-thumb-pdf {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-subtle);
  color: var(--color-brand);
}
.wr-thumb--err .wr-thumb-view { border-color: var(--red-600); }
.wr-thumb-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  background: color-mix(in srgb, var(--ink) 42%, transparent);
}
.wr-thumb-state--err { color: var(--white); background: color-mix(in srgb, var(--red-600) 55%, transparent); }
/* Remove cross — top-right corner of each thumbnail. */
.wr-thumb-x {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: var(--border-thin) solid var(--border-subtle);
  border-radius: var(--radius-circle);
  background: var(--surface-card);
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.wr-thumb-x:hover { background: var(--red-600); color: var(--text-inverse); border-color: var(--red-600); }
.wr-thumb-x:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* Lightbox (enlarged single-image viewer). */
.wr-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: color-mix(in srgb, var(--ink) 80%, transparent);
}
.wr-lightbox-inner {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.wr-lightbox-img {
  max-width: 92vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.wr-lightbox-cap {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-inverse);
  margin: 0;
  text-align: center;
  word-break: break-all;
}
.wr-lightbox-x {
  position: absolute;
  top: calc(-1 * var(--space-6));
  right: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: var(--radius-circle);
  background: var(--surface-card);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-lg);
}
.wr-lightbox-x:hover { background: var(--surface-subtle); }
.wr-lightbox-x:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* ---- Errors / actions ---- */
.wr-form-err {
  padding: var(--space-3) var(--space-4);
  border: var(--border-thin) solid var(--red-600);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  color: var(--red-600);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

/* Registration-required panel (401 on submit). */
.wr-register {
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  background: var(--surface-brand-tint);
  border: var(--border-thin) solid var(--green-200);
}
.wr-register-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.wr-register-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--radius-circle);
  background: var(--white);
  color: var(--green-700);
}
.wr-register-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--ink);
  margin: 0;
}
.wr-register-body {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--green-900);
  margin: 0 0 var(--space-3);
}
.wr-register-note {
  font-size: var(--text-xs);
  line-height: var(--leading-relaxed);
  color: var(--text-tertiary);
  margin: 0 0 var(--space-4);
}
.wr-register-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.wr-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.wr-cta-link,
.wr-cta-link:hover { display: inline-block; text-decoration: none; }
.wr-linkbtn {
  background: none;
  border: none;
  color: var(--text-link);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.wr-linkbtn:hover { text-decoration: underline; }
.wr-linkbtn--muted { color: var(--text-tertiary); }
.wr-saved {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--green-800);
}

/* ---- Confirmation ---- */
.wr-done {
  background: var(--surface-card);
  border: var(--border-thin) solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-9) var(--space-7);
  text-align: center;
}
.wr-done-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-circle);
  background: var(--surface-brand-tint);
  color: var(--green-700);
  margin-bottom: var(--space-4);
}
.wr-done-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  margin: 0 0 var(--space-2);
}
.wr-done-body {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  max-width: 440px;
  margin: 0 auto var(--space-6);
}
.wr-done-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Responsive ---- */
@media (max-width: 560px) {
  .wr-head-title { font-size: var(--text-2xl); }
  .wr-notice,
  .wr-biz { padding: var(--space-4) var(--space-4); }
  .wr-star-glyph { font-size: 30px; }
  .wr-actions { gap: var(--space-3); }
}
