/**
 * martec-ui.css — Design system base MARTEC Cursos
 * Cor primária alinhada ao login (#005d5d).
 *
 * Uso:
 *   <link rel="stylesheet" href="/martec-ui.css?v=1">
 *   (ou /styles/martec-ui.css conforme a pasta de assets)
 *
 * Não substitui os temas por usuário (tema_*.css); eles podem
 * sobrescrever só as variáveis --mtc-* se quiserem.
 */

:root {
  /* Marca */
  --mtc-primary: #005d5d;
  --mtc-primary-hover: #004a4a;
  --mtc-primary-soft: rgba(0, 93, 93, 0.08);
  --mtc-primary-border: rgba(0, 93, 93, 0.18);

  /* Neutros */
  --mtc-bg: #f4f7f6;
  --mtc-surface: #ffffff;
  --mtc-text: #2d3748;
  --mtc-text-muted: #64748b;
  --mtc-border: #e2e8f0;
  --mtc-danger: #b91c1c;
  --mtc-danger-bg: #fff5f5;
  --mtc-success: #047857;
  --mtc-success-bg: #ecfdf5;
  --mtc-warn: #b45309;
  --mtc-warn-bg: #fff7ed;

  /* Forma */
  --mtc-radius: 12px;
  --mtc-radius-lg: 16px;
  --mtc-radius-xl: 22px;
  --mtc-shadow: 0 8px 30px rgba(0, 60, 60, 0.08);
  --mtc-shadow-sm: 0 2px 8px rgba(0, 40, 40, 0.06);
  --mtc-font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  --mtc-control-h: 48px;
  --mtc-control-h-lg: 54px;
}

/* Reset leve só em escopo MARTEC */
.mtc-page,
.mtc-card,
.mtc-btn,
.mtc-input,
.mtc-table {
  box-sizing: border-box;
}

.mtc-page {
  font-family: var(--mtc-font);
  background: linear-gradient(135deg, #f4f7f6 0%, #e2e8e7 100%);
  color: var(--mtc-text);
  min-height: 100vh;
  margin: 0;
  padding: 24px 16px;
}

.mtc-wrap {
  width: 100%;
  max-width: 99%;
  margin: 0 auto;
}

.mtc-wrap--narrow {
  max-width: 420px;
}

/* Card */
.mtc-card {
  background: var(--mtc-surface);
  border-radius: var(--mtc-radius-xl);
  box-shadow: var(--mtc-shadow);
  padding: 28px 24px;
}

.mtc-card--flat {
  box-shadow: var(--mtc-shadow-sm);
  border: 1px solid var(--mtc-border);
  border-radius: var(--mtc-radius-lg);
}

.mtc-card h1,
.mtc-card h2 {
  margin: 0 0 8px;
  color: var(--mtc-primary-hover);
  letter-spacing: -0.02em;
}

.mtc-card h1 { font-size: 1.375rem; font-weight: 700; }
.mtc-card h2 { font-size: 1.125rem; font-weight: 700; }

.mtc-muted {
  color: var(--mtc-text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Badge */
.mtc-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  background: var(--mtc-success-bg);
  color: var(--mtc-success);
}

.mtc-badge--warn {
  background: var(--mtc-warn-bg);
  color: var(--mtc-warn);
}

.mtc-badge--danger {
  background: var(--mtc-danger-bg);
  color: var(--mtc-danger);
}

/* Inputs */
.mtc-label {
  display: block;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}

.mtc-input {
  width: 100%;
  height: var(--mtc-control-h-lg);
  padding: 0 18px;
  border: 1.5px solid var(--mtc-border);
  border-radius: var(--mtc-radius);
  background: #fff;
  font-size: 16px;
  color: var(--mtc-text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mtc-input:focus {
  border-color: var(--mtc-primary);
  box-shadow: 0 0 0 4px var(--mtc-primary-soft);
}

.mtc-input::placeholder {
  color: #a0aec0;
}

.mtc-input--center {
  text-align: center;
}

/* Botões */
.mtc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--mtc-control-h);
  padding: 0 20px;
  border: none;
  border-radius: var(--mtc-radius);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(0, 93, 93, 0.15);
}

.mtc-btn:active {
  transform: scale(0.98);
}

.mtc-btn--primary {
  background: var(--mtc-primary);
  color: #fff;
}

.mtc-btn--primary:hover {
  background: var(--mtc-primary-hover);
}

.mtc-btn--secondary {
  background: #eef1f1;
  color: #334155;
  box-shadow: none;
}

.mtc-btn--secondary:hover {
  background: #e2e8f0;
}

.mtc-btn--danger {
  background: var(--mtc-danger);
  color: #fff;
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.15);
}

.mtc-btn--block {
  width: 100%;
}

.mtc-btn--lg {
  min-height: var(--mtc-control-h-lg);
  font-size: 16px;
  letter-spacing: 1px;
}

.mtc-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Alertas */
.mtc-alert {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  margin: 12px 0;
}

.mtc-alert--error {
  background: var(--mtc-danger-bg);
  border: 1px solid #feb2b2;
  color: var(--mtc-danger);
}

.mtc-alert--success {
  background: var(--mtc-success-bg);
  border: 1px solid #86efac;
  color: var(--mtc-success);
}

.mtc-alert--warn {
  background: var(--mtc-warn-bg);
  border: 1px solid #fed7aa;
  color: #9a3412;
}

/* Tabela */
.mtc-table-wrap {
  overflow-x: auto;
  border-radius: var(--mtc-radius);
  border: 1px solid var(--mtc-border);
}

.mtc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
}

.mtc-table th,
.mtc-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--mtc-border);
}

.mtc-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mtc-table tr:last-child td {
  border-bottom: none;
}

.mtc-table tr:hover td {
  background: #f8fafa;
}

/* Topbar simples (AVA / páginas internas) */
.mtc-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--mtc-surface);
  border-bottom: 1px solid var(--mtc-border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.mtc-topbar__brand {
  font-weight: 700;
  color: var(--mtc-primary);
  text-decoration: none;
  font-size: 15px;
}

.mtc-topbar__spacer {
  flex: 1;
}

/* Utilitários */
.mtc-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mtc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.mtc-icon-circle {
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #e6f2f2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 93, 93, 0.1);
  overflow: hidden;
}

.mtc-icon-circle img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

@media (max-width: 560px) {
  .mtc-card {
    padding: 22px 16px;
    border-radius: 16px;
  }
  .mtc-btn {
    width: 100%;
  }
}
