/* ============================================================
   Portal DSC — folha de estilos global
   Tema: dark, consistente com dsc.rodrigor.com/landing
   ============================================================ */

:root {
  --bg:       #0b1020;
  --bg-alt:   #111733;
  --fg:       #e6eaf2;
  --muted:    #8a93a8;
  --accent:   #7c9cff;
  --accent-2: #5eead4;
  --border:   rgba(255,255,255,.08);
  --card:     rgba(255,255,255,.04);
  --success:  #5eead4;
  --error:    #f87171;
  --info:     #93c5fd;
}

*, *::before, *::after { box-sizing: border-box }

html, body {
  margin: 0; padding: 0;
  background: radial-gradient(1200px 700px at 80% -10%, rgba(124,156,255,.14), transparent 60%),
              radial-gradient(900px 600px at -10% 110%, rgba(94,234,212,.10), transparent 60%),
              var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  border-bottom: 1px solid var(--border);
  background: rgba(11,16,32,.8);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 10;
}

.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--fg);
}
.brand strong { display: block; font-size: 15px }
.brand small  { display: block; font-size: 11px; color: var(--muted) }

.logo {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  color: #0b1020; font-weight: 800; font-size: 15px;
  box-shadow: 0 6px 20px rgba(124,156,255,.35);
}

.nav-right { display: flex; align-items: center; gap: 12px }
.nav-user  { font-size: 14px; color: var(--muted) }

/* ── Layout ─────────────────────────────────────────────── */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.page-header { margin-bottom: 32px }
.page-header h2 { margin: 0 0 4px; font-size: 26px }
.page-header .muted { margin: 0; color: var(--muted) }

.section { margin-top: 40px }
.section h3 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .8px;
  color: #aab4cf; margin: 0 0 16px;
}

/* ── Chips ───────────────────────────────────────────────── */
.chip {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; color: #cdd5ec;
}
.chip-admin {
  background: rgba(124,156,255,.15);
  border-color: rgba(124,156,255,.4);
  color: var(--accent);
}

/* ── Botões ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #0b1020; font-weight: 700;
  padding: 11px 24px; border-radius: 8px;
  border: none; cursor: pointer;
  font-size: 15px; text-decoration: none;
  transition: opacity .15s;
}
.btn-primary:hover { opacity: .88 }

.btn-secondary {
  display: inline-block;
  background: var(--card); border: 1px solid var(--border);
  color: var(--fg); font-weight: 600;
  padding: 9px 20px; border-radius: 8px;
  cursor: pointer; font-size: 14px; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn-secondary:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18) }

.btn-ghost {
  display: inline-block;
  color: var(--muted); text-decoration: none; font-size: 14px;
  padding: 6px 12px; border-radius: 6px;
  transition: color .15s, background .15s;
}
.btn-ghost:hover { color: var(--fg); background: rgba(255,255,255,.06) }

/* ── Alertas ────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: 10px;
  font-size: 14px; margin-bottom: 20px;
  border: 1px solid;
}
.alert-error   { background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.3); color: #fca5a5 }
.alert-success { background: rgba(94,234,212,.1);  border-color: rgba(94,234,212,.3);  color: #5eead4 }
.alert-info    { background: rgba(147,197,253,.1); border-color: rgba(147,197,253,.3); color: #93c5fd }

/* ── Auth card ─────────────────────────────────────────── */
.auth-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 36px;
  width: 100%; max-width: 440px;
}
.auth-header { margin-bottom: 28px }
.auth-title  { font-size: 22px; margin: 0 0 8px }
.auth-sub    { color: var(--muted); font-size: 15px; margin: 0 0 24px }
.auth-note   { color: var(--muted); font-size: 13px; margin-top: 16px; text-align: center }

.auth-form   { display: flex; flex-direction: column; gap: 16px }
.auth-form .btn-primary { width: 100%; text-align: center }

.icon-check  { font-size: 48px; text-align: center; margin-bottom: 16px }

