/* ============================================================
   gerador-biografico.css
   Estilo idêntico ao bêbado_estatistico.php
   ============================================================ */

* { margin:0; padding:0; box-sizing:border-box; }

:root {
  --bg-primary: #fafbff;
  --bg-card: #ffffff;
  --bg-soft: #f6f7fb;
  --border-light: rgba(226,232,240,0.8);
  --border-focus: rgba(139,92,246,0.5);
  --text-primary: #0a0f1e;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-primary: #8b5cf6;
  --accent-secondary: #a78bfa;
  --accent-glow: rgba(139,92,246,0.2);
  --accent-gradient: linear-gradient(135deg,#8b5cf6,#c084fc);
  --shadow-sm: 0 4px 12px rgba(15,23,42,0.04);
  --shadow-md: 0 8px 24px rgba(15,23,42,0.08);
  --shadow-lg: 0 20px 48px -8px rgba(139,92,246,0.2);
  --shadow-glow: 0 8px 32px rgba(139,92,246,0.15);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}

body {
  background: var(--bg-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 400px;
  background: radial-gradient(circle at 50% 0%, rgba(139,92,246,0.08), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 12px 48px;
  position: relative;
  z-index: 1;
}

/* ── HEADER ─────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 40px;
  box-shadow: var(--shadow-sm);
}

.logo {
  width: 44px; height: 44px;
  border-radius: 22px;
  background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: white;
  box-shadow: 0 8px 16px rgba(139,92,246,0.3);
  transform: rotate(-5deg);
  flex-shrink: 0;
}

.head-text { flex: 1; min-width: 0; }

.title-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.title {
  font-size: 18px; font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(135deg,#0a0f1e 0%,#2d1b4e 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 100px;
  color: var(--accent-primary);
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}

.subtitle {
  color: var(--text-muted); font-size: 12px; font-weight: 500; margin-top: 2px;
}

/* ── CARDS ───────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  margin-bottom: 16px;
}

.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: var(--transition);
}

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

.section-title h3 {
  font-size: 16px; font-weight: 800;
  display: flex; align-items: center; gap: 6px;
}

.section-title h3 i { color: var(--accent-primary); font-size: 18px; }

.hint {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg-soft);
  padding: 4px 10px; border-radius: 100px;
}

/* ── FORM GRID ───────────────────────────────── */
.form-grid {
  display: flex; flex-direction: column; gap: 16px;
}

.col-6, .col-12 { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--text-secondary);
}

.field-label i { color: var(--accent-primary); font-size: 13px; }

select, input[type="text"], input[type="date"], input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 2px solid var(--border-light);
  border-radius: 14px;
  font-size: 14px; font-weight: 500;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none; appearance: none;
  font-family: 'Inter', sans-serif;
}

select:focus, input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}

/* ── MODO DE GERAÇÃO ─────────────────────────── */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 10px;
}

.mode-card {
  border: 2px solid var(--border-light);
  border-radius: 16px;
  padding: 14px 10px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  background: var(--bg-card);
}

.mode-card:hover { border-color: var(--accent-secondary); }

.mode-card.selected {
  border-color: var(--accent-primary);
  background: rgba(139,92,246,0.06);
}

.mode-icon { font-size: 22px; margin-bottom: 6px; }

.mode-label {
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
}

.mode-card.selected .mode-label { color: var(--accent-primary); }

.mode-desc {
  font-size: 11px; color: var(--text-muted); margin-top: 3px;
}

/* ── BIO SECTIONS ────────────────────────────── */
.bio-section {
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0;
}

.bio-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  cursor: pointer;
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  user-select: none;
  gap: 8px;
}

.bio-section-header:hover { color: var(--accent-primary); }

.bio-section-header i { color: var(--accent-primary); margin-right: 6px; }

.section-meta {
  display: flex; align-items: center; gap: 8px;
}

.section-count {
  font-size: 11px; font-weight: 700;
  background: rgba(139,92,246,0.1);
  color: var(--accent-primary);
  padding: 2px 8px;
  border-radius: 100px;
  min-width: 22px; text-align: center;
}

.chevron {
  color: var(--text-muted);
  font-size: 12px;
  transition: transform 0.2s;
}

.chevron.open { transform: rotate(180deg); }

.bio-section-body {
  padding-bottom: 16px;
  overflow: hidden;
}

.bio-section-body.collapsed { display: none; }

.section-note {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 12px; margin-top: 4px;
}

/* ── BLOCOS INTERNOS (pessoa, data, pet...) ──── */
.block-item {
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
}

.block-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}

.block-label {
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
}

.remove-btn {
  background: none; border: none; cursor: pointer;
  color: #ef4444; font-size: 13px;
  padding: 4px 8px;
  border-radius: 8px;
  transition: var(--transition);
}

.remove-btn:hover { background: rgba(239,68,68,0.1); }

.inner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.inner-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

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

.check-group {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 8px;
}

.check-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-secondary);
  cursor: pointer;
}

.check-item input[type="checkbox"] {
  width: 15px; height: 15px; cursor: pointer;
  padding: 0;
}

/* ── ADD BUTTON ──────────────────────────────── */
.add-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: rgba(139,92,246,0.08);
  border: 1px dashed rgba(139,92,246,0.4);
  border-radius: 100px;
  color: var(--accent-primary);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 4px;
}

.add-btn:hover {
  background: rgba(139,92,246,0.14);
  border-style: solid;
}

/* ── POOL PREVIEW ────────────────────────────── */
.pool-numbers-wrap {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 10px;
}

