/* ══════════════════════════════════════════════
   components.css — UI reutilizáveis
══════════════════════════════════════════════ */

/* ── Buttons ── */
.btn {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--ink); background: var(--gold);
  border: none; padding: 0.7rem 2.2rem;
  cursor: pointer; transition: all var(--transition);
  display: inline-block;
}
.btn:hover  { background: var(--gold-l); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-ghost {
  background: transparent; color: var(--gold);
  border: 1px solid var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 0.55rem 1.5rem; cursor: pointer;
  transition: all var(--transition); display: inline-block;
}
.btn-ghost:hover { background: var(--glow); color: var(--gold-l); }

.btn-premium {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); background: transparent;
  border: 1px solid var(--gold);
  padding: 0.65rem 2rem; cursor: pointer;
  transition: all var(--transition);
  position: relative; overflow: hidden;
}
.btn-premium::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(201,168,76,0.1), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.btn-premium:hover::before { opacity: 1; }
.btn-premium:hover { border-color: var(--gold-l); color: var(--gold-l); }

/* ── Card box ── */
.card-box {
  background: var(--ink2);
  border: 1px solid var(--border);
  padding: 1.5rem; margin-bottom: 1.5rem;
}
.card-box h3 {
  font-family: 'Cinzel', serif; font-size: 0.85rem;
  letter-spacing: 0.2em; color: var(--gold);
  text-transform: uppercase; margin-bottom: 1rem;
}

/* ── Reading box ── */
.reading-box {
  background: var(--ink3);
  border: 1px solid rgba(201,168,76,0.2);
  border-left: 3px solid var(--gold);
  padding: 1.5rem; margin-top: 1.5rem;
  display: none; animation: fadeUp 0.4s ease;
  scroll-margin-top: 1rem;
}
.reading-box.show { display: block; }
.reading-box h4 {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  letter-spacing: 0.25em; color: var(--gold);
  text-transform: uppercase; margin-bottom: 0.8rem;
}
.reading-text { font-style: normal; color: var(--parch); line-height: 1.9; font-size: 1rem; letter-spacing: 0.015em; }
#iching-meaning { text-align: center; }

/* ── AI badge ── */
.ai-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.25);
  font-family: 'Cinzel', serif; font-size: 0.6rem;
  letter-spacing: 0.15em; color: var(--gold-d);
  padding: 3px 10px; margin-bottom: 1rem;
}

