/* review.css — User review form styles — projecttooling.nl */

/* ===== PAGE HERO (matches style.css .hero but lighter, uses full-width gradient) ===== */
.review-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
  background: linear-gradient(135deg, var(--color-primary) 0%, #1a3f6f 60%, #0f2240 100%);
  color: #fff;
}
.review-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 60% at 85% 20%, oklch(0.5 0.1 250 / 0.25), transparent),
    radial-gradient(ellipse 35% 50% at 15% 80%, oklch(0.3 0.08 30 / 0.12), transparent);
  pointer-events: none;
}
.review-hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}
.review-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}
.review-hero-badge span {
  width: 24px;
  height: 2px;
  background: var(--color-accent);
  display: inline-block;
}
.review-hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-4);
  color: #fff;
}
.review-hero h1 em {
  font-style: normal;
  color: var(--color-accent);
}
.review-hero-sub {
  font-size: var(--text-base);
  color: oklch(0.88 0.02 250);
  max-width: 56ch;
  line-height: 1.65;
}

/* ===== FORM LAYOUT ===== */
.review-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-8);
  align-items: start;
}
@media (max-width: 1023px) {
  .review-layout {
    grid-template-columns: 1fr;
  }
}

/* ===== FORM CARD ===== */
.review-form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
}
@media (max-width: 640px) {
  .review-form-card {
    padding: var(--space-5);
  }
}

/* ===== FIELDSET SECTIONS ===== */
.form-section {
  border: none;
  padding: 0;
  margin: 0 0 var(--space-8);
}
.form-section:last-of-type {
  margin-bottom: 0;
}
.form-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-divider);
}
.form-section-num {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xs);
  line-height: 1;
}
.form-section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
}
.form-section-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 1px;
}

/* ===== FORM GROUPS ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}
.form-group {
  margin-bottom: var(--space-5);
}
.form-group:last-child {
  margin-bottom: 0;
}
.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}
.form-group label .hint {
  font-weight: 400;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-left: var(--space-1);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  appearance: none;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: var(--color-primary);
  background: var(--color-surface);
}
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6778' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 18px;
  padding-right: var(--space-10);
  cursor: pointer;
}
.form-group textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.6;
}
.form-group textarea.tall {
  min-height: 180px;
}

/* Char counter */
.char-counter {
  display: flex;
  justify-content: flex-end;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-1);
  font-variant-numeric: tabular-nums;
  transition: color var(--transition-interactive);
}
.char-counter.warn {
  color: var(--color-warning);
}
.char-counter.over {
  color: var(--color-error);
  font-weight: 600;
}

/* ===== TOOL SELECTOR ===== */
.tool-selector-wrap {
  position: relative;
}
.tool-selector-wrap select {
  font-weight: 500;
}

/* ===== OVERALL STAR RATING ===== */
.star-rating-overall {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.star-group {
  display: flex;
  gap: 4px;
}
.star-group .star {
  font-size: 2.2rem;
  cursor: pointer;
  color: var(--color-divider);
  transition: color 120ms ease, transform 120ms ease;
  user-select: none;
  line-height: 1;
}
.star-group .star:hover,
.star-group .star.hovered,
.star-group .star.selected {
  color: var(--color-accent);
}
.star-group .star:hover {
  transform: scale(1.15);
}
.star-group .star.selected {
  transform: scale(1.05);
}
.star-rating-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  min-width: 5ch;
  transition: opacity var(--transition-interactive);
}
.star-rating-label.empty {
  color: var(--color-text-faint);
  font-weight: 400;
}

/* ===== CATEGORY SCORES ===== */
.cat-scores-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-interactive), border-color var(--transition-interactive);
  text-align: left;
}
.cat-scores-toggle:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}
.cat-scores-toggle-icon {
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: transform 200ms var(--ease-out);
}
.cat-scores-toggle[aria-expanded="true"] .cat-scores-toggle-icon {
  transform: rotate(180deg);
}
.cat-scores-body {
  display: none;
  padding: var(--space-5) 0 0;
}
.cat-scores-body.open {
  display: block;
}
.cat-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
  gap: var(--space-4);
}
.cat-score-row:last-child {
  border-bottom: none;
}
.cat-score-label {
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 500;
  min-width: 12ch;
  flex: 1;
}
.cat-star-group {
  display: flex;
  gap: 3px;
}
.cat-star-group .star {
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--color-divider);
  transition: color 100ms ease, transform 100ms ease;
  user-select: none;
  line-height: 1;
}
.cat-star-group .star:hover,
.cat-star-group .star.hovered,
.cat-star-group .star.selected {
  color: var(--color-accent);
}
.cat-star-group .star:hover {
  transform: scale(1.12);
}

