/* =====================================================
   Refined Value — Broker Discovery
   Design system matched to refinedvalue.ro
   ===================================================== */

:root {
  --purple-deep:   #4A3B6B;
  --purple-brand:  #6B5B95;
  --purple-soft:   #9B8FB3;
  --ink:           #1A1625;
  --paper:         #FBFAF7;
  --paper-warm:    #F5F2EA;
  --line:          #E8E4DC;
  --accent-warm:   #D4A574;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --transition: 0.32s cubic-bezier(0.2, 0.6, 0.2, 1);

  --container-max: 760px;
  --section-gap-desktop: 96px;
  --section-gap-mobile:  64px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "locl" 1;
  -webkit-font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "locl" 1;
}

img { max-width: 100%; display: block; }

a {
  color: var(--purple-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.18s ease;
}
a:hover { color: var(--ink); }

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
@media (min-width: 1280px) {
  .container { padding-left: 48px; padding-right: 48px; }
}

/* Header — brand wordmark stack matched to main site nav */
.site-header {
  padding: 28px 24px 0;
  max-width: calc(var(--container-max) + 96px);
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--purple-deep);
  text-decoration: none;
}
.brand__mark { flex-shrink: 0; width: auto; height: 38px; }
.brand__stack {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 0.2rem;
}
.brand__wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand__tagline {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--purple-deep);
  font-weight: 500;
}

/* =====================================================
   HERO
   ===================================================== */
.hero {
  padding-top: 80px;
  padding-bottom: 56px;
}
@media (min-width: 768px) {
  .hero { padding-top: 120px; padding-bottom: 72px; }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--purple-deep);
  margin-bottom: 28px;
}

/* Softer eyebrow for the thank-you moment — warmer, no uppercase,
   avoids the awkward uppercase Ț/Ș rendering on Romanian labels. */
.eyebrow--soft {
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 0.88rem;
  color: var(--purple-brand);
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.16;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 32px;
  max-width: 720px;
}
.em-accent {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--purple-deep);
}

.hero-body {
  font-family: var(--font-body);
  font-size: 1.12rem;
  line-height: 1.65;
  color: rgba(26, 22, 37, 0.82);
  max-width: 640px;
  margin: 0 0 32px;
}

.hero-meta {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--purple-brand);
  margin: 0;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 56px 0 0;
}

/* =====================================================
   SECTIONS
   ===================================================== */
.section {
  padding-top: var(--section-gap-mobile);
  padding-bottom: 16px;
}
@media (min-width: 768px) {
  .section { padding-top: var(--section-gap-desktop); }
}

.section-head {
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-warm);
}

.section-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--purple-soft);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  line-height: 1.22;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0 0 16px;
}

.section-intro {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(26, 22, 37, 0.72);
  max-width: 620px;
  margin: 0;
}

/* =====================================================
   QUESTIONS
   ===================================================== */
.question {
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.question:last-child { border-bottom: none; }

.question-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--purple-soft);
  margin-bottom: 12px;
}

.question-label {
  display: block;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 8px;
}

.question-context {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(26, 22, 37, 0.72);
  margin: 4px 0 20px;
  max-width: 620px;
}

.question-sublabel {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  margin: 20px 0 12px;
}

.required {
  color: var(--purple-brand);
  font-weight: 500;
  margin-left: 2px;
}

/* =====================================================
   TEXT INPUTS (bottom-border-only)
   ===================================================== */
.text-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-family: var(--font-body);
  font-size: 1.08rem;
  color: var(--ink);
  padding: 12px 0;
  margin-top: 8px;
  outline: none;
  transition: border-color 0.18s ease, border-width 0.18s ease;
  border-radius: 0;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}

.text-input::placeholder {
  color: var(--purple-soft);
  opacity: 1;
}

.text-input:hover {
  border-bottom-color: var(--purple-soft);
}

