/* ============================================================
   JG CAPITAL — Components V24
   Contact · Market feed · Research
   ============================================================ */

/* ── Contact section shell ──────────────────────────────────── */
.contact-section {
  padding-block: clamp(64px, 7.5vw, 100px);
  background: var(--bg);
  color: var(--ink);
}

.contact-shell {
  width: min(100% - 32px, 600px);
  margin-inline: auto;
  display: grid;
  gap: 28px;
  justify-items: stretch;
}

/* ── Contact header ─────────────────────────────────────────── */
.contact-header {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.contact-header .eyebrow { margin: 0 }

.contact-header h2 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -.04em;
}

.contact-header > p:last-child {
  max-width: 48ch;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.75;
  margin-inline: auto;
}

/* ── Contact channels (chips) ───────────────────────────────── */
.contact-channels {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--raised);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition:
    transform  var(--duration-fast) var(--ease),
    border-color var(--duration-fast) var(--ease),
    box-shadow   var(--duration-fast) var(--ease);
}

.contact-chip .icon {
  width: 15px;
  height: 15px;
  color: var(--gold);
}

.contact-chip .icon-whatsapp {
  width: 17px;
  height: 17px;
  color: #25d366;
}

.contact-chip:hover {
  transform: translate3d(0, -2px, 0);
  border-color: color-mix(in srgb, var(--gold) 40%, var(--line));
  box-shadow: var(--shadow-sm);
}

.contact-chip--static:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
}

/* ── Contact form ───────────────────────────────────────────── */
.contact-form {
  width: 100%;
  background: var(--raised);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: var(--radius-xl);
  padding: 32px;
  display: grid;
  gap: 16px;
  box-shadow: var(--shadow-md);
}

.contact-form h3 {
  text-align: center;
  color: var(--ink);
  font-size: 20px;
  font-weight: 580;
  letter-spacing: -.025em;
  margin-bottom: 2px;
}

/* ── Field ──────────────────────────────────────────────────── */
.field { min-width: 0 }

.field label {
  display: block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 7px;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--ink);
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.65;
  min-height: 44px;
  transition:
    border-color var(--duration-fast) var(--ease),
    box-shadow   var(--duration-fast) var(--ease);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--muted);
  opacity: .6;
}

.contact-form textarea {
  resize: none;
  min-height: 114px;
  display: block;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 0;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 15%, transparent);
}

.contact-form [aria-invalid="true"] {
  border-color: var(--negative);
}

.field-error {
  font-size: 11.5px;
  margin-top: 5px;
  color: var(--negative);
}

[data-theme="dark"] .field-error { color: #f5967f }

/* ── Submit button ──────────────────────────────────────────── */
.button-contact {
  justify-self: stretch;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-md);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 580;
  letter-spacing: .01em;
  transition:
    background  var(--duration-fast) var(--ease),
    box-shadow  var(--duration-fast) var(--ease),
    transform   var(--duration-fast) var(--ease);
}

.button-contact .icon { width: 17px; height: 17px }

