/**
 * CFO (Curso de Formação de Oficiais) - Design System
 * Tema AMAN - D.I.M.
 */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;600&family=Roboto:wght@300;400;500;700&display=swap');

:root {
  --aman-verde: #659252;
  --aman-verde-escuro: #1b3b1a;
  --aman-verde-claro: #85c975;
  --aman-dourado: #a38c4b;
  --aman-dourado-claro: #c4a86b;
  --aman-vermelho: #8b2626;
  --aman-texto: #f0f4ef;
  --aman-texto-sec: #a4b39e;
  --aman-texto-dim: #7a8a74;
  --aman-bg: #0a0f0b;
  --aman-surface: rgba(22, 33, 23, 0.85);
  --aman-surface-2: rgba(18, 28, 20, 0.90);
  --aman-surface-3: rgba(30, 45, 32, 0.95);
  --aman-border: rgba(255, 255, 255, 0.08);
  --aman-border-dourado: rgba(163, 140, 75, 0.35);
  --aman-shadow: 0 8px 32px rgba(0, 0, 0, 0.70);
  --aman-shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.80);

  /* Compatibilidade com classes antigas --cs-* */
  --cs-bg: #0a0f0b;
  --cs-surface: rgba(22, 33, 23, 0.85);
  --cs-surface-2: rgba(18, 28, 20, 0.90);
  --cs-surface-3: rgba(30, 45, 32, 0.95);
  --cs-border: rgba(255, 255, 255, 0.08);
  --cs-border-hover: rgba(163, 140, 75, 0.45);
  --cs-gold: #a38c4b;
  --cs-gold-light: #c4a86b;
  --cs-gold-dark: #8a7340;
  --cs-gold-glow: rgba(163, 140, 75, 0.15);
  --cs-text: #f0f4ef;
  --cs-text-muted: #a4b39e;
  --cs-text-dim: #7a8a74;
  --cs-success: #85c975;
  --cs-danger: #ef4444;
  --cs-warning: #f59e0b;
  --cs-info: #3b82f6;
  --cs-font: 'Roboto', system-ui, sans-serif;
  --cs-radius-sm: 6px;
  --cs-radius: 10px;
  --cs-radius-lg: 16px;
  --cs-radius-xl: 24px;
  --cs-shadow: 0 8px 32px rgba(0, 0, 0, 0.70);
  --cs-shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.80);
  --cs-glow-gold: 0 0 24px rgba(163, 140, 75, 0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: var(--cs-font);
  font-size: 15px;
  color: var(--cs-text);
  background:
    linear-gradient(to bottom, rgba(10, 15, 11, 0.85), rgba(5, 10, 7, 0.98)),
    url('https://images.unsplash.com/photo-1516528387618-afa90b13e000?q=80&w=1920&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  line-height: 1.6;
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

h1, h2, h3, .cfo-hero-title, .cfo-page-title, .cfo-card-title, .cfo-section-title {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

img { display: block; max-width: 100%; }
a { color: var(--cs-gold); text-decoration: none; transition: all 0.3s ease; }
a:hover { color: var(--cs-gold-light); }

.cfo-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === NAVBAR === */
.cfo-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 28, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(163, 140, 75, 0.35);
  height: 75px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.50);
}
.cfo-navbar-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cfo-logo { font-size: 1.4rem; font-weight: 600; color: var(--cs-text); letter-spacing: 2px; font-family: 'Oswald', sans-serif; }
.cfo-logo span { color: var(--cs-gold); }
.cfo-nav-link {
  font-size: 1rem;
  color: var(--cs-text-muted);
  font-weight: 400;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
  padding: 10px 16px;
  border-radius: 6px;
  transition: all 0.3s ease;
}
.cfo-nav-link:hover, .cfo-nav-link.ativo {
  background: rgba(101, 146, 82, 0.20);
  color: #fff;
  border-bottom: 2px solid var(--cs-gold);
}

/* === CARDS === */
.cfo-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius);
  padding: 24px;
  box-shadow: var(--cs-shadow);
  transition: border-color 220ms, box-shadow 220ms, transform 220ms;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 3px solid var(--aman-verde);
}
.cfo-card:hover {
  border-color: var(--cs-border-hover);
  box-shadow: var(--cs-shadow-lg);
  transform: translateY(-2px);
}
.cfo-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--cs-gold);
  margin-bottom: 6px;
  font-family: 'Oswald', sans-serif;
}
.cfo-card-text {
  font-size: 14px;
  color: var(--cs-text-muted);
  line-height: 1.55;
}

/* === BUTTONS === */
.cfo-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--aman-verde);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--cs-radius-sm);
  border: 1px solid var(--aman-verde);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.cfo-btn-primary:hover {
  background: var(--aman-verde-claro);
  border-color: var(--aman-verde-claro);
  box-shadow: 0 4px 16px rgba(101, 146, 82, 0.35);
  transform: translateY(-1px);
  color: #fff;
}
.cfo-btn-primary:active { transform: translateY(0); }

