/* ============================================================
   EUROMILHÕES SOCIEDADE — Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --gold:        #f4c542;
  --gold-light:  #fde98e;
  --gold-dark:   #c9981a;
  --blue-deep:   #06071a;
  --blue-dark:   #0d0e2a;
  --blue-mid:    #141535;
  --blue-card:   #1a1b3e;
  --blue-border: #2a2b55;
  --blue-hover:  #232450;
  --text:        #e8eaf0;
  --text-muted:  #8890b0;
  --green:       #34d399;
  --red:         #f87171;
  --orange:      #fb923c;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 4px 24px rgba(0,0,0,.4);
}

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

html { font-size: 15px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--blue-deep);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ---- STARS BACKGROUND ---- */
.stars-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 30%, #1a1060 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, #0a0a40 0%, transparent 50%),
    var(--blue-deep);
  overflow: hidden;
}
.stars-bg::before, .stars-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 45%, rgba(255,255,255,.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 25%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 60%, rgba(255,255,255,.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 10%, rgba(255,255,255,.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 80%, rgba(255,255,255,.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 85%, rgba(255,255,255,.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(2px 2px at 85% 35%, rgba(244,197,66,.4) 0%, transparent 100%),
    radial-gradient(2px 2px at 5%  55%, rgba(244,197,66,.3) 0%, transparent 100%);
  animation: twinkle 4s ease-in-out infinite alternate;
}
.stars-bg::after { animation-delay: 2s; opacity: .7; }
@keyframes twinkle { from { opacity: .5 } to { opacity: 1 } }

/* ---- NAVBAR ---- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.5rem;
  background: rgba(13,14,42,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--blue-border);
}
.nav-brand { display: flex; align-items: center; gap: .5rem; font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; color: var(--gold); }
.nav-star { font-size: 1.4rem; }
.nav-user { display: flex; align-items: center; gap: .75rem; }
.nav-name { font-size: .85rem; color: var(--text-muted); }

/* ---- CONTAINER ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; position: relative; z-index: 1; }

/* ---- GRID ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- CARD ---- */
.card {
  background: var(--blue-card);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card.card-gold { border-color: rgba(244,197,66,.4); background: linear-gradient(135deg, #1e1b40 0%, #1a1535 100%); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-header h3 { font-size: 1rem; font-weight: 600; color: var(--text); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

/* ---- WEEK HEADER ---- */
.week-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--blue-mid), var(--blue-card));
  border: 1px solid var(--blue-border); border-radius: var(--radius-lg);
}
.week-info { display: flex; align-items: center; gap: .75rem; }
.week-info h2 { font-family: 'Playfair Display', serif; font-size: 1.2rem; }
.week-date { text-align: right; }
.week-date .label { display: block; font-size: .75rem; color: var(--text-muted); }
.week-date strong { font-size: 1.1rem; color: var(--gold); }

/* ---- BADGES ---- */
.badge {
  display: inline-block; padding: .2rem .6rem; border-radius: 20px;
  font-size: .72rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
}
.badge-open    { background: rgba(52,211,153,.15); color: var(--green); border: 1px solid rgba(52,211,153,.3); }
.badge-success { background: rgba(52,211,153,.15); color: var(--green); border: 1px solid rgba(52,211,153,.3); }
.badge-warn    { background: rgba(251,146,60,.15);  color: var(--orange); border: 1px solid rgba(251,146,60,.3); }
.badge-neutral { background: rgba(136,144,176,.15); color: var(--text-muted); border: 1px solid rgba(136,144,176,.3); }
.badge-gold    { background: rgba(244,197,66,.15);  color: var(--gold); border: 1px solid rgba(244,197,66,.3); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.1rem; border-radius: var(--radius); border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: .88rem; font-weight: 500;
  text-decoration: none; transition: all .2s;
}
.btn-primary { background: var(--gold); color: #000; font-weight: 700; }
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.btn-outline:hover { background: rgba(244,197,66,.1); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--blue-hover); }
.btn-success { background: rgba(52,211,153,.2); color: var(--green); border: 1px solid rgba(52,211,153,.4); }
.btn-success:hover { background: rgba(52,211,153,.3); }
.btn-warn { background: rgba(248,113,113,.15); color: var(--red); border: 1px solid rgba(248,113,113,.3); }
.btn-warn:hover { background: rgba(248,113,113,.25); }
.btn-full { width: 100%; }
.btn-sm { padding: .3rem .75rem; font-size: .8rem; }

/* ---- FORM FIELDS ---- */
.field-group { margin-bottom: .9rem; }
.field-group label { display: block; font-size: .8rem; color: var(--text-muted); margin-bottom: .35rem; font-weight: 500; }
.field-group input, .field-group select, .field-group textarea {
  width: 100%; padding: .6rem .85rem;
  background: var(--blue-mid); color: var(--text);
  border: 1px solid var(--blue-border); border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif; font-size: .9rem;
  transition: border-color .2s;
}
.field-group input:focus, .field-group select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(244,197,66,.1);
}
.field-group small { color: var(--text-muted); font-size: .75rem; }

/* ---- ALERTS ---- */
.alert { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-error   { background: rgba(248,113,113,.15); color: var(--red);   border: 1px solid rgba(248,113,113,.3); }
.alert-success { background: rgba(52,211,153,.15);  color: var(--green); border: 1px solid rgba(52,211,153,.3); }

/* ---- JOGO DISPLAY (bolinhas) ---- */
.jogo-display { margin: .75rem 0 1rem; }
.jogo-numeros, .jogo-estrelas { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .4rem; }
.bola {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  font-weight: 700; font-size: .85rem;
}
.bola-num { background: var(--blue-mid); color: var(--text); border: 2px solid var(--blue-border); }
.bola-est { background: rgba(244,197,66,.15); color: var(--gold); border: 2px solid rgba(244,197,66,.4); font-size: .75rem; }
.bola-gold.bola-num { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 8px rgba(244,197,66,.3); }
.bola-gold.bola-est { background: rgba(244,197,66,.25); border-color: var(--gold); }
.bola-mini { width: 24px; height: 24px; font-size: .72rem; }
.bola-est-mini { font-size: .62rem; }

/* ---- BALL PICKER ---- */
.seletor-section { margin-bottom: 1rem; }
.seletor-section label { display: block; font-size: .82rem; color: var(--text-muted); margin-bottom: .5rem; font-weight: 500; }
.balls-grid {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: .3rem;
}
.balls-grid-small { grid-template-columns: repeat(6, 1fr); }
.ball-pick {
  aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--blue-border);
  background: var(--blue-mid); color: var(--text);
  font-size: .78rem; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.ball-pick:hover  { border-color: var(--gold); color: var(--gold); background: rgba(244,197,66,.08); }
.ball-pick.picked { background: var(--gold); color: #000; border-color: var(--gold); }
.ball-pick-est.picked { background: rgba(244,197,66,.2); color: var(--gold); border-color: var(--gold); }
.ball-pick.disabled { opacity: .3; cursor: not-allowed; }

.jogo-preview { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; min-height: 44px; }
.preview-label { font-size: .8rem; color: var(--text-muted); }

/* ---- CASAL ROW ---- */
.casal-row { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--blue-border); }
.casal-row:last-child { border-bottom: none; }
.casal-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue-mid); border: 2px solid var(--blue-border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; color: var(--gold);
}
.casal-info { flex: 1; }
.casal-info strong { font-size: .9rem; }
.casal-status { display: flex; gap: .4rem; }
.status-icon { font-size: 1rem; opacity: .3; }
.status-icon.ok { opacity: 1; }

/* ---- PROGRESS ---- */
.progress-casais { margin-top: 1rem; }
.progress-casais span { font-size: .82rem; color: var(--text-muted); display: block; margin-bottom: .35rem; }
.progress-bar { height: 6px; background: var(--blue-border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--gold); border-radius: 3px; transition: width .4s ease; }

/* ---- PAGAMENTO INFO ---- */
.pagamento-info { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.pagamento-valor .label { font-size: .75rem; color: var(--text-muted); display: block; }
.pagamento-valor strong { font-size: 1.4rem; color: var(--gold); font-family: 'Playfair Display', serif; }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; padding: .6rem .75rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); border-bottom: 1px solid var(--blue-border); }
.table td { padding: .65rem .75rem; border-bottom: 1px solid rgba(42,43,85,.5); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--blue-hover); }
.resultado-mini { display: flex; flex-wrap: wrap; gap: .25rem; }

/* ---- RESULTADO COMPARISON ---- */
.match { color: var(--gold); font-weight: 700; }

/* ---- TABS ---- */
.tabs { display: flex; gap: .25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--blue-border); padding-bottom: 0; }
.tab-btn {
  padding: .55rem 1.1rem; border: none; background: transparent;
  color: var(--text-muted); cursor: pointer; font-family: 'DM Sans', sans-serif;
  font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all .2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-content.hidden { display: none; }

/* ---- PAGE TITLE ---- */
.page-title { font-family: 'Playfair Display', serif; font-size: 1.6rem; margin-bottom: 1.25rem; color: var(--gold); }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h2 { font-family: 'Playfair Display', serif; margin-bottom: .5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ---- TEXT UTILS ---- */
.text-muted   { color: var(--text-muted); font-size: .88rem; }
.text-muted-sm { color: var(--text-muted); font-size: .8rem; margin-bottom: .75rem; }
.text-success { color: var(--green); font-size: .88rem; }

/* ---- LOGIN PAGE ---- */
.login-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 1rem; }
.login-card { background: var(--blue-card); border: 1px solid var(--blue-border); border-radius: var(--radius-lg); padding: 2.5rem 2rem; box-shadow: var(--shadow), 0 0 60px rgba(244,197,66,.08); }
.login-logo { text-align: center; margin-bottom: 2rem; }
.logo-icon { font-size: 2.5rem; color: var(--gold); margin-bottom: .5rem; animation: pulse-star 2s ease-in-out infinite; }
@keyframes pulse-star { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: .85; } }
.login-logo h1 { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--gold); }
.login-logo p  { color: var(--text-muted); font-size: .85rem; margin-top: .25rem; }
.login-form .btn { margin-top: .5rem; }
.login-footer { text-align: center; margin-top: 1.25rem; font-size: .78rem; color: var(--text-muted); }