.pool-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(139,92,246,0.1);
  border: 2px solid rgba(139,92,246,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--accent-primary);
  transition: var(--transition);
}

.pool-sources {
  font-size: 12px; color: var(--text-muted);
  display: flex; flex-wrap: wrap; gap: 8px;
}

.pool-source-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px;
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  border-radius: 100px;
  padding: 3px 10px;
}

/* ── BOTÃO PRINCIPAL ─────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 16px 24px;
  background: var(--accent-gradient);
  border: none; border-radius: 100px;
  color: white;
  font-weight: 800; font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 8px 20px rgba(139,92,246,0.3);
  margin-bottom: 12px;
  font-family: 'Inter', sans-serif;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(139,92,246,0.4);
}

.btn:active { transform: scale(0.98); }

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: none;
}

.btn-outline:hover {
  background: rgba(139,92,246,0.08);
  transform: none;
  box-shadow: none;
}

.btn-success {
  background: linear-gradient(135deg,#10b981,#059669);
  box-shadow: 0 8px 20px rgba(16,185,129,0.3);
}

.btn-group {
  display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0;
}

/* ── PRIVACY NOTE ────────────────────────────── */
.privacy-note {
  text-align: center;
  font-size: 12px; color: var(--text-muted);
  padding: 8px;
  margin-bottom: 24px;
}

/* ── RESULTADO ───────────────────────────────── */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.result-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 8px;
}

.game-label {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.balls-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 14px;
  justify-content: center;
}

.ball {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
  transition: var(--transition);
  animation: ballPop 0.3s ease;
  flex-shrink: 0;
}

.ball.bio {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 6px 14px rgba(139,92,246,0.3);
}

.ball.rand {
  background: var(--bg-soft);
  color: var(--text-secondary);
  border: 2px solid var(--border-light);
}

@keyframes ballPop {
  0% { transform: scale(0.6); opacity: 0; }
  80% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.metrics-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px;
}

.metric-badge {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 100px;
}

.m-bio { background: rgba(139,92,246,0.12); color: var(--accent-primary); }
.m-date { background: rgba(245,158,11,0.12); color: #b45309; }
.m-balance { background: rgba(16,185,129,0.12); color: #059669; }

.origins-toggle {
  font-size: 12px; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; gap: 4px;
  border: none; background: none; padding: 0; font-family: inherit;
}

.origins-toggle:hover { color: var(--accent-primary); }

.origins-list {
  margin-top: 10px;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
  display: none;
}

.origins-list.open { display: block; }

.origin-row {
  display: flex; gap: 8px;
  font-size: 12px; color: var(--text-secondary);
  padding: 3px 0;
}

.origin-num {
  font-weight: 700; color: var(--text-primary);
  min-width: 24px;
}

/* ── POOL DE JOGOS (resultado) ───────────────── */
.pool-result-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.pool-result-item {
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 14px;
}

.pool-result-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 8px;
}

.pool-result-nums {
  font-family: 'Inter', monospace;
  font-size: 15px; font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

/* ── DISCLAIMER ──────────────────────────────── */
.disclaimer {
  margin-top: 32px;
  padding: 20px;
  background: linear-gradient(145deg,#fff7ed,#fffbeb);
  border: 2px solid #fed7aa;
  border-radius: 20px;
  color: #9a3412;
  text-align: center;
  font-weight: 500; font-size: 14px;
}

.disclaimer strong {
  font-size: 15px; color: #7c2d12;
}

/* ── EXPORT TOAST ────────────────────────────── */
.export-toast {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent-gradient);
  color: white;
  padding: 12px 24px;
  border-radius: 100px;
  font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.export-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── ANIMAÇÕES ───────────────────────────────── */
@keyframes float {
  0%,100% { transform: rotate(-5deg) translateY(0); }
  50% { transform: rotate(-5deg) translateY(-5px); }
}

.float { animation: float 3s ease-in-out infinite; }

/* ── TABLET & DESKTOP ────────────────────────── */
@media (min-width: 720px) {
  .container { padding: 24px 20px 64px; }

  .logo { width: 56px; height: 56px; font-size: 28px; }
  .title { font-size: 24px; }
  .badge { font-size: 13px; padding: 6px 14px; }
  .subtitle { font-size: 14px; }
  .card { padding: 24px; border-radius: 24px; }

  .form-grid {
    display: grid;
    grid-template-columns: repeat(12,1fr);
    gap: 20px;
  }

  .col-6 { grid-column: span 6; }
  .col-12 { grid-column: span 12; }

  .ball { width: 54px; height: 54px; font-size: 18px; }

  .pool-result-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  }

  .btn { width: auto; min-width: 320px; margin: 0 auto 12px; display: flex; }
}

.intro-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  padding: 16px 18px;
   margin: -4px 0 18px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  color: var(--text-secondary);
  line-height: 1.55;
}

.intro-card p {
  margin: 0;
  font-size: 15px;
}
/* ── MOBILE PEQUENO ──────────────────────────── */
@media (max-width: 360px) {
  .mode-grid { grid-template-columns: 1fr; }
  .ball { width: 40px; height: 40px; font-size: 14px; }
  .inner-grid { grid-template-columns: 1fr; }
}

/* iOS: previne zoom em inputs */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  select, input[type="text"], input[type="date"], input[type="number"] {
    font-size: 16px;
  }
}

/* Touch targets mínimos */
button, .add-btn, .mode-card, .bio-section-header { min-height: 44px; }