/* ==========================================================================
   Yacht Market — base: tokens da marca, reset, tipografia e componentes
   Cores amostradas dos logos: azul-marinho #012334 · ouro #E4A730 · bronze #B17707
   ========================================================================== */
:root {
  --navy-950: #011a28;
  --navy-900: #012334;
  --navy-800: #0a3148;
  --navy-700: #14425d;
  --navy-600: #245a7b;
  --navy-500: #3d7497;

  --gold-300: #f0cb7c;
  --gold-400: #ecb948;
  --gold-500: #e4a730;
  --gold-600: #c8901a;
  --gold-700: #b17707;
  --gold-800: #8a5c06;

  --ivory: #f7f3ea;
  --sand-100: #efe8da;
  --sand-200: #e3d9c5;
  --paper: #ffffff;

  --ink: #10222e;
  --ink-2: #465966;
  --ink-3: #6f7f8a;

  --line: rgba(1, 35, 52, .12);
  --line-strong: rgba(1, 35, 52, .24);

  /* estados (sempre acompanhados de texto/ícone) */
  --ok: #1d6f4d;      --ok-bg: #e2f2ea;
  --warn: #85590a;    --warn-bg: #fbeed0;
  --bad: #a92f2a;     --bad-bg: #fbe4e2;
  --info: #1b5f8a;    --info-bg: #e0edf5;

  --font-display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --font-ui: "Jost", "Segoe UI", system-ui, -apple-system, sans-serif;

  --r-sm: 3px;
  --r-md: 6px;
  --r-lg: 10px;

  --shadow-sm: 0 1px 2px rgba(1, 35, 52, .06);
  --shadow-md: 0 10px 28px -10px rgba(1, 35, 52, .22);
  --shadow-lg: 0 28px 64px -24px rgba(1, 35, 52, .45);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --gutter: 24px;
  --maxw: 1240px;
  --header-h: 84px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-600); outline-offset: 2px; }
::selection { background: var(--gold-400); color: var(--navy-900); }

.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.i.fill { fill: currentColor; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }

/* ---------- Tipografia ---------- */
.eyebrow {
  font: 500 .72rem/1.2 var(--font-ui);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold-700);
  display: inline-flex; align-items: center; gap: 14px;
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: currentColor; opacity: .7; }
.on-dark .eyebrow, .eyebrow.on-dark { color: var(--gold-500); }
.eyebrow.plain::before { display: none; }

.display, .h1, .h2, .h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -.01em; line-height: 1.05; font-variant-numeric: lining-nums; }
.h1 { font-size: clamp(2.7rem, 6.2vw, 5.4rem); }
.h2 { font-size: clamp(2.1rem, 4vw, 3.4rem); }
.h3 { font-size: clamp(1.5rem, 2.2vw, 2rem); line-height: 1.15; }
.h1, .h2, .h3, .sec-head, .page-hero h1 { text-wrap: balance; }
.lead, .prose p { text-wrap: pretty; }
.display em, .h1 em, .h2 em, .h3 em { font-style: italic; color: var(--gold-700); font-weight: 500; }
.on-dark .display em, .on-dark .h1 em, .on-dark .h2 em, .on-dark .h3 em { color: var(--gold-500); }
.lead { font-size: 1.15rem; line-height: 1.7; color: var(--ink-2); font-weight: 300; max-width: 62ch; }
.on-dark .lead { color: rgba(247, 243, 234, .78); }
.prose p + p { margin-top: 1em; }
.prose { color: var(--ink-2); font-weight: 300; font-size: 1.05rem; line-height: 1.8; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 28px;
  font: 500 .76rem/1 var(--font-ui);
  letter-spacing: .16em; text-transform: uppercase;
  border: 1px solid transparent; border-radius: var(--r-sm);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
  white-space: nowrap; user-select: none;
}
.btn .i { font-size: 1.25em; transition: transform .25s var(--ease); }
.btn:hover .i-arrow-shift, .btn:hover .i.arrow { transform: translateX(4px); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn-gold { background: var(--gold-500); color: var(--navy-900); }
.btn-gold:hover { background: var(--gold-400); box-shadow: 0 10px 26px -10px rgba(228, 167, 48, .8); }
.btn-navy { background: var(--navy-900); color: var(--ivory); }
.btn-navy:hover { background: var(--navy-700); }
.btn-ghost { border-color: rgba(228, 167, 48, .7); color: var(--gold-500); background: transparent; }
.btn-ghost:hover { background: rgba(228, 167, 48, .12); border-color: var(--gold-500); }
.btn-outline { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-outline:hover { border-color: var(--navy-900); background: rgba(1, 35, 52, .04); }
.btn-light { background: var(--ivory); color: var(--navy-900); }
.btn-light:hover { background: #fff; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #8d2521; }
.btn-text { padding: 6px 0; letter-spacing: .16em; color: var(--gold-700); border-radius: 0; border-bottom: 1px solid currentColor; }
.btn-text:hover { color: var(--navy-900); }
.on-dark .btn-text { color: var(--gold-500); }
.on-dark .btn-text:hover { color: var(--gold-300); }
.btn-sm { padding: 10px 18px; font-size: .7rem; }
.btn-lg { padding: 19px 36px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: 44px; height: 44px; border-radius: 50%; }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .label {
  font: 500 .7rem/1.2 var(--font-ui);
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2);
}
.field .hint { font-size: .78rem; color: var(--ink-3); line-height: 1.4; }
.field .err { font-size: .78rem; color: var(--bad); }
input:where(:not([type=checkbox], [type=radio], [type=range], [type=file], [type=hidden], [type=submit], [type=button], [type=color])), select, textarea {
  width: 100%; font: 400 1rem/1.4 var(--font-ui); color: var(--ink);
  padding: 13px 15px; background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  transition: border-color .2s, box-shadow .2s, background .2s;
  appearance: none; -webkit-appearance: none;
}
select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23465966' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #9aa7af; }
input:hover, select:hover, textarea:hover { border-color: rgba(1, 35, 52, .45); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-600); box-shadow: 0 0 0 3px rgba(228, 167, 48, .28); }
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(169, 47, 42, .12); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--gold-700); cursor: pointer; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px 16px; }
.form-grid > * { grid-column: span 12; }
.form-grid .c-6 { grid-column: span 6; } .form-grid .c-4 { grid-column: span 4; } .form-grid .c-3 { grid-column: span 3; } .form-grid .c-8 { grid-column: span 8; } .form-grid .c-2 { grid-column: span 2; }
@media (max-width: 640px) { .form-grid .c-6, .form-grid .c-4, .form-grid .c-3, .form-grid .c-8, .form-grid .c-2 { grid-column: span 12; } .form-grid .c-3.keep, .form-grid .c-6.keep { grid-column: span 6; } }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; color: var(--ink-2); cursor: pointer; line-height: 1.45; }
.check input { margin-top: 2px; }
.input-affix { position: relative; }
.input-affix > .pre, .input-affix > .suf { position: absolute; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: .9rem; pointer-events: none; }
.input-affix > .pre { left: 14px; } .input-affix > .suf { right: 14px; }
.input-affix.has-pre input { padding-left: 42px; } .input-affix.has-suf input { padding-right: 52px; }