.text-input:focus {
  border-bottom-color: var(--purple-brand);
  border-bottom-width: 2px;
  padding-bottom: 11px; /* compensate extra pixel */
}

.text-input.error {
  border-bottom-color: var(--accent-warm);
  border-bottom-width: 2px;
}

.text-area {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-body);
  line-height: 1.55;
}

/* =====================================================
   RADIO + CHECKBOX CUSTOM STYLES
   ===================================================== */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 16px;
}

.option-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px 12px 12px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
  user-select: none;
}

.option-row:hover {
  background: rgba(107, 91, 149, 0.06);
}

/* Hide native input */
.option-row input[type="radio"],
.option-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Custom radio */
.custom-radio {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--purple-soft);
  background: transparent;
  margin-top: 3px;
  position: relative;
  transition: border-color 0.18s ease, border-width 0.18s ease, background 0.18s ease;
}

.option-row:hover .custom-radio {
  border-color: var(--purple-brand);
  border-width: 2px;
}

.option-row input[type="radio"]:checked + .custom-radio {
  border-color: var(--purple-brand);
  border-width: 2px;
  background: var(--purple-brand);
}

.option-row input[type="radio"]:checked + .custom-radio::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper);
}

/* Custom checkbox */
.custom-checkbox {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 2px;
  border: 1.5px solid var(--purple-soft);
  background: transparent;
  margin-top: 3px;
  position: relative;
  transition: border-color 0.18s ease, border-width 0.18s ease, background 0.18s ease;
}

.option-row:hover .custom-checkbox {
  border-color: var(--purple-brand);
  border-width: 2px;
}

.option-row input[type="checkbox"]:checked + .custom-checkbox {
  border-color: var(--purple-brand);
  background: var(--purple-brand);
}

.option-row input[type="checkbox"]:checked + .custom-checkbox::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-55%, -60%) rotate(45deg);
  width: 5px;
  height: 9px;
  border-right: 2px solid var(--paper);
  border-bottom: 2px solid var(--paper);
}

/* Selected row */
.option-row input:checked ~ .option-text {
  color: var(--ink);
}

.option-row:has(input:checked) {
  background: rgba(107, 91, 149, 0.06);
  border-left-color: var(--purple-brand);
}

/* Option text */
.option-text {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
  flex: 1;
}

/* Focus visible on custom inputs */
.option-row input:focus-visible + .custom-radio,
.option-row input:focus-visible + .custom-checkbox {
  outline: 2px solid var(--purple-brand);
  outline-offset: 3px;
}

/* Inline "Altele" input */
.inline-other {
  width: calc(100% - 16px);
  margin: 8px 0 4px 44px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--ink);
  padding: 8px 0;
  outline: none;
  transition: border-color 0.18s ease, opacity 0.18s ease;
  border-radius: 0;
  -webkit-appearance: none;
          appearance: none;
}
.inline-other:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.inline-other:focus {
  border-bottom-color: var(--purple-brand);
}
.inline-other::placeholder {
  color: var(--purple-soft);
}

/* =====================================================
   PRICING CONTEXT BLOCK (Q18, Q19)
   ===================================================== */
.context-block {
  border-left: 3px solid var(--accent-warm);
  padding: 20px 24px;
  margin: 16px 0 24px;
  background: var(--paper-warm);
  max-width: 720px;
}

.context-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.65;
  color: rgba(26, 22, 37, 0.85);
  margin: 0 0 10px;
}
.context-text:last-child { margin-bottom: 0; }

/* =====================================================
   ERROR STATES
   ===================================================== */
.error-msg {
  display: none;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--accent-warm);
  margin-top: 10px;
  letter-spacing: 0.01em;
}
.question.has-error .error-msg { display: block; }
.question.has-error .text-input { border-bottom-color: var(--accent-warm); border-bottom-width: 2px; }
.question.has-error .options-list { box-shadow: inset 3px 0 0 var(--accent-warm); padding-left: 8px; }

