/* ============================================================
   COPASfit Academia — main stylesheet
   ============================================================ */

:root {
  --bg: #0b0d12;
  --bg-2: #11141b;
  --bg-3: #181c25;
  --card: #1a1f2b;
  --border: #232936;
  --text: #e8eaf0;
  --text-dim: #9aa3b2;
  --text-muted: #6b7280;
  --brand: #e63946;
  --brand-2: #f1a208;
  --accent: #2a9d8f;
  --good: #22c55e;
  --bad: #ef4444;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --radius: 14px;
  --maxw: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--text); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; }
input, select, textarea { font-family: inherit; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------------- Top Bar ---------------- */
.topbar {
  background: #07090d;
  color: var(--text-dim);
  font-size: .82rem;
  padding: 8px 0;
  border-bottom: 1px solid #14171f;
}
.topbar-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topbar a { color: var(--text-dim); }
.topbar a:hover { color: var(--text); }
.topbar-right { display: flex; gap: 16px; }

/* ---------------- Nav ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,13,18,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 24px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; letter-spacing: -.5px; font-size: 1.25rem;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, #b71d2b 100%);
  display: grid; place-items: center;
  color: white; font-size: 1.2rem; line-height: 1;
  box-shadow: 0 4px 14px rgba(230,57,70,.4);
}
.brand-text span { color: var(--brand); }

.menu { display: flex; gap: 6px; align-items: center; }
.menu a {
  padding: 8px 14px; border-radius: 8px;
  font-weight: 500; font-size: .92rem; color: var(--text-dim);
  transition: color .15s, background .15s;
}
.menu a:hover, .menu a.active { color: var(--text); background: var(--bg-3); }
.menu a.admin-link { color: var(--brand-2); }

.nav-cta { display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border: 0; border-radius: 10px;
  font-weight: 600; font-size: .92rem; cursor: pointer;
  transition: transform .1s, background .15s, border-color .15s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: #c92a36; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-3); border-color: #334; }
.btn-accent { background: var(--brand-2); color: #1a1a1a; }
.btn-accent:hover { filter: brightness(1.1); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: .85rem; }
.btn-danger { background: var(--bad); color: white; }
.btn-danger:hover { background: #d33; }

.menu-toggle { display: none; background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(230,57,70,.18), transparent 50%),
    radial-gradient(ellipse at 80% 60%, rgba(241,162,8,.12), transparent 50%),
    linear-gradient(180deg, #0a0c12 0%, #0e1119 100%);
  padding: 80px 0 100px;
  overflow: hidden;
}
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 60px; align-items: center; }
.hero-eyebrow { color: var(--brand-2); font-weight: 700; letter-spacing: 2px; font-size: .82rem; text-transform: uppercase; }
.hero-title { font-size: 3.4rem; font-weight: 900; line-height: 1.05; margin: 14px 0 22px; letter-spacing: -1.5px; }
.hero-title span { color: var(--brand); display: block; }
.hero-sub { color: var(--text-dim); font-size: 1.08rem; max-width: 520px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.hero-stat-num { font-size: 1.9rem; font-weight: 800; color: var(--brand-2); }
.hero-stat-label { color: var(--text-dim); font-size: .82rem; margin-top: 4px; }

.hero-card {
  position: relative;
  background: linear-gradient(135deg, #1a1f2b 0%, #11141b 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.hero-card-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.hero-card-sub { color: var(--text-dim); font-size: .88rem; margin-bottom: 22px; }
.hero-card .pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.3);
  padding: 4px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.metric-row { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-top: 16px; }
.metric-tile {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 14px;
}
.metric-tile .label { color: var(--text-dim); font-size: .76rem; letter-spacing: .3px; }
.metric-tile .value { font-size: 1.4rem; font-weight: 800; margin-top: 4px; }

/* ---------------- Sections ---------------- */
.section { padding: 80px 0; }
.section-eyebrow { color: var(--brand-2); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-size: .8rem; }
.section-title { font-size: 2.2rem; font-weight: 800; margin: 8px 0 12px; letter-spacing: -1px; }
.section-sub { color: var(--text-dim); max-width: 620px; margin-bottom: 40px; }
.section-alt { background: var(--bg-2); }

/* ---------------- Feature Grid ---------------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform .15s, border-color .15s;
}
.feature:hover { transform: translateY(-3px); border-color: #2a3146; }
.feature-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(230,57,70,.12); color: var(--brand);
  display: grid; place-items: center; margin-bottom: 14px;
  font-size: 1.2rem;
}
.feature h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature p { color: var(--text-dim); font-size: .92rem; }

/* ---------------- Plans ---------------- */
.plans-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.plan {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  display: flex; flex-direction: column; gap: 14px;
  position: relative;
}
.plan.highlight { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), 0 20px 40px rgba(230,57,70,.18); }
.plan.highlight::before {
  content: 'MAIS POPULAR';
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: white;
  padding: 4px 12px; border-radius: 999px;
  font-size: .68rem; font-weight: 800; letter-spacing: 1px;
}
.plan-name { font-size: 1rem; color: var(--text-dim); }
.plan-price { font-size: 2.2rem; font-weight: 800; letter-spacing: -1px; }
.plan-price small { font-size: .9rem; color: var(--text-dim); font-weight: 500; }
.plan-features { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.plan-features li { color: var(--text-dim); font-size: .9rem; display: flex; gap: 8px; }
.plan-features li::before { content: '✓'; color: var(--good); font-weight: 800; }

/* ---------------- Cards (generic) ---------------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.card-sub { color: var(--text-dim); font-size: .88rem; }

.cards-grid { display: grid; gap: 18px; }
.cards-grid.cols-2 { grid-template-columns: repeat(2,1fr); }
.cards-grid.cols-3 { grid-template-columns: repeat(3,1fr); }
.cards-grid.cols-4 { grid-template-columns: repeat(4,1fr); }

/* ---------------- Trainers ---------------- */
.trainer { text-align: center; padding: 28px 22px; }
.trainer-photo {
  width: 110px; height: 110px; border-radius: 50%;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  font-size: 2.4rem; font-weight: 800; color: white;
}
.trainer-name { font-size: 1.05rem; font-weight: 700; }
.trainer-spec { color: var(--brand-2); font-size: .85rem; margin: 4px 0 10px; font-weight: 600; }
.trainer-bio { color: var(--text-dim); font-size: .85rem; }
.trainer-cref { color: var(--text-muted); font-size: .76rem; margin-top: 10px; }

/* ---------------- Classes table ---------------- */
.schedule-table { width: 100%; border-collapse: collapse; }
.schedule-table th, .schedule-table td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--border); font-size: .9rem; }
.schedule-table th { color: var(--text-dim); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--bg-3); color: var(--text-dim); }
.tag.tag-easy { background: rgba(34,197,94,.15); color: #4ade80; }
.tag.tag-mid { background: rgba(241,162,8,.15); color: var(--brand-2); }
.tag.tag-hard { background: rgba(230,57,70,.15); color: var(--brand); }

/* ---------------- Testimonials ---------------- */
.testimonial { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.testimonial-stars { color: var(--brand-2); }
.testimonial-content { font-size: .98rem; line-height: 1.6; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; color: white; font-size: .9rem;
}

/* ---------------- Footer ---------------- */
.footer {
  background: #07090d;
  padding: 60px 0 30px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .9rem;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--border); }
.footer h4 { color: var(--text); font-size: .95rem; margin-bottom: 14px; }
.footer ul li { margin-bottom: 8px; }
.footer ul a:hover { color: var(--text); }
.footer-bottom { padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .82rem; }

/* ---------------- Forms ---------------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: .85rem; color: var(--text-dim); }
.input, .field input, .field select, .field textarea {
  width: 100%;
  max-width: 100%;
  background: var(--bg-3); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 11px 14px; font-size: .95rem;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field select {
  text-overflow: ellipsis;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(230,57,70,.15);
}
.field input:read-only { background: #0f1219; color: var(--text-dim); cursor: not-allowed; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.auth-page { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 60px 20px; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 36px; width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-dim); margin-bottom: 22px; font-size: .9rem; }
.auth-foot { text-align: center; color: var(--text-dim); font-size: .88rem; margin-top: 18px; }
.auth-foot a { color: var(--brand); }

/* ---------------- Alerts ---------------- */
.alert { padding: 12px 14px; border-radius: 10px; font-size: .9rem; }
.alert-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-ok { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: #86efac; }
.alert-info { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3); color: #93c5fd; }

/* ---------------- App layout (logged-in) ---------------- */
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 60px); }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--border); padding: 28px 16px; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.sidebar h5 { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.4px; padding: 0 12px; margin: 18px 0 8px; }
.sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px;
  color: var(--text-dim); font-size: .93rem;
  margin-bottom: 2px;
}
.sidebar a:hover, .sidebar a.active { background: var(--bg-3); color: var(--text); }
.sidebar a.admin-link { color: var(--brand-2); }
.app-content { padding: 36px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }
.page-title { font-size: 1.7rem; font-weight: 800; letter-spacing: -.5px; }
.page-sub { color: var(--text-dim); font-size: .95rem; }

