/* =============================================================
   TransRisk v3 — form.css
   Styles specific to talk-to-expert.html (and future form pages)
============================================================= */

/* ========================
   PAGE SHELL
======================== */

.expert-page {
  background: #f0f2f5;
}

/* ── Page header band ── */
.expert-page-header {
  background: var(--color-navy);
  padding: 72px 40px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle dot-grid texture */
.expert-page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.expert-page-header .container {
  position: relative;
  z-index: 1;
}

.expert-page-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.expert-page-sub {
  font-size: 1.0625rem;
  color: rgba(255, 255, 255, 0.62);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ========================
   TWO-COLUMN LAYOUT
======================== */

.expert-main {
  padding: 48px 0 80px;
}

.expert-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}

/* ========================
   FORM COLUMN
======================== */

.expert-form-col {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  box-shadow: var(--shadow-md);
}

/* ── Form layout helpers ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.form-group--full {
  grid-column: 1 / -1;
}

/* ── Labels ── */
.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.01em;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.form-required {
  color: #dc2626;
  font-weight: 700;
}

.form-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-muted);
}

/* ── Inputs, selects, textarea ── */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--color-text);
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #9ca3af;
}

/* Green focus ring */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-green);
  box-shadow: 0 0 0 3px rgba(45, 122, 58, 0.12);
}

/* Validation error state */
.form-input:invalid:not(:placeholder-shown),
.form-select:invalid,
.form-textarea:invalid:not(:placeholder-shown) {
  border-color: #fca5a5;
}

/* Select arrow */
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
  cursor: pointer;
}

.form-select:invalid,
.form-select option[value=""] {
  color: #9ca3af;
}

.form-textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}

/* ── Commodity checkboxes ── */
.commodity-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.commodity-fieldset legend {
  float: left;
  width: 100%;
  margin-bottom: 14px;
}

.commodity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  clear: both;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--color-text);
  cursor: pointer;
  line-height: 1.4;
  user-select: none;
}

.checkbox-input {
  /* Hide native checkbox, replaced by .checkbox-box */
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Custom checkbox box */
.checkbox-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  background: #fff;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

/* Checkmark (CSS-only via ::after) */
.checkbox-box::after {
  content: '';
  display: none;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

/* Checked state */
.checkbox-input:checked + .checkbox-box {
  background: var(--color-green);
  border-color: var(--color-green);
}

.checkbox-input:checked + .checkbox-box::after {
  display: block;
}

/* Focus state */
.checkbox-input:focus-visible + .checkbox-box {
  outline: 2px solid var(--color-green);
  outline-offset: 2px;
}

/* ── Submit row ── */
.form-submit-row {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-submit-btn {
  width: 100%;
  justify-content: center;
}

.form-consent {
  font-size: 0.75rem;
  color: var(--color-muted);
  line-height: 1.55;
  text-align: center;
}

/* ========================
   SUCCESS STATE
======================== */

.form-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  gap: 12px;
  outline: none;
}

.form-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #dcfce7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-green);
  margin-bottom: 8px;
}

.form-success-icon svg {
  width: 36px;
  height: 36px;
}

.form-success-title {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.form-success-body {
  font-size: 1rem;
  color: var(--color-muted);
  max-width: 400px;
  line-height: 1.65;
}

/* ========================
   TRUST / CREDIBILITY PANEL
======================== */

.expert-trust-panel {
  background: var(--color-navy);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  color: #fff;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  /* Subtle texture */
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(180deg, var(--color-navy-light) 0%, var(--color-navy) 100%);
  background-size: 20px 20px, 100% 100%;
}

/* ── Headshot placeholder ── */
.expert-headshot-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.expert-headshot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
}

.expert-headshot svg {
  width: 28px;
  height: 28px;
}

.expert-headshot-caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.expert-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
}

.expert-role {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.50);
}

/* ── Intro blurb ── */
.expert-intro {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
  margin-bottom: 24px;
}

.expert-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  margin: 24px 0;
}

/* ── Proof metrics (2×2) ── */
.expert-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 4px;
}

.expert-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.expert-metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-green-light);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.expert-metric-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.50);
  line-height: 1.4;
}

/* ── Testimonial quote ── */
.expert-quote {
  margin: 0;
}

.expert-quote blockquote {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
  font-style: italic;
  margin: 0 0 16px;
}

.expert-quote blockquote p {
  margin: 0;
}

.expert-quote blockquote p::before { content: '\201C'; }
.expert-quote blockquote p::after  { content: '\201D'; }

.expert-quote-attr {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.expert-quote-attr strong {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
}

.expert-quote-attr span {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

/* ========================
   RESPONSIVE
======================== */

@media (max-width: 960px) {
  .expert-layout {
    grid-template-columns: 1fr;
  }

  .expert-trust-panel {
    position: static;
    /* On mobile, show panel after form */
    order: 2;
  }

  .expert-form-col {
    order: 1;
  }

  .expert-metrics {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 720px) {
  .expert-page-header {
    padding: 56px 24px 48px;
  }

  .expert-main {
    padding: 32px 0 56px;
  }

  .expert-form-col {
    padding: 32px 24px;
    border-radius: var(--radius-lg);
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .expert-trust-panel {
    padding: 28px 24px;
    border-radius: var(--radius-lg);
  }

  .expert-metrics {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .commodity-grid {
    grid-template-columns: 1fr;
  }

  .expert-metrics {
    grid-template-columns: 1fr 1fr;
  }
}
