/* Reviews & Q&A — ofigo.es Dev Bot 2026-03-18 */

/* ── Reviews empty state ── */
.reviews-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-muted, #6b7280);
}
.reviews-empty svg {
  color: var(--color-border, #d1d5db);
  margin-bottom: 0.75rem;
}
.reviews-empty p {
  margin: 0.25rem 0;
}
.reviews-empty .btn {
  margin-top: 1rem;
}

/* ── Reviews header with button ── */
.reviews-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

/* ── Review form wrapper ── */
.review-form-wrapper {
  border-top: 1px solid var(--color-border, #e5e7eb);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
}
.review-form-title,
.qa-form-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

/* ── Form layout ── */
.review-form,
.qa-form {
  max-width: 600px;
}
.review-form__row,
.qa-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 600px) {
  .review-form__row,
  .qa-form__row {
    grid-template-columns: 1fr;
  }
}
.review-form__field,
.qa-form__field {
  margin-bottom: 1rem;
}
.review-form__field label,
.qa-form__field label {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
  color: var(--color-text, #1f2937);
}
.review-form__field input,
.review-form__field textarea,
.qa-form__field input,
.qa-form__field textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-text, #1f2937);
  transition: border-color 0.15s;
}
.review-form__field input:focus,
.review-form__field textarea:focus,
.qa-form__field input:focus,
.qa-form__field textarea:focus {
  outline: none;
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.review-form__field textarea,
.qa-form__field textarea {
  resize: vertical;
  min-height: 80px;
}
.review-form__field small,
.qa-form__field small {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
}
.required {
  color: #dc2626;
}

/* ── Star selector ── */
.review-form__stars {
  margin-bottom: 1rem;
}
.review-form__label {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}
.star-selector {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: #d97706;
  transition: transform 0.1s;
}
.star-btn:hover {
  transform: scale(1.15);
}
@media (max-width: 640px) {
  .star-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
.star-btn:focus-visible {
  outline: 2px solid var(--color-primary, #2563eb);
  outline-offset: 2px;
  border-radius: 4px;
}
.star-btn svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: fill 0.1s, stroke 0.1s;
}
.star-btn.is-active svg {
  fill: currentColor;
  stroke: none;
}
.star-label {
  font-size: 0.85rem;
  color: var(--color-text-muted, #6b7280);
  margin-left: 0.5rem;
  min-width: 70px;
}

/* ── Form actions ── */
.review-form__actions,
.qa-form__actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

/* ── Feedback ── */
.review-form__feedback,
.qa-form__feedback {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
}
.review-form__feedback--success,
.qa-form__feedback--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.review-form__feedback--error,
.qa-form__feedback--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ── Q&A empty state ── */
.qa-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-muted, #6b7280);
}
.qa-empty svg {
  color: var(--color-border, #d1d5db);
  margin-bottom: 0.75rem;
}
.qa-empty p {
  margin: 0.25rem 0;
}

/* ── Q&A form wrapper ── */
.qa-form-wrapper {
  border-top: 1px solid var(--color-border, #e5e7eb);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
}

/* ── Button styles (reuse site patterns) ── */
.btn--sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}
.btn--outline {
  background: transparent;
  border: 1px solid var(--color-border, #d1d5db);
  color: var(--color-text, #374151);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  transition: background 0.15s, border-color 0.15s;
}
.btn--outline:hover {
  background: var(--color-bg-muted, #f3f4f6);
  border-color: var(--color-text-muted, #9ca3af);
}
.btn--outline:focus-visible {
  outline: 2px solid var(--color-primary, #2563eb);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .review-form__field input,
  .review-form__field textarea,
  .qa-form__field input,
  .qa-form__field textarea,
  .star-btn,
  .star-btn svg,
  .btn--outline { transition: none; }
  .star-btn:hover { transform: none; }
}

/* ── Print ── */
@media print {
  .review-form-wrapper,
  .qa-form-wrapper,
  .reviews-header .btn { display: none !important; }
}

/* ── Forced colors (Windows High Contrast) — WCAG 1.4.11 ── */
@media (forced-colors: active) {
  .star-btn svg { forced-color-adjust: none; }
  .review-form__feedback--success,
  .qa-form__feedback--success { border: 2px solid LinkText; }
  .review-form__feedback--error,
  .qa-form__feedback--error { border: 2px solid LinkText; }
  .review-form__field input:focus,
  .review-form__field textarea:focus,
  .qa-form__field input:focus,
  .qa-form__field textarea:focus { outline: 2px solid Highlight; }
}
