/* ================================================
   SportFlow - style.css
   ================================================ */

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

:root {
  --verde:        #00D084;
  --verde-escuro: #00A366;
  --preto:        #0A0A0A;
  --cinza-escuro: #111111;
  --cinza-card:   #1A1A1A;
  --cinza-borda:  #2A2A2A;
  --cinza-texto:  #888;
  --branco:       #F5F5F0;
  --vermelho:     #FF4A4A;
  --amarelo:      #FFD600;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--preto);
  color: var(--branco);
  min-height: 100vh;
}

/* ---- AUTH ---- */
#auth-screen {
  min-height: 100vh;
  display: flex;
}

.auth-left {
  flex: 1;
  background: var(--cinza-escuro);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 5rem;
  letter-spacing: 4px;
  color: var(--verde);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.brand-sub {
  font-size: 0.9rem;
  color: var(--cinza-texto);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.auth-deco {
  position: absolute;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14rem;
  color: rgba(0,208,132,0.04);
  bottom: -2rem;
  right: -1rem;
  pointer-events: none;
  line-height: 1;
}

.auth-right {
  width: 480px;
  background: var(--preto);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  border-left: 1px solid var(--cinza-borda);
}

.tab-row {
  display: flex;
  border: 1px solid var(--cinza-borda);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: none;
  color: var(--cinza-texto);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn.active { background: var(--verde); color: var(--preto); font-weight: 700; }

.form-title    { font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem; letter-spacing: 2px; margin-bottom: 0.3rem; }
.form-subtitle { font-size: 0.85rem; color: var(--cinza-texto); margin-bottom: 1.5rem; }

.field-group { margin-bottom: 1rem; }
.field-group label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--cinza-texto);
  margin-bottom: 0.4rem;
}
.field-group input {
  width: 100%;
  background: var(--cinza-card);
  border: 1px solid var(--cinza-borda);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  color: var(--branco);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.field-group input:focus { border-color: var(--verde); }

.role-selector { display: flex; gap: 0.75rem; margin-bottom: 1.25rem; }
.role-card {
  flex: 1;
  border: 1px solid var(--cinza-borda);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.role-card:hover      { border-color: var(--verde); }
.role-card.selected   { border-color: var(--verde); background: rgba(0,208,132,0.08); }
.role-icon  { font-size: 1.8rem; margin-bottom: 0.4rem; }
.role-label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.role-desc  { font-size: 0.72rem; color: var(--cinza-texto); margin-top: 0.2rem; }

.btn-primary {
  width: 100%;
  padding: 0.9rem;
  background: var(--verde);
  border: none;
  border-radius: 8px;
  color: var(--preto);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.25rem;
}
.btn-primary:hover    { background: var(--verde-escuro); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.msg-erro {
  background: rgba(255,74,74,0.1);
  border: 1px solid rgba(255,74,74,0.3);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  color: var(--vermelho);
  margin-bottom: 1rem;
  display: none;
}
.msg-ok {
  background: rgba(0,208,132,0.1);
  border: 1px solid rgba(0,208,132,0.3);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  color: var(--verde);
  margin-bottom: 1rem;
  display: none;
}

/* ---- TOPBAR ---- */
.topbar {
  background: var(--cinza-escuro);
  border-bottom: 1px solid var(--cinza-borda);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-brand { font-family: 'Bebas Neue', sans-serif; font-size: 1.8rem; letter-spacing: 3px; color: var(--verde); }
.topbar-user  { display: flex; align-items: center; gap: 1rem; }
.user-badge   {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--cinza-card); border: 1px solid var(--cinza-borda);
  border-radius: 50px; padding: 0.4rem 1rem 0.4rem 0.4rem;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--verde); color: var(--preto);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
}
#topbar-nome { font-size: 0.85rem; font-weight: 600; }
#topbar-role { font-size: 0.7rem; color: var(--cinza-texto); text-transform: uppercase; letter-spacing: 1px; }
.btn-sair {
  background: transparent; border: 1px solid var(--cinza-borda);
  border-radius: 8px; padding: 0.5rem 1rem;
  color: var(--cinza-texto); font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem; cursor: pointer; transition: all 0.2s;
}
.btn-sair:hover { border-color: var(--vermelho); color: var(--vermelho); }

/* ---- NAV ---- */
.nav-tabs { background: var(--cinza-escuro); border-bottom: 1px solid var(--cinza-borda); display: flex; padding: 0 2rem; }
.nav-tab {
  padding: 1rem 1.5rem; background: transparent;
  border: none; border-bottom: 2px solid transparent;
  color: var(--cinza-texto); font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.nav-tab:hover  { color: var(--branco); }
.nav-tab.active { color: var(--verde); border-bottom-color: var(--verde); }

.content { padding: 2rem; max-width: 1100px; margin: 0 auto; }
.page       { display: none; }
.page.active{ display: block; }

.section-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.8rem; letter-spacing: 2px; margin-bottom: 0.25rem; }
.section-sub   { font-size: 0.85rem; color: var(--cinza-texto); margin-bottom: 1.5rem; }

/* ---- STATS ---- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--cinza-card); border: 1px solid var(--cinza-borda); border-radius: 12px; padding: 1.25rem; }
.stat-label{ font-size: 0.75rem; color: var(--cinza-texto); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; }
.stat-value{ font-family: 'Bebas Neue', sans-serif; font-size: 2.5rem; color: var(--verde); line-height: 1; }
.stat-sub  { font-size: 0.75rem; color: var(--cinza-texto); margin-top: 0.25rem; }

/* ---- TREINOS ---- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1rem; }
.sport-card {
  background: var(--cinza-card); border: 1px solid var(--cinza-borda);
  border-radius: 12px; padding: 1.25rem; cursor: pointer; transition: all 0.2s;
}
.sport-card:hover   { border-color: var(--verde); transform: translateY(-2px); }
.sport-card.open    { border-color: var(--verde); background: rgba(0,208,132,0.04); }
.sport-header       { display: flex; align-items: center; gap: 0.75rem; }
.sport-emoji        { font-size: 2rem; }
.sport-name         { font-weight: 700; font-size: 1rem; }
.sport-count        { font-size: 0.75rem; color: var(--cinza-texto); }
.treino-list        { display: none; }
.sport-card.open .treino-list { display: block; margin-top: 1rem; border-top: 1px solid var(--cinza-borda); padding-top: 1rem; }
.treino-item        { background: var(--preto); border: 1px solid var(--cinza-borda); border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 0.5rem; }
.treino-item-name   { font-weight: 600; font-size: 0.9rem; }
.treino-item-desc   { font-size: 0.8rem; color: var(--cinza-texto); margin-top: 0.2rem; }
.treino-item-tag    {
  display: inline-block; background: rgba(0,208,132,0.15); color: var(--verde);
  border-radius: 4px; padding: 0.15rem 0.5rem; font-size: 0.7rem; font-weight: 700; margin-top: 0.4rem;
}

/* ---- FREQUÊNCIA ---- */
.freq-box { background: var(--cinza-card); border: 1px solid var(--cinza-borda); border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem; }
.freq-box-title { font-weight: 600; font-size: 1rem; margin-bottom: 1rem; }
.freq-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.freq-row select,
.freq-row input[type="date"] {
  background: var(--preto); border: 1px solid var(--cinza-borda);
  border-radius: 8px; padding: 0.6rem 1rem;
  color: var(--branco); font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem; outline: none; flex: 1; min-width: 150px;
}
.freq-row select option { background: var(--cinza-card); }
.btn-marcar {
  background: var(--verde); border: none; border-radius: 8px;
  padding: 0.6rem 1.5rem; color: var(--preto);
  font-family: 'DM Sans', sans-serif; font-weight: 700;
  font-size: 0.9rem; cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.btn-marcar:hover { background: var(--verde-escuro); }

/* ---- TABELA ---- */
.freq-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th {
  text-align: left; padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--cinza-borda);
  color: var(--cinza-texto); font-size: 0.75rem;
  letter-spacing: 1px; text-transform: uppercase; font-weight: 500;
}
td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--cinza-borda); }
tr:hover td { background: rgba(255,255,255,0.02); }
.badge-presente { background: rgba(0,208,132,0.15); color: var(--verde); border-radius: 4px; padding: 0.2rem 0.6rem; font-size: 0.75rem; font-weight: 700; }

/* ---- SPINNER ---- */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(0,0,0,0.2); border-top-color: var(--preto);
  border-radius: 50%; animation: spin 0.6s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
  .auth-left  { display: none; }
  .auth-right { width: 100%; }
  .cards-grid { grid-template-columns: 1fr; }
}