.cfo-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  background: transparent;
  color: var(--cs-gold);
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--cs-radius-sm);
  border: 1.5px solid rgba(163, 140, 75, 0.40);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.cfo-btn-ghost:hover {
  border-color: var(--cs-gold);
  background: rgba(163, 140, 75, 0.10);
  transform: translateY(-1px);
  color: var(--cs-gold-light);
}
.cfo-btn-ghost:active { transform: translateY(0); }

.cfo-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  background: rgba(139, 38, 38, 0.30);
  color: #ff9999;
  font-weight: 700;
  font-size: 13px;
  border-radius: var(--cs-radius-sm);
  border: 1px solid rgba(139, 38, 38, 0.50);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.cfo-btn-danger:hover {
  background: var(--aman-vermelho);
  color: #fff;
  border-color: var(--aman-vermelho);
}

.cfo-btn-fluid { width: 100%; }
.cfo-btn-sm { padding: 8px 14px; font-size: 12px; height: auto; }
.cfo-btn-lg { padding: 16px 32px; font-size: 16px; }

/* === BADGES === */
.cfo-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cfo-badge-normal  { background: rgba(101, 146, 82, 0.15); color: var(--aman-verde-claro); border: 1px solid rgba(101, 146, 82, 0.30); }
.cfo-badge-privado { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.cfo-badge-locked  { background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.cfo-badge-success { background: rgba(133, 201, 117, 0.12); color: var(--cs-success); border: 1px solid rgba(133, 201, 117, 0.25); }

/* === INPUTS === */
.cfo-input {
  width: 100%;
  height: 48px;
  background: rgba(0, 0, 0, 0.40);
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius-sm);
  color: var(--cs-text);
  font: 500 14px/1 var(--cs-font);
  padding: 0 16px;
  outline: none;
  transition: border-color 180ms, box-shadow 180ms;
}
.cfo-input:focus { border-color: rgba(163, 140, 75, 0.60); box-shadow: 0 0 0 3px rgba(163, 140, 75, 0.10); }
.cfo-input::placeholder { color: var(--cs-text-dim); }

.cfo-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--cs-gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* === ALERTS === */
.cfo-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--cs-radius-sm);
  border: 1px solid;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}
.cfo-alert::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
}
.cfo-alert-success { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.22); color: var(--cs-text); }
.cfo-alert-success::before { background: var(--cs-success); }
.cfo-alert-error { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.22); color: var(--cs-text); }
.cfo-alert-error::before { background: var(--cs-danger); }
.cfo-alert-info { background: rgba(240,165,0,0.08); border-color: rgba(240,165,0,0.22); color: var(--cs-text); }
.cfo-alert-info::before { background: var(--cs-gold); }

/* === TABLES === */
.cfo-table-wrap {
  overflow-x: auto;
  border-radius: var(--cs-radius);
  border: 1px solid var(--cs-border);
  background: rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(10px);
}
.cfo-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  font-size: 14px;
}
.cfo-table thead {
  background: rgba(18, 28, 20, 0.90);
  border-bottom: 1px solid var(--cs-border);
}
.cfo-table th {
  padding: 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--cs-gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cfo-table td {
  padding: 16px;
  border-bottom: 1px solid var(--cs-border);
  color: var(--cs-text);
}
.cfo-table tr:last-child td { border-bottom: none; }
.cfo-table tr:hover td { background: rgba(101, 146, 82, 0.08); }

/* === PAGE STRUCTURES === */
.cfo-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.cfo-main {
  flex: 1;
  padding: 40px 0;
}

.cfo-hero {
  background: rgba(22, 33, 23, 0.45);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--cs-border);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--cs-radius-lg);
  padding: 40px;
  margin-bottom: 40px;
  box-shadow: var(--cs-shadow-lg);
  position: relative;
  overflow: hidden;
}
.cfo-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--cs-gold), transparent);
}
.cfo-hero-title {
  font-size: 3rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: 4px;
  line-height: 1;
  text-shadow: 0 4px 15px rgba(0,0,0,0.6);
}
.cfo-hero-title span { color: var(--cs-gold); }
.cfo-hero-subtitle {
  font-size: 1.05rem;
  color: var(--cs-text-muted);
  max-width: 600px;
  letter-spacing: 1px;
}

.cfo-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--cs-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