.button-contact:hover {
  background: color-mix(in srgb, var(--navy) 82%, #fff);
  box-shadow: var(--shadow-md);
}

.button-contact:active { transform: scale(.985) }
.contact-actions {
  display: grid;
  gap: 12px;
}


/* Spinner */
.submit-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.contact-form[aria-busy="true"] .submit-spinner { display: inline-block }

@keyframes spin { to { transform: rotate(360deg) } }

/* Status / consent ─────────────────────────────────────────── */
.form-status:empty { display: none }

.form-status {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
  text-align: center;
}

.form-status[data-state="error"]   { color: var(--negative) }
.form-status[data-state="success"] { color: var(--positive) }

[data-theme="dark"] .form-status[data-state="error"]   { color: #f5967f }
[data-theme="dark"] .form-status[data-state="success"] { color: #5fd9a0 }

.form-consent {
  font-size: 10.5px;
  text-align: center;
  line-height: 1.65;
  color: var(--muted);
  max-width: 50ch;
  margin-inline: auto;
}

.form-consent a {
  text-decoration: underline;
  text-underline-offset: 2px;
  color: inherit;
}

/* ── Dark mode overrides for form ───────────────────────────── */
[data-theme="dark"] .contact-form {
  background: var(--surface);
  border-color: rgba(255, 255, 255, .07);
  box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .contact-form input,
[data-theme="dark"] .contact-form textarea {
  background: var(--raised);
  border-color: var(--line);
}

[data-theme="dark"] .contact-chip {
  background: var(--surface);
  border-color: rgba(255, 255, 255, .09);
}

/* ── Market section ─────────────────────────────────────────── */
.market-section {
  padding: 22px 0 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.market-panel > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.market-panel > header h2 {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 680;
  color: var(--muted);
}

.market-panel > header span {
  font-size: 10.5px;
  color: var(--muted);
}

.market-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

/* Quote card */
.quote {
  position: relative;
  padding: 16px 15px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--raised);
  min-width: 0;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-fast);
}

.quote:hover { box-shadow: var(--shadow-sm) }

.quote h3 {
  font-size: 11px;
  font-weight: 620;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  padding-right: 18px;
  margin-bottom: 10px;
}

.quote-value {
  font-size: clamp(19px, 1.8vw, 24px);
  font-weight: 560;
  letter-spacing: -.025em;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  display: block;
  white-space: nowrap;
  color: var(--ink);
}

.quote-change {
  display: block;
  font-size: 10.5px;
  font-weight: 530;
  margin-top: 5px;
}

.quote-change.positive { color: var(--positive) }
.quote-change.negative { color: var(--negative) }

.quote time {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 6px;
}

/* Source tooltip */
.quote-source { position: absolute; top: 12px; right: 10px }

.quote-source summary {
  list-style: none;
  font: 400 10px / 20px var(--font);
  text-align: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
}

.quote-source summary::-webkit-details-marker { display: none }

.source-tooltip {
  position: absolute;
  right: 0;
  top: 28px;
  z-index: 20;
  background: var(--navy);
  color: #d8e8f0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-md);
  padding: 14px;
  width: 220px;
  max-width: 70vw;
  font-size: 11.5px;
  box-shadow: var(--shadow-lg);
}

.source-tooltip > * { display: block; overflow-wrap: anywhere }
.source-tooltip span { margin-top: 7px; color: #8fb5c8 }
.source-tooltip a { margin-top: 9px; text-decoration: underline; color: #fff }

.market-note {
  font-size: 9.5px;
  line-height: 1.7;
  margin-top: 14px;
  max-width: 90ch;
  color: var(--muted);
}

/* ── Research entries ───────────────────────────────────────── */
.research-article {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  max-width: 800px;
}

.research-article h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  margin: 10px 0 14px;
}

.research-article time {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: .03em;
}

.research-article p {
  white-space: pre-line;
  overflow-wrap: anywhere;
  line-height: 1.8;
}

.research-article a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 13.5px;
  font-weight: 530;
}

/* ── Responsive adjustments ─────────────────────────────────── */
@media (max-width: 900px) {
  .market-strip { grid-template-columns: repeat(3, minmax(0, 1fr)) }
}

@media (max-width: 600px) {
  .contact-form         { padding: 22px 18px; border-radius: var(--radius-lg); gap: 14px }
  .contact-form h3      { font-size: 18px }
  .contact-shell        { width: min(100% - 28px, 600px); gap: 20px }
  .contact-header h2    { font-size: 28px }
  .contact-channels     { gap: 8px }
  .contact-chip         { font-size: 11px; padding: 8px 11px }

  .market-strip         { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .market-panel > header { display: block }
  .market-panel > header span { display: block; margin-top: 5px }
  .quote                { padding: 14px 12px 12px }
  .quote-value          { font-size: 20px }
  .button-contact       { width: 100% }
}