/* ---- MODAL ---- */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }
.modal-box { position: relative; z-index: 1; background: var(--blue-card); border: 1px solid var(--blue-border); border-radius: var(--radius-lg); padding: 1.75rem; width: 100%; max-width: 600px; max-height: 80vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-header h3 { font-family: 'Playfair Display', serif; font-size: 1.15rem; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; padding: .25rem; }
.modal-close:hover { color: var(--text); }
.modal-body .casal-row { margin-bottom: .5rem; }
.historico-resultado { margin-top: 1rem; padding: 1rem; background: var(--blue-mid); border-radius: var(--radius); border: 1px solid rgba(244,197,66,.3); }
.historico-resultado h4 { color: var(--gold); margin-bottom: .5rem; font-size: .9rem; }
.comparacao-row { display: flex; align-items: flex-start; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--blue-border); }
.comparacao-row:last-child { border-bottom: none; }
.comparacao-nome { font-weight: 600; min-width: 100px; font-size: .88rem; }
.comparacao-nums { display: flex; flex-wrap: wrap; gap: .3rem; }

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 300;
  padding: .75rem 1.25rem; border-radius: var(--radius);
  background: var(--blue-card); border: 1px solid var(--blue-border);
  color: var(--text); font-size: .88rem; box-shadow: var(--shadow);
  animation: slide-in .3s ease;
}
.toast.hidden { display: none; }
.toast.toast-ok    { border-color: rgba(52,211,153,.5); color: var(--green); }
.toast.toast-error { border-color: rgba(248,113,113,.5); color: var(--red); }
@keyframes slide-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---- RESPONSIVE ---- */
@media (max-width: 500px) {
  .balls-grid { grid-template-columns: repeat(8, 1fr); }
  .navbar { padding: .6rem 1rem; }
  .container { padding: 1rem .75rem 2rem; }
  .week-header { flex-direction: column; gap: .5rem; }
}