/* ========== EXTRAS V2 ========== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: var(--cinza-card);
  border: 1px solid var(--cinza-borda);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
}
.textarea-field {
  width: 100%;
  background: var(--cinza-card);
  border: 1px solid var(--cinza-borda);
  border-radius: 8px;
  padding: .8rem 1rem;
  color: var(--branco);
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color .2s;
}
.textarea-field:focus { border-color: var(--verde); }
.select-field {
  width: 100%;
  background: var(--cinza-card);
  border: 1px solid var(--cinza-borda);
  border-radius: 8px;
  padding: .8rem 1rem;
  color: var(--branco);
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  outline: none;
}
.select-field option { background: var(--cinza-card); }
.btn-cancelar {
  flex: 1;
  padding: .9rem;
  background: transparent;
  border: 1px solid var(--cinza-borda);
  border-radius: 8px;
  color: var(--cinza-texto);
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all .2s;
}
.btn-cancelar:hover { border-color: var(--vermelho); color: var(--vermelho); }
.ex-card {
  background: var(--preto);
  border: 1px solid var(--cinza-borda);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-bottom: .5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}
.ex-card-info { flex: 1; }
.ex-card-nome { font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.ex-card-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.ex-card-obs  { font-size: .78rem; color: var(--verde); margin-top: .3rem; }
.chat-msg-minha {
  max-width: 70%; align-self: flex-end;
  background: var(--verde); color: var(--preto);
  padding: .6rem 1rem;
  border-radius: 12px 12px 2px 12px;
  font-size: .9rem; line-height: 1.4;
  word-break: break-word;
}
.chat-msg-outro {
  max-width: 70%; align-self: flex-start;
  background: var(--cinza-escuro); color: var(--branco);
  padding: .6rem 1rem;
  border-radius: 12px 12px 12px 2px;
  font-size: .9rem; line-height: 1.4;
  word-break: break-word;
}
.chat-msg-hora {
  font-size: .65rem;
  color: var(--cinza-texto);
  margin-top: .2rem;
  text-align: right;
}
.contato-item {
  padding: .75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--cinza-borda);
  display: flex;
  align-items: center;
  gap: .75rem;
  transition: background .15s;
}
.contato-item:hover { background: rgba(255,255,255,.04); }
.contato-item.ativo { background: rgba(0,208,132,.08); border-left: 3px solid var(--verde); }
.contato-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--verde); color: var(--preto);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.conexao-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 0;
  border-bottom: 1px solid var(--cinza-borda);
}
.treino-recebido {
  background: var(--cinza-card);
  border: 1px solid var(--cinza-borda);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.treino-recebido-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}