/* ============================================================
   base.css — variáveis, reset, tipografia, botões, utilitários
   Importado por todas as páginas.
   ============================================================ */

/* ── Variáveis ──────────────────────────────────────────── */
:root {
  --bg:          #0d1117;
  --bg2:         #161b22;
  --bg3:         #21262d;
  --felt:        #1b5e38;
  --felt-edge:   #0a2a18;
  --gold:        #d4a843;
  --gold-l:      #f0c96a;
  --gold-dim:    rgba(212,168,67,.15);
  --gold-border: rgba(212,168,67,.25);
  --cream:       #f0e6cc;
  --red:         #c0392b;
  --red-dim:     rgba(192,57,43,.18);
  --green:       #2ecc71;
  --green-dim:   rgba(46,204,113,.12);
  --text-dim:    rgba(240,230,204,.45);
  --border:      rgba(212,168,67,.2);
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 24px 80px rgba(0,0,0,.6);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100%;
}

body {
  font-family: 'Crimson Pro', serif;
  font-size: 16px;
  color: var(--cream);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(27,94,56,.25) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(212,168,67,.08) 0%, transparent 50%),
    repeating-linear-gradient(
      45deg,
      transparent, transparent 40px,
      rgba(212,168,67,.015) 40px, rgba(212,168,67,.015) 41px
    );
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

/* ── Tipografia ─────────────────────────────────────────── */
h1, h2, h3, .font-display {
  font-family: 'Playfair Display', serif;
}

.logo-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: .25em;
  color: var(--gold);
  text-shadow: 0 0 60px rgba(212,168,67,.4);
  line-height: 1;
}

.logo-sub {
  font-size: .9rem;
  letter-spacing: .2em;
  color: var(--text-dim);
  margin-top: 6px;
  font-style: italic;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: .08em;
}

.text-dim   { color: var(--text-dim); }
.text-gold  { color: var(--gold); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-sm    { font-size: .82rem; }
.text-xs    { font-size: .72rem; }
.italic     { font-style: italic; }
.uppercase  { text-transform: uppercase; letter-spacing: .1em; }
.text-center { text-align: center; }

/* ── Layout ─────────────────────────────────────────────── */
.page-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 16px;
}

.container {
  width: 100%;
  max-width: 480px;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.card-sm {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

/* ── Botões ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Playfair Display', serif;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
}

.btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-full { width: 100%; }

.btn-primary {
  background: var(--gold);
  color: #0d1117;
  box-shadow: 0 4px 20px rgba(212,168,67,.3);
}
.btn-primary:not(:disabled):hover {
  background: var(--gold-l);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(212,168,67,.5);
}

.btn-ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--border);
}
.btn-ghost:not(:disabled):hover {
  background: var(--gold-dim);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--red-dim);
  color: #e74c3c;
  border: 1px solid rgba(192,57,43,.3);
}
.btn-danger:not(:disabled):hover {
  background: rgba(192,57,43,.3);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 14px;
  font-size: .75rem;
}

/* ── Formulários ────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group:last-of-type { margin-bottom: 0; }

label {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

input, select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  color: var(--cream);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}

input:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,168,67,.15);
}

input::placeholder { color: var(--text-dim); }

/* ── Mensagens ──────────────────────────────────────────── */
.msg {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: .85rem;
  text-align: center;
  margin-bottom: 16px;
}

.msg-erro {
  background: var(--red-dim);
  border: 1px solid rgba(192,57,43,.3);
  color: #e74c3c;
}

.msg-ok {
  background: var(--green-dim);
  border: 1px solid rgba(46,204,113,.25);
  color: var(--green);
}

.msg-info {
  background: var(--gold-dim);
  border: 1px solid var(--border);
  color: var(--gold-l);
}

/* ── Separador com texto ────────────────────────────────── */
.sep-txt {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: .78rem;
  margin: 16px 0;
}
.sep-txt::before,
.sep-txt::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Spinner ────────────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  animation: spin .8s linear infinite;
  margin: 0 auto;
}

.spinner-sm {
  width: 18px; height: 18px;
  border-width: 2px;
}

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

/* ── Fichas badge ───────────────────────────────────────── */
.fichas-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-family: 'Playfair Display', serif;
  font-size: .8rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

/* ── Top bar ────────────────────────────────────────────── */
.top-bar {
  width: 100%;
  max-width: 880px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 6px;
  margin-bottom: 4px;
  gap: 10px;
}

.top-nome {
  font-family: 'Playfair Display', serif;
  font-size: .9rem;
  font-weight: 700;
  color: var(--gold-l);
}

/* ── Utilitários ────────────────────────────────────────── */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { display: flex; flex-direction: column; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.w-full { width: 100%; }

/* ── Animação de entrada de tela ────────────────────────── */
.screen-enter {
  animation: screenIn .35s cubic-bezier(.34,1.56,.64,1);
}

@keyframes screenIn {
  from { opacity:0; transform: translateY(18px) scale(.97); }
  to   { opacity:1; transform: translateY(0)     scale(1);  }
}

/* ── Pulse (aguardando) ─────────────────────────────────── */
.pulse {
  animation: pulse 1.4s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .25; }
}
