/* ═══════════════════════════════════════════════════
   STAND MOTOS — modals.css
   Formulários compactos: Financiamento e Vender Minha Moto
═══════════════════════════════════════════════════ */

/* ── Backdrop ──────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.82); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  padding: 1rem; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }

/* ── Card ──────────────────────────────────────── */
.modal-card {
  background: var(--card2);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  width: 100%; max-width: 600px;
  box-shadow: 0 32px 100px rgba(0,0,0,.8), 0 0 0 1px rgba(var(--red-rgb), .2);
  animation: modalIn .35s var(--ease) both;
  overflow: hidden;
  position: relative;
  /* Garante que não fique maior que a tela */
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ────────────────────────────────────── */
.modal-header {
  background: linear-gradient(135deg, #1a0208 0%, var(--card2) 70%);
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-tag {
  font-family: 'Oswald', sans-serif; font-size: .62rem; font-weight: var(--fw-bold);
  letter-spacing: .16em; text-transform: uppercase; color: var(--red-bright);
  display: flex; align-items: center; gap: .35rem; margin-bottom: .25rem;
  text-shadow: 0 0 16px var(--red-glow-soft);
}
.modal-tag::before {
  content: ''; width: 14px; height: 2px;
  background: linear-gradient(90deg, var(--red), var(--red-bright));
  display: block; border-radius: 2px;
  box-shadow: 0 0 8px var(--red-glow-soft);
}
.modal-title    { font-family: 'Oswald', sans-serif; font-size: 1.4rem; font-weight: var(--fw-bold); text-transform: uppercase; color: var(--white); line-height: 1; }
.modal-subtitle { color: var(--w40); font-size: .78rem; margin-top: .25rem; }
.modal-close {
  background: var(--w08); border: 1px solid var(--border); color: var(--w60);
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; margin-left: 1rem;
  transition: all .2s;
}
.modal-close:hover { background: var(--red); border-color: var(--red-bright); color: #fff; box-shadow: 0 0 16px var(--red-glow-soft); }

/* ── Body scrollável ───────────────────────────── */
.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* ── Seções do formulário ──────────────────────── */
.form-block { margin-bottom: 1.25rem; }

.form-block-title {
  font-family: 'Oswald', sans-serif; font-size: .62rem; font-weight: var(--fw-bold);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--red-bright); margin-bottom: .75rem;
  padding-bottom: .4rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .4rem;
}

/* ── Grid de campos ────────────────────────────── */
.f-row       { display: grid; gap: .65rem; margin-bottom: .65rem; }
.f-row.c2    { grid-template-columns: 1fr 1fr; }
.f-row.c3    { grid-template-columns: 1fr 1fr 1fr; }

/* ── Campo individual ──────────────────────────── */
.f-group { display: flex; flex-direction: column; gap: .3rem; }
.f-label {
  font-size: .68rem; font-family: 'Oswald', sans-serif;
  letter-spacing: .1em; text-transform: uppercase; color: var(--w40);
}
.f-label .req { color: var(--red); }

.f-input, .f-select, .f-textarea {
  background: var(--card); border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px; padding: .6rem .8rem;
  font-family: 'Barlow', sans-serif; font-size: .88rem;
  color: var(--white); outline: none;
  transition: border-color .2s; width: 100%;
}
.f-input::placeholder, .f-textarea::placeholder { color: var(--w20); }
.f-input:focus, .f-select:focus, .f-textarea:focus {
  border-color: var(--red-bright);
  box-shadow: 0 0 0 1px rgba(var(--red-rgb), .25), 0 0 16px var(--red-glow-soft);
}
.f-select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.25)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center;
}
.f-select option { background: var(--card2); }
.f-textarea { resize: vertical; min-height: 70px; }

/* ── Simulador (financiamento) ─────────────────── */
.sim-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem; margin-top: .5rem;
}
.sim-box-title {
  font-family: 'Oswald', sans-serif; font-size: .6rem;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--w40); margin-bottom: .75rem;
}
.sim-result {
  margin-top: .75rem; padding: .75rem 1rem;
  background: var(--red-surface); border: 1px solid rgba(var(--red-rgb), .28);
  border-radius: 8px; display: none;
  align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem;
}
.sim-result.visible { display: flex; }
.sim-val { font-family: 'Oswald', sans-serif; font-size: 1.4rem; color: var(--white); }
.sim-note { font-size: .7rem; color: var(--w40); max-width: 200px; line-height: 1.4; }