.field { display: flex; flex-direction: column; gap: 6px }
.field label { font-size: 13px; font-weight: 600; color: #aab4cf }
.field input {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 14px;
  color: var(--fg); font-size: 15px;
  outline: none; transition: border-color .15s;
}
.field input:focus { border-color: var(--accent) }
.field input::placeholder { color: var(--muted) }

/* ── Card grid (portal do aluno) ───────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; margin-bottom: 32px;
}

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.card-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted) }
.card-value { font-size: 24px; font-weight: 700; letter-spacing: -.3px }
.card-value.small { font-size: 13px; font-weight: 600; word-break: break-all }
.card-sub   { font-size: 12px; color: var(--muted); margin-bottom: 4px }
.card-btn   { margin-top: auto; text-align: center }

/* ── Code block ─────────────────────────────────────────── */
.code-block {
  background: rgba(0,0,0,.25); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 11.5px;
  line-height: 1.7; margin-top: 6px;
  overflow-x: auto;
}
.code-key { color: var(--accent-2) }
.code-block a { color: #8ad8ff; text-decoration: underline; text-underline-offset: 2px; }
.code-block a:hover { color: #fff; }
.code-block div { white-space: nowrap }
code {
  background: rgba(255,255,255,.07); padding: 2px 6px;
  border-radius: 5px; font-size: 13px;
  font-family: "SFMono-Regular", Consolas, monospace;
}

/* ── Links grid ─────────────────────────────────────────── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.link-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  text-decoration: none; color: inherit;
  transition: border-color .15s, background .15s;
}
.link-card:hover { border-color: rgba(124,156,255,.4); background: rgba(124,156,255,.06) }
.link-icon { font-size: 24px }
.link-card strong { display: block; font-size: 14px }
.link-card small  { color: var(--muted); font-size: 12px }

/* ── Steps ──────────────────────────────────────────────── */
.steps { display: flex; flex-direction: column; gap: 16px }
.step  { display: flex; gap: 16px; align-items: flex-start }
.step-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b1020; font-weight: 800; font-size: 13px;
  display: grid; place-items: center;
}
.step p { margin: 4px 0 0; color: var(--muted); font-size: 14px }

/* ── Admin: stats ───────────────────────────────────────── */
.stats-row {
  display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 24px;
  text-align: center; min-width: 100px;
}
.stat-num   { font-size: 32px; font-weight: 800; line-height: 1 }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px }

.actions-bar {
  display: flex; gap: 12px; align-items: center; margin-bottom: 20px;
}

/* ── Admin: tabela ─────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border); border-radius: 12px;
}
.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}
.data-table tr:last-child td { border-bottom: none }
.data-table tr:hover td { background: rgba(255,255,255,.025) }

.link-subtle { color: var(--accent); text-decoration: none; font-size: 13px }
.link-subtle:hover { text-decoration: underline }
.muted { color: var(--muted) }

/* ── Impersonation banner ────────────────────────────────── */
.impersonate-bar {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #0b1020; padding: 10px 24px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 600;
}

/* ── Team status grid (portal) ──────────────────────────── */
.teams-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px; margin-bottom: 12px;
}
.status-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--fg);
  transition: border-color .15s, background .15s;
  cursor: default;
}
.status-card.up { cursor: pointer }
.status-card.up:hover { border-color: rgba(94,234,212,.45); background: rgba(94,234,212,.06) }
.status-card--mine { border-color: rgba(124,156,255,.4); background: rgba(124,156,255,.06) }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: #475068;
}
.status-card.up .status-dot { background: #5eead4; box-shadow: 0 0 0 3px rgba(94,234,212,.2) }
.status-label { font-size: 13px; font-weight: 600 }
.status-you { font-size: 10px; color: var(--accent); margin-left: auto }
.legend { display: flex; gap: 18px; color: var(--muted); font-size: 13px; margin-top: 8px }
.legend span { display: inline-flex; align-items: center; gap: 8px }
.dot { width: 8px; height: 8px; border-radius: 50% }
.dot.up { background: #5eead4 }
.dot.down { background: #475068 }

/* ── Team picker (select-team) ──────────────────────────── */
.team-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.team-picker-card { cursor: pointer }
.team-picker-card input[type=radio] { display: none }
.team-picker-inner {
  background: var(--card); border: 2px solid var(--border);
  border-radius: 12px; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s, background .15s;
}
.team-picker-card:hover .team-picker-inner { border-color: rgba(124,156,255,.4); background: rgba(124,156,255,.06) }
.team-picker-card input:checked + .team-picker-inner {
  border-color: var(--accent);
  background: rgba(124,156,255,.12);
  box-shadow: 0 0 0 3px rgba(124,156,255,.2);
}
.team-picker-id { font-size: 16px; font-weight: 700; letter-spacing: .3px }
.team-picker-members { font-size: 11px; color: var(--muted) }

/* ── Admin teams grid ───────────────────────────────────── */
.teams-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.team-admin-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.team-admin-header { display: flex; align-items: center; justify-content: space-between }
.team-admin-id { font-size: 16px; font-weight: 700 }
.btn-view-as {
  font-size: 11px; color: var(--muted); text-decoration: none;
  padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border);
  transition: color .15s, border-color .15s;
}
.btn-view-as:hover { color: var(--accent); border-color: var(--accent) }
.team-admin-members { display: flex; flex-wrap: wrap; gap: 4px }
/* Card de status da própria aplicação */
.app-status { display: flex; align-items: center; gap: 10px; margin: 4px 0 2px; }
.app-status-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #6b7280; flex: 0 0 auto;
  transition: background .2s, box-shadow .2s;
}
#app-status-card.up   .app-status-dot { background: #5eead4; box-shadow: 0 0 0 4px rgba(94,234,212,.18); }
#app-status-card.down .app-status-dot { background: #f87171; box-shadow: 0 0 0 4px rgba(248,113,113,.15); }
#app-status-card.up   { border-color: rgba(94,234,212,.35); }
#app-status-card.down { border-color: rgba(248,113,113,.30); }

.member-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; background: rgba(255,255,255,.06);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 4px 2px 8px; color: #cdd5ec; margin: 0;
}
.member-remove {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; padding: 0; line-height: 1;
  border: none; border-radius: 50%; cursor: pointer;
  background: rgba(255,80,80,.15); color: #ff8585; font-size: 10px;
  transition: background .15s, color .15s;
}
.member-remove:hover { background: #e5484d; color: #fff; }
.team-admin-empty { font-size: 12px }
.team-admin-url { font-size: 11px; text-decoration: none; margin-top: auto }
.team-admin-url:hover { color: var(--accent) }

/* Tutorial de deploy */
.tutorial { display: flex; flex-direction: column; gap: 32px }
.tutorial-step { display: flex; flex-direction: column; gap: 12px }
.tutorial-step-header { display: flex; gap: 16px; align-items: flex-start }
.tutorial-step-header .step-num { flex-shrink: 0; margin-top: 2px }
.tutorial-step-header > div { flex: 1 }
.tutorial-step-header p { margin: 4px 0 0; color: var(--muted); font-size: 14px }
.tutorial-code {
  background: rgba(0,0,0,.35); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 18px;
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px;
  line-height: 1.65; margin: 0; color: #e2e8f0;
  overflow-x: auto; white-space: pre;
}
.tutorial-info {
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 18px; font-size: 13px;
}

.page-footer {
  margin: 40px 0 24px; padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center; font-size: 12px;
}
.page-footer code {
  background: rgba(255,255,255,.06); padding: 1px 6px; border-radius: 4px;
}

/* Editor de .env (self-service) */
.env-editor {
  width: 100%; min-height: 340px; resize: vertical;
  background: #0b1020; color: #e6ebff;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; box-sizing: border-box;
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; line-height: 1.6;
  white-space: pre; overflow: auto;
}
.env-editor:focus { outline: none; border-color: var(--accent); }
.env-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }

/* --- Descrição da equipe (card + banner) ------------------------------ */
.card--wide { grid-column: 1 / -1; }

.alert-warn {
  background: rgba(251,191,36,.1);
  border-color: rgba(251,191,36,.35);
  color: #fcd34d;
}
.descricao-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; text-decoration: none;
}
.descricao-banner:hover { border-color: rgba(251,191,36,.6); }

.descricao-form { margin-top: 12px; }
.descricao-form textarea {
  width: 100%; box-sizing: border-box; resize: vertical;
  min-height: 72px; padding: 10px 12px;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--fg, #e6eaf2); font: inherit; line-height: 1.5;
}
.descricao-form textarea:focus { outline: none; border-color: var(--accent); }
.descricao-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 10px;
}
.descricao-count { color: var(--muted, #8a93a8); font-size: 12px; font-variant-numeric: tabular-nums; }