.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 99px; background: #c5ced3; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--gold-700); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--gold-600); outline-offset: 2px; }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 99px;
  font: 500 .72rem/1.2 var(--font-ui); letter-spacing: .02em; white-space: nowrap;
  background: rgba(1, 35, 52, .07); color: var(--ink-2);
}
.chip .i { font-size: 1.05em; }
.chip.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.gold { background: rgba(228, 167, 48, .2); color: var(--gold-800); }
.chip.navy { background: var(--navy-900); color: var(--gold-400); }
.chip.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }

/* ---------- Overlay: modal, drawer, toast ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(1, 26, 40, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade-in .25s var(--ease);
}
.overlay.is-closing { animation: fade-out .2s var(--ease) forwards; }
.modal {
  background: var(--paper); width: 100%; max-width: 580px; max-height: calc(100vh - 40px);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: rise-in .35s var(--ease);
}
.modal.lg { max-width: 920px; } .modal.xl { max-width: 1120px; } .modal.sm { max-width: 440px; }
.modal-head { padding: 22px 28px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 500 1.7rem/1.1 var(--font-display); letter-spacing: -.01em; }
.modal-head p { color: var(--ink-3); font-size: .9rem; margin-top: 4px; }
.modal-body { padding: 24px 28px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 16px 28px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; background: #fbf9f4; }
.x-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); flex: none; transition: background .2s; }
.x-btn:hover { background: rgba(1, 35, 52, .08); }
.overlay.drawer-wrap { justify-content: flex-end; align-items: stretch; padding: 0; }
.drawer {
  background: var(--paper); width: min(620px, 100%); height: 100%; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: slide-in .35s var(--ease);
}
.drawer.wide { width: min(820px, 100%); }
.overlay.is-closing .drawer { animation: slide-out .2s var(--ease) forwards; }
.overlay.is-closing .modal { animation: rise-out .2s var(--ease) forwards; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(22px) scale(.985); } }
@keyframes rise-out { to { opacity: 0; transform: translateY(14px); } }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes slide-out { to { transform: translateX(40px); opacity: 0; } }

.toast-stack { position: fixed; z-index: 400; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; align-items: center; width: min(92vw, 520px); pointer-events: none; }
.toast .t-act { pointer-events: auto; }
.toast {
  pointer-events: none; display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--navy-900); color: var(--ivory); padding: 14px 18px; border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); border: 1px solid rgba(228, 167, 48, .35); font-size: .92rem;
  animation: rise-in .3s var(--ease);
}
.toast .i { color: var(--gold-500); font-size: 1.3em; }
.toast.err .i { color: #ff9a94; }
.toast .t-act { margin-left: auto; color: var(--gold-400); font-weight: 500; letter-spacing: .06em; font-size: .8rem; text-transform: uppercase; white-space: nowrap; }
.toast .t-act:hover { color: var(--gold-300); text-decoration: underline; }

/* ---------- Tooltip dos gráficos ---------- */
.viz-tip {
  position: fixed; z-index: 500; pointer-events: none; min-width: 140px; max-width: 260px;
  background: #fff; color: var(--ink); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: 10px 12px; font-size: .82rem; line-height: 1.4;
}
.viz-tip .tt { color: var(--ink-3); font-size: .74rem; margin-bottom: 4px; }
.viz-tip .tr { display: flex; align-items: center; gap: 8px; }
.viz-tip .tk { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.viz-tip .tv { font-weight: 600; font-size: .95rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.viz-tip .tl { color: var(--ink-3); font-size: .78rem; }

/* ---------- Animação de entrada ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