/* ── Upload de fotos ───────────────────────────── */
.upload-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .6rem; }
.upload-slot {
  aspect-ratio: 4/3; border: 2px dashed rgba(255,255,255,.12);
  border-radius: 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .3rem;
  cursor: pointer; transition: all .2s; position: relative;
  overflow: hidden; background: var(--card);
}
.upload-slot:hover { border-color: var(--red-border); background: var(--red-surface); }
.upload-slot:hover svg { color: var(--red); }
.upload-slot svg   { color: var(--w20); transition: color .2s; }
.upload-slot span  { font-size: .62rem; color: var(--w20); font-family: 'Oswald',sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.upload-slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-slot .preview { position: absolute; inset: 0; object-fit: cover; width: 100%; height: 100%; }
.upload-slot .rm-btn {
  position: absolute; top: .25rem; right: .25rem;
  background: var(--red); border: none; color: #fff;
  width: 18px; height: 18px; border-radius: 50%; font-size: .65rem;
  cursor: pointer; display: none; align-items: center; justify-content: center; line-height: 1;
}
.upload-slot.has-img { border-style: solid; border-color: var(--red-border); }
.upload-slot.has-img .rm-btn { display: flex; }

/* ── Checkbox troca ────────────────────────────── */
.f-check {
  display: flex; align-items: flex-start; gap: .6rem; cursor: pointer;
  padding: .7rem .9rem; background: var(--card);
  border: 1px solid var(--border); border-radius: 8px; transition: border-color .2s;
}
.f-check:hover { border-color: var(--red-border); background: var(--red-surface); }
.f-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--red); margin-top: 2px; flex-shrink: 0; cursor: pointer; }
.f-check-label { font-size: .85rem; color: var(--w60); line-height: 1.4; }
.f-check-label strong { color: var(--white); display: block; font-size: .88rem; margin-bottom: .1rem; }
.troca-extra {
  display: none; margin-top: .75rem; padding: .85rem;
  background: var(--red-surface); border: 1px solid rgba(var(--red-rgb), .2);
  border-radius: 8px;
}
.troca-extra.on { display: block; }
.troca-extra-title {
  font-family: 'Oswald', sans-serif; font-size: .62rem; font-weight: var(--fw-bold);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--red-bright); margin-bottom: .6rem;
}
.troca-picker { position: relative; }
.troca-loading { font-size: .78rem; color: var(--w40); padding: .35rem 0; }
.troca-search-wrap { position: relative; margin-bottom: .5rem; }
.troca-search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  max-height: 220px; overflow-y: auto;
  background: var(--card); border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; display: none;
  box-shadow: 0 14px 40px rgba(0,0,0,.55);
}
.troca-search-results.open { display: block; animation: trocaDrop .22s var(--ease, ease) both; }
@keyframes trocaDrop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.troca-search-item {
  display: block; width: 100%; text-align: left;
  padding: .58rem .8rem; cursor: pointer; font-size: .84rem; color: var(--white);
  background: transparent; border: none; border-bottom: 1px solid var(--border);
  font-family: 'Barlow', sans-serif; transition: background .15s;
}
.troca-search-item:last-child { border-bottom: none; }
.troca-search-item:hover, .troca-search-item.active { background: var(--red-surface); }
.troca-search-item-meta { font-size: .72rem; color: var(--w40); margin-top: .12rem; }
.troca-search-empty { padding: .65rem .8rem; font-size: .78rem; color: var(--w40); }
.troca-divider {
  display: flex; align-items: center; gap: .5rem;
  margin: .45rem 0 .6rem; font-size: .65rem; color: var(--w20);
  letter-spacing: .1em; text-transform: uppercase;
}
.troca-divider::before, .troca-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.troca-selected {
  margin-top: .65rem; padding: .55rem .75rem;
  background: var(--card); border: 1px solid rgba(var(--red-rgb), .25);
  border-radius: 8px; font-size: .8rem; color: var(--w60);
  display: none; align-items: center; justify-content: space-between; gap: .5rem;
}
.troca-selected.on { display: flex; animation: trocaDrop .22s ease both; }
.troca-selected strong { color: var(--white); font-weight: 600; }
.troca-clear {
  background: none; border: none; color: var(--w40); cursor: pointer;
  font-size: .72rem; font-family: 'Oswald', sans-serif; letter-spacing: .06em;
  text-transform: uppercase; flex-shrink: 0;
}
.troca-clear:hover { color: var(--red-bright); }

/* ── Footer do modal ───────────────────────────── */
.modal-footer {
  padding: .9rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end;
  gap: .75rem; background: rgba(15,15,16,.4);
  flex-shrink: 0; flex-wrap: wrap;
}
.modal-note {
  font-size: .72rem; color: var(--w20); flex: 1;
  display: flex; align-items: center; gap: .3rem;
}
.btn-sm { padding: .6rem 1.25rem !important; font-size: .78rem !important; }

/* ── Responsivo ────────────────────────────────── */
@media (max-width: 900px) { .nav-links, .nav-cta { display: none; } .hamburger { display: block; } }
@media (max-width: 900px) { .cat-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 900px) { .stores-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px) {
  .section { padding: 4rem 0; }
  .hero-stats { gap: 1.5rem; }
  .moto-grid { grid-template-columns: 1fr; }
  .search-main { flex-wrap: wrap; }
  .search-btn { flex: 1; justify-content: center; padding: 1rem; }
  .cat-grid { grid-template-columns: 1fr; }
  .stores-grid { grid-template-columns: 1fr; }
  .f-row.c2, .f-row.c3 { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: repeat(2,1fr); }
  .modal-body { padding: 1rem; }
  .modal-header { padding: 1rem 1.25rem; }
  .modal-footer { padding: .75rem 1rem; }
}