/* ── Upgrade banner ── */
.upgrade-banner {
  background: linear-gradient(135deg, var(--violet), var(--crimson));
  border: 1px solid rgba(201,168,76,0.3);
  padding: 1.2rem 1.5rem; margin-top: 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.upgrade-banner p { font-family: 'Cinzel', serif; font-size: 0.78rem; letter-spacing: 0.1em; color: var(--parch); }
.upgrade-banner strong { color: var(--gold); }

/* ── Share row ── */
.share-row {
  display: flex; justify-content: center; gap: 10px;
  flex-wrap: wrap; margin-top: 1.5rem;
}
.share-btn {
  font-family: 'Cinzel', serif; font-size: 0.62rem;
  letter-spacing: 0.18em; color: var(--parch3);
  background: var(--ink2); border: 1px solid var(--border);
  padding: 0.4rem 0.9rem; cursor: pointer; transition: all 0.2s;
}
.share-btn:hover { color: var(--gold); border-color: var(--gold); }

/* ── Letter chip ── */
.letter-chip {
  background: var(--ink3); border: 1px solid var(--border);
  padding: 4px 8px; text-align: center; min-width: 34px;
}
.letter-chip .l { font-family: 'Cinzel', serif; font-size: 0.9rem; color: var(--gold); }
.letter-chip .n { font-size: 0.7rem; color: var(--parch3); }

/* ── Affiliate cards ── */
.affiliate-card {
  background: var(--ink3); border: 1px solid var(--border);
  padding: 1rem; cursor: pointer;
  transition: border-color var(--transition);
  text-decoration: none; display: block;
}
.affiliate-card:hover { border-color: var(--gold); }
.affiliate-card .af-icon { font-size: 2rem; text-align: center; margin-bottom: 8px; }
.affiliate-card .af-title {
  font-family: 'Cinzel', serif; font-size: 0.68rem;
  letter-spacing: 0.1em; color: var(--gold); margin-bottom: 4px;
}
.affiliate-card .af-desc { font-size: 0.82rem; color: var(--parch3); }
.affiliate-card .af-cta  { font-family: 'Cinzel', serif; font-size: 0.65rem; color: var(--gold-d); margin-top: 6px; }

/* ── Premium modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(9,7,12,0.92);
  z-index: 200; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-box {
  max-width: 480px; width: 100%;
  background: var(--ink2); border: 1px solid var(--gold);
  padding: 2.5rem; text-align: center;
  position: relative; animation: fadeUp 0.3s ease;
}
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: transparent; border: none;
  color: var(--parch3); cursor: pointer; font-size: 1.2rem;
}
.modal-close:hover { color: var(--gold); }

.premium-perks { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 1.5rem; }
.perk {
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  font-family: 'Cinzel', serif; font-size: 0.62rem;
  letter-spacing: 0.12em; color: var(--gold-d);
  padding: 4px 12px;
}

.price-tag  { font-family: 'Cinzel Decorative', serif; font-size: 2.2rem; color: var(--gold); margin-bottom: 0.2rem; }
.price-sub  { font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 0.2em; color: var(--parch3); }

/* ── Spread selector ── */
.spread-selector { display: flex; justify-content: center; gap: 10px; margin-bottom: 2rem; flex-wrap: wrap; }
.spread-opt {
  font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 0.2em;
  color: var(--parch3); border: 1px solid var(--border);
  padding: 0.35rem 0.9rem; cursor: pointer; transition: all 0.2s; background: transparent;
}
.spread-opt.active, .spread-opt:hover { color: var(--gold); border-color: var(--gold); background: var(--glow2); }

/* ── Numerology grid ── */
.num-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.num-card {
  background: var(--ink2); border: 1px solid var(--border);
  border-top: 2px solid var(--gold); padding: 1.2rem; text-align: center;
}
.num-card .big  { font-family: 'Cinzel Decorative', serif; font-size: 2.8rem; color: var(--gold); line-height: 1; margin-bottom: 4px; }
.num-card .label { font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 0.2em; color: var(--gold-d); text-transform: uppercase; }
.num-card .meaning { font-style: italic; font-size: 0.85rem; color: var(--parch3); margin-top: 6px; line-height: 1.4; }

/* ── Rune stones ── */
.rune-bag { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 2rem; }
.rune-stone {
  width: 50px; height: 60px; background: var(--ink3);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.25s; font-size: 1.3rem; color: rgba(201,168,76,0.3);
}
.rune-stone:hover, .rune-stone.selected {
  background: var(--ink4); border-color: var(--gold);
  color: var(--gold); transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(201,168,76,0.1);
}
.rune-stone .rname { font-family: 'Cinzel', serif; font-size: 0.45rem; letter-spacing: 0.1em; color: var(--gold-d); margin-top: 2px; }

/* ── Gematria ── */
.gem-input-wrap { max-width: 500px; margin: 0 auto 2rem; display: flex; gap: 10px; }
.gem-input {
  flex: 1; background: var(--ink2);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--parch); padding: 0.7rem 1rem;
  font-family: 'EB Garamond', serif; font-size: 1.1rem; outline: none;
}
.gem-input:focus { border-color: var(--gold); }