/* === FOOTER === */
.cfo-footer {
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(5, 10, 7, 0.6);
  backdrop-filter: blur(5px);
  border-top: 1px solid var(--cs-border);
  margin-top: 40px;
}
.cfo-footer-text {
  animation: mudarCorMilitar 6s infinite;
  font-family: 'Roboto Mono', monospace;
}
@keyframes mudarCorMilitar {
  0%   { color: #1b3b1a; }
  20%  { color: #6e4723; }
  40%  { color: #85c975; }
  60%  { color: #ffffff; }
  80%  { color: #9c9c9c; }
  100% { color: #1b3b1a; }
}

/* === GRIDS === */
.cfo-grid {
  display: grid;
  gap: 20px;
}
.cfo-grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.cfo-grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cfo-grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* === EXAM SPECIFIC === */
.cfo-exam-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.cfo-timer-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--cs-surface);
  border-bottom: 1px solid var(--cs-border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cfo-timer-progress {
  flex: 1;
  height: 6px;
  background: var(--cs-surface-2);
  border-radius: 3px;
  overflow: hidden;
}
.cfo-timer-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cs-gold), var(--cs-gold-light));
  transition: width 1s linear;
}
.cfo-timer-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--cs-gold);
  white-space: nowrap;
}

.cfo-question-card {
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}
.cfo-question-number {
  font-size: 13px;
  color: var(--cs-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.cfo-question-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--cs-text);
  margin-bottom: 24px;
  line-height: 1.5;
}
.cfo-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cfo-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--cs-surface-2);
  border: 2px solid var(--cs-border);
  border-radius: var(--cs-radius);
  cursor: pointer;
  transition: all 180ms ease;
}
.cfo-option:hover {
  border-color: var(--cs-border-hover);
  background: var(--cs-surface-3);
}
.cfo-option.selected {
  border-color: var(--cs-gold);
  background: rgba(240,165,0,0.08);
}
.cfo-option-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--cs-border);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.cfo-option.selected .cfo-option-radio {
  border-color: var(--cs-gold);
}
.cfo-option.selected .cfo-option-radio::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 10px; height: 10px;
  background: var(--cs-gold);
  border-radius: 50%;
}
.cfo-option-text {
  font-size: 15px;
  color: var(--cs-text);
}

.cfo-progress-indicator {
  text-align: center;
  font-size: 14px;
  color: var(--cs-text-muted);
  margin-bottom: 24px;
}

.cfo-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.cfo-modal {
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius-lg);
  padding: 32px;
  max-width: 450px;
  width: 100%;
  text-align: center;
}
.cfo-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--cs-text);
  margin-bottom: 12px;
}
.cfo-modal-text {
  font-size: 15px;
  color: var(--cs-text-muted);
  margin-bottom: 24px;
}
.cfo-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* === RESULT PAGE === */
.cfo-result-header {
  text-align: center;
  padding: 48px 24px;
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius-lg);
  margin-bottom: 32px;
}
.cfo-result-score {
  font-size: 64px;
  font-weight: 900;
  color: var(--cs-gold);
  margin-bottom: 8px;
}
.cfo-result-status {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 16px;
}
.cfo-result-status.aprovado { color: var(--cs-success); }
.cfo-result-status.reprovado { color: var(--cs-danger); }
.cfo-result-name {
  font-size: 18px;
  color: var(--cs-text-muted);
}

.cfo-result-question {
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius);
  padding: 20px;
  margin-bottom: 16px;
}
.cfo-result-question.correct { border-color: rgba(34,197,94,0.30); }
.cfo-result-question.incorrect { border-color: rgba(239,68,68,0.30); }
.cfo-result-question-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.cfo-result-question-icon {
  font-size: 20px;
}
.cfo-result-question-text {
  font-size: 15px;
  color: var(--cs-text);
  margin-bottom: 12px;
}
.cfo-result-answer {
  font-size: 14px;
  color: var(--cs-text-muted);
  margin-bottom: 8px;
}
.cfo-result-answer span {
  font-weight: 600;
  color: var(--cs-text);
}
.cfo-result-explanation {
  font-size: 13px;
  color: var(--cs-text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--cs-border);
}

/* === GESTÃO PANEL === */
.cfo-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.cfo-page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--cs-text);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.cfo-page-subtitle {
  font-size: 14px;
  color: var(--cs-text-muted);
}

.cfo-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.cfo-stat-card {
  background: var(--cs-surface);
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius);
  padding: 24px;
  text-align: center;
  transition: border-color 220ms, box-shadow 220ms;
}
.cfo-stat-card:hover {
  border-color: var(--cs-border-hover);
  box-shadow: var(--cs-shadow);
}
.cfo-stat-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--cs-gold);
  margin-bottom: 8px;
}
.cfo-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--cs-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cfo-section {
  margin-bottom: 32px;
}

.cfo-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.cfo-form-group {
  margin-bottom: 20px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .cfo-navbar { padding: 0 16px; height: 56px; }
  .cfo-navbar-inner { flex-wrap: wrap; }
  .cfo-main { padding: 32px 0; }
  .cfo-hero { padding: 28px; border-radius: var(--cs-radius); }
  .cfo-hero-title { font-size: 24px; }
  .cfo-container { padding: 0 16px; }
  .cfo-exam-container { padding: 0 16px; }
  .cfo-question-card { padding: 24px; }
  .cfo-question-text { font-size: 16px; }
  .cfo-option { padding: 14px 16px; }
  .cfo-result-score { font-size: 48px; }
  .cfo-page-header { flex-direction: column; align-items: flex-start; }
  .cfo-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cfo-form-grid { grid-template-columns: 1fr; }
}