/* ===== RECOMMENDATION RADIO ===== */
.radio-group {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.radio-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition:
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    color var(--transition-interactive);
  user-select: none;
}
.radio-option input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.radio-option:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.radio-option:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-2);
  color: var(--color-text);
}

/* ===== SUBMIT BUTTON ===== */
.review-submit-btn {
  width: 100%;
  padding: var(--space-4) var(--space-8);
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition:
    background var(--transition-interactive),
    transform var(--transition-interactive),
    box-shadow var(--transition-interactive);
  margin-top: var(--space-8);
}
.review-submit-btn:hover:not(:disabled) {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.review-submit-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}
.review-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== SUCCESS STATE ===== */
.review-success {
  display: none;
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-align: center;
}
.review-success.visible {
  display: block;
}
.success-icon {
  width: 64px;
  height: 64px;
  background: oklch(from var(--color-success) l c h / 0.12);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
  color: var(--color-success);
}
.success-icon svg {
  width: 32px;
  height: 32px;
}
.review-success h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.review-success p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 48ch;
  margin-inline: auto;
  line-height: 1.65;
}
.json-output-section {
  margin-top: var(--space-6);
  text-align: left;
}
.json-output-section label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-2);
}
.json-output {
  width: 100%;
  font-family: 'Courier New', 'Menlo', monospace;
  font-size: 0.75rem;
  padding: var(--space-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  resize: vertical;
  min-height: 200px;
  line-height: 1.5;
}
.copy-btn {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--transition-interactive), color var(--transition-interactive);
}
.copy-btn:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.copy-btn.copied {
  background: oklch(from var(--color-success) l c h / 0.1);
  color: var(--color-success);
  border-color: var(--color-success);
}

/* ===== SIDEBAR ===== */
.review-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Trust badge card */
.sidebar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.sidebar-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.sidebar-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}
.sidebar-trust-list {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.sidebar-trust-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: none;
}
.sidebar-trust-list li::before {
  content: '✓';
  color: var(--color-success);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.sidebar-privacy-note {
  font-size: var(--text-xs) !important;
  color: var(--color-text-faint) !important;
  border-top: 1px solid var(--color-divider);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
}

/* ===== HOW IT WORKS SECTION ===== */
.process-section {
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}
.process-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  position: relative;
  padding-top: var(--space-4);
}
@media (max-width: 767px) {
  .process-steps {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-inline: auto;
  }
}
/* Connector line between steps (desktop only) */
.process-steps::before {
  content: '';
  position: absolute;
  top: calc(var(--space-4) + 28px);
  left: calc(33.33% - 8px);
  width: calc(33.33%);
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: 0.35;
}
.process-steps::after {
  content: '';
  position: absolute;
  top: calc(var(--space-4) + 28px);
  left: calc(66.66% - 16px);
  width: calc(33.33% - 16px);
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), oklch(from var(--color-accent) 0.7 0.1 50));
  opacity: 0.35;
}
@media (max-width: 767px) {
  .process-steps::before,
  .process-steps::after { display: none; }
}
.process-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-4);
}
.process-step-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.process-step:nth-child(1) .process-step-icon-wrap {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.process-step:nth-child(2) .process-step-icon-wrap {
  background: oklch(from var(--color-accent) l c h / 0.12);
  color: var(--color-accent);
}
.process-step:nth-child(3) .process-step-icon-wrap {
  background: oklch(from var(--color-success) l c h / 0.1);
  color: var(--color-success);
}
.process-step-icon-wrap svg {
  width: 28px;
  height: 28px;
}
.step-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-surface-2);
}
.process-step:nth-child(2) .step-badge {
  background: var(--color-accent);
}
.process-step:nth-child(3) .step-badge {
  background: var(--color-success);
}
.process-step h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.process-step p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 28ch;
  margin-inline: auto;
}
.process-arrow {
  display: none;
}

/* ===== VALIDATION STATES ===== */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: var(--color-error);
  background: oklch(from var(--color-error) l c h / 0.04);
}
.field-error {
  font-size: var(--text-xs);
  color: var(--color-error);
  margin-top: var(--space-1);
  display: none;
}
.field-error.visible {
  display: block;
}

/* ===== REQUIRED ASTERISK ===== */
.req {
  color: var(--color-accent);
  margin-left: 2px;
}