.gem-systems { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.gem-sys { background: var(--ink2); border: 1px solid var(--border); padding: 1rem; text-align: center; }
.gem-sys .sys-name  { font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 0.2em; color: var(--gold-d); text-transform: uppercase; margin-bottom: 4px; }
.gem-sys .sys-num   { font-family: 'Cinzel Decorative', serif; font-size: 2.2rem; color: var(--gold); line-height: 1; }
.gem-sys .sys-meaning { font-style: italic; font-size: 0.78rem; color: var(--parch3); margin-top: 4px; }

.gem-breakdown {
  background: var(--ink3); border: 1px solid rgba(201,168,76,0.12);
  padding: 1rem; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1rem;
}

/* ── Moon ── */
.moon-circle {
  width: 120px; height: 120px; border-radius: 50%;
  margin: 0 auto 1rem;
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; background: var(--ink3);
  animation: moonGlow 4s ease-in-out infinite;
}
.moon-name { font-family: 'Cinzel Decorative', serif; font-size: 1.3rem; color: var(--gold); margin-bottom: 0.3rem; }
.moon-date { font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 0.25em; color: var(--gold-d); }

.lunar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.lunar-card { background: var(--ink2); border: 1px solid var(--border); padding: 1.2rem; }
.lunar-card h4 { font-family: 'Cinzel', serif; font-size: 0.72rem; letter-spacing: 0.2em; color: var(--gold); text-transform: uppercase; margin-bottom: 0.6rem; }
.lunar-card p  { font-size: 0.92rem; color: var(--parch2); line-height: 1.6; }

/* ── Tarot cards ── */
/* Carta de tarot — proporcao 2:3 fixa, sem sobreposição */
.tarot-grid { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin-bottom: 2.5rem; }

/* Largura fixa — mesma para verso e frente */
.t-card { width: 140px; cursor: pointer; perspective: 1000px; }
.t-card:hover .t-inner { transform: rotateY(5deg); }
.t-card.flip .t-inner  { transform: rotateY(180deg); }

/* t-inner: altura = imagem (210px) + caption (62px) = 272px */
.t-inner {
  position: relative;
  width: 140px;
  height: 272px;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(.4,0,.2,1);
}

/* Verso e frente: mesmas dimensões absolutas */
.t-back, .t-front {
  position: absolute; top: 0; left: 0;
  width: 140px; height: 272px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.t-back {
  border: 1px solid var(--gold-d);
  background: var(--ink3);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: rgba(201,168,76,0.25); position: absolute;
}
.t-back::after { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(201,168,76,0.12); }
.t-front {
  transform: rotateY(180deg);
  display: flex; flex-direction: column;
  border: 1px solid var(--gold);
  background: var(--ink4);
}

/* Imagem ocupa 210px (2:3 de 140px) — sem corte, carta inteira */
.t-img {
  width: 140px; height: 210px; display: block;
  object-fit: contain; object-position: center top;
  background: #f2ede4; flex-shrink: 0;
}
.t-caption {
  height: 62px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 6px; background: var(--ink3); flex-shrink: 0;
  border-top: 1px solid rgba(201,168,76,0.3);
}
.t-front .t-name { font-family: 'Cinzel', serif; font-size: 0.72rem; letter-spacing: 0.05em; color: var(--gold); text-align: center; line-height: 1.3; }
.t-front .t-kw   { font-style: italic; font-size: 0.72rem; color: var(--parch3); text-align: center; margin-top: 3px; line-height: 1.2; }
.pos-label { font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 0.12em; color: var(--gold-d); text-align: center; margin-top: 6px; text-transform: uppercase; }

/* Form inputs */
.field-label {
  display: block; font-family: 'Cinzel', serif;
  font-size: 0.7rem; letter-spacing: 0.2em; color: var(--gold-d);
  text-transform: uppercase; margin-bottom: 6px;
}
.field-input {
  width: 100%; background: var(--ink2);
  border: 1px solid rgba(201,168,76,0.25);
  border-bottom: 1px solid rgba(201,168,76,0.5);
  color: var(--parch); padding: 0.7rem 1rem;
  font-family: 'EB Garamond', serif; font-size: 1.1rem;
  outline: none; transition: border-color 0.3s; margin-bottom: 1.2rem;
}
.field-input:focus { border-color: var(--gold); background: var(--ink3); }

@media (max-width: 600px) {
  /* Tarot — caption aumentada para acomodar keywords longas sem overflow */
  .t-card { width: 100px; }
  .t-inner { width: 100px; height: 214px; }  /* 150 img + 64 caption */
  .t-back, .t-front { width: 100px; height: 214px; }
  .t-img { width: 100px; height: 150px; }
  .t-caption {
    height: 64px;
    font-size: 0.65rem;  /* ligeiramente menor para caber em 100px */
  }
  .t-front .t-name { font-size: 0.65rem; }
  .t-front .t-kw   { font-size: 0.62rem; }

  /* Grid: mais espaço abaixo para separar da reading-box */
  .tarot-grid { gap: 12px; margin-bottom: 3rem; }

  /* Reading-box: espaço extra no topo */
  .reading-box { margin-top: 2rem; }

  .gem-input-wrap { flex-direction: column; }
}

/* Celtic (5 cartas) no mobile: cards menores para reduzir altura total */
@media (max-width: 600px) {
  .tarot-grid.spread-celtic .t-card  { width: 80px; }
  .tarot-grid.spread-celtic .t-inner { width: 80px; height: 172px; } /* 120 img + 52 caption */
  .tarot-grid.spread-celtic .t-back,
  .tarot-grid.spread-celtic .t-front { width: 80px; height: 172px; }
  .tarot-grid.spread-celtic .t-img   { width: 80px; height: 120px; }
  .tarot-grid.spread-celtic .t-caption { height: 52px; font-size: 0.58rem; }
}