.form-global-error {
  display: none;
  margin-top: 24px;
  padding: 16px 20px;
  border-left: 3px solid var(--accent-warm);
  background: rgba(212, 165, 116, 0.08);
  font-family: var(--font-body);
  font-size: 0.96rem;
  color: var(--ink);
}
.form-global-error.visible { display: block; }

/* =====================================================
   SUBMIT SECTION
   ===================================================== */
.submit-section {
  padding: 80px 0 64px;
  border-top: 1px solid var(--line);
  margin-top: 32px;
}

.submit-headline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.4vw, 2.1rem);
  line-height: 1.22;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0 0 16px;
}

.submit-body {
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(26, 22, 37, 0.82);
  max-width: 620px;
  margin: 0 0 32px;
}

.btn-primary {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  padding: 0.95rem 1.85rem;
  cursor: pointer;
  line-height: 1;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn-primary:hover:not(:disabled) {
  background: var(--purple-deep);
  border-color: var(--purple-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(74, 59, 107, 0.18);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--purple-brand);
  outline-offset: 3px;
}

.btn-primary:disabled {
  background: var(--line);
  color: var(--purple-soft);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.submit-note {
  margin-top: 24px;
  font-size: 0.94rem;
  color: rgba(26, 22, 37, 0.68);
  max-width: 560px;
}

/* =====================================================
   THANK YOU SCREEN
   ===================================================== */
.thank-you {
  padding-top: 120px;
  padding-bottom: 120px;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 36px;
  font-size: 1.02rem;
}
.contact-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  max-width: 360px;
}
.contact-list li:last-child { border-bottom: none; }

.btn-ghost {
  display: inline-block;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.95rem 1.85rem;
  border-radius: 2px;
  text-decoration: none;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

.back-link {
  margin-top: 48px;
  font-size: 0.92rem;
  color: var(--purple-soft);
}

/* =====================================================
   FOOTER — dark, matched to main site
   ===================================================== */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 1.75rem 0;
  margin-top: 80px;
}
.site-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: center;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--paper);
}
.site-footer__inner > * { opacity: 0.72; }
.site-footer__left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--purple-soft);
}
.site-footer__left span { color: var(--paper); }
.site-footer__mark { width: auto; height: 22px; opacity: 0.9; }
.site-footer__center { text-align: center; }
.site-footer__right {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  align-items: center;
}
.site-footer__right a {
  color: var(--paper);
  text-decoration: none;
  transition: opacity var(--transition);
}
.site-footer__right a:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer__dot { opacity: 0.5; }

/* =====================================================
   HONEYPOT
   ===================================================== */
.honeypot {
  position: absolute;
  left: -5000px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

/* =====================================================
   RESPONSIVE TUNING
   ===================================================== */
@media (max-width: 720px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1rem;
  }
  .site-footer__left, .site-footer__right { justify-content: center; }
  .site-footer__center { order: 3; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .site-header { padding: 20px 20px 0; }
  .container { padding-left: 20px; padding-right: 20px; }
  .hero { padding-top: 56px; padding-bottom: 40px; }
  .hero-headline br { display: none; }
  .section-head { margin-bottom: 32px; }
  .section-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .question { padding: 28px 0; }
  .context-block { padding: 18px 18px; }
  .inline-other { margin-left: 32px; width: calc(100% - 8px); }
  .btn-primary { width: 100%; padding: 18px 20px; }
  .submit-section { padding: 56px 0 48px; }
  .thank-you { padding-top: 80px; padding-bottom: 80px; }
}

/* Safari fallback: :has() polyfill — graceful degradation */
@supports not selector(:has(*)) {
  .option-row input:checked ~ .custom-radio,
  .option-row input:checked ~ .custom-checkbox {
    /* Already handled via direct sibling */
  }
}

/* Print — clean for saving a copy */
@media print {
  .site-header, .site-footer, .btn-primary, .submit-note { display: none; }
  body { background: white; color: black; }
  .section { page-break-inside: avoid; }
}