/* ---------------- Stat tiles ---------------- */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-label { color: var(--text-dim); font-size: .82rem; }
.stat-value { font-size: 1.7rem; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; }
.stat-foot { color: var(--text-muted); font-size: .76rem; margin-top: 6px; }

/* ---------------- Tables (admin/wallet) ---------------- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: .9rem; }
.data-table th { color: var(--text-dim); text-align: left; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; background: var(--bg-3); }
.data-table tbody tr:hover { background: rgba(255,255,255,.02); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }

/* ---------------- Wallet ---------------- */
.wallet-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 22px; }
.wallet-balance { background: linear-gradient(135deg, #15192a 0%, #0e1119 100%); border: 1px solid #2a3146; border-radius: var(--radius); padding: 28px; }
.balance-label { color: var(--text-dim); font-size: .85rem; }
.balance-value { font-size: 2.5rem; font-weight: 800; margin: 6px 0 18px; letter-spacing: -1px; }

/* ---------------- Misc ---------------- */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }
.muted { color: var(--text-dim); }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.small { font-size: .82rem; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty-state h3 { color: var(--text); margin-bottom: 6px; }

.cta-band {
  background: linear-gradient(120deg, var(--brand) 0%, #8b1e29 100%);
  padding: 60px 0; text-align: center;
}
.cta-band h2 { font-size: 2rem; margin-bottom: 10px; }
.cta-band p { opacity: .9; margin-bottom: 22px; }

/* ---------------- Toast ---------------- */
.toast-wrap { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  background: var(--card); border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: 10px; padding: 12px 16px;
  box-shadow: var(--shadow); font-size: .9rem;
  min-width: 280px; max-width: 360px;
  animation: slideIn .25s ease-out;
}
.toast.ok { border-left-color: var(--good); }
.toast.err { border-left-color: var(--bad); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-title { font-size: 2.4rem; }
  .features, .plans-grid, .cards-grid.cols-3, .cards-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .wallet-grid { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; top: 0; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .menu { display: none; }
  .menu.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 14px; }
  .menu-toggle { display: inline-flex; }
}
@media (max-width: 600px) {
  .hero { padding: 60px 0; }
  .features, .plans-grid, .cards-grid.cols-3, .cards-grid.cols-4, .cards-grid.cols-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .field-row { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .section { padding: 60px 0; }
  .section-title { font-size: 1.6rem; }
}
