/* ===================================
   Circuito Ferradura — Estilos Principais
   Palotina, 1993 · Terra Vermelha · Ábaco Romano
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Share+Tech+Mono&display=swap');

:root {
    --verde-pista:     #1a7a3c;
    --verde-claro:     #2da858;
    --verde-escuro:    #125c2c;
    --terra-vermelha:  #b03a2e;
    --terra-claro:     #d45a4a;
    --amarelo-palotina:#f4c430;
    --cinza-console:   #1e1e1e;
    --cinza-claro:     #f0faf2;
    --bg-grad:         linear-gradient(135deg, #1a7a3c 0%, #2da858 60%, #f4c430 100%);

    --font-main: 'Nunito', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

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

body {
    font-family: var(--font-main);
    font-size: 18px;
    line-height: 1.8;
    color: #2c3e50;
    background-color: #f8f9fa;
}

/* ── Navbar ──────────────────────────────────────── */
.navbar {
    background-color: var(--verde-pista) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
    font-weight: 700;
}

.navbar-brand {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff !important;
}

.navbar-brand .tag-versao {
    background: var(--amarelo-palotina);
    color: #1a1a1a;
    font-size: .7rem;
    font-weight: 700;
    border-radius: .3rem;
    padding: .1rem .4rem;
    margin-left: .4rem;
    vertical-align: middle;
}

.nav-link { color: rgba(255,255,255,.9) !important; font-weight: 600; }
.nav-link:hover, .nav-link.active { color: var(--amarelo-palotina) !important; }
.dropdown-menu { border: none; box-shadow: 0 4px 20px rgba(0,0,0,.15); border-radius: .75rem; }
.dropdown-item:hover { background-color: var(--cinza-claro); color: var(--verde-pista); }
.dropdown-item.active { background-color: var(--verde-pista); }

/* ── Hero / Banner ───────────────────────────────── */
.hero-section {
    background: var(--bg-grad);
    padding: 0;
    position: relative;
}

.hero-image-container {
    position: relative;
    max-height: 520px;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: 520px;
    object-fit: cover;
    display: block;
    filter: brightness(.7);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to right, rgba(26,122,60,.5) 0%, transparent 100%);
}

.hero-title  { font-size: 3rem; font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.hero-subtitle { font-size: 1.3rem; opacity: .95; text-shadow: 0 1px 4px rgba(0,0,0,.3); }

/* ── Headings ────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-main);
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2c3e50;
}

h1 { font-size: 2.5rem; margin-bottom: 1.5rem; }

h2 {
    font-size: 2rem;
    color: var(--verde-pista);
    border-bottom: 3px solid var(--amarelo-palotina);
    padding-bottom: .5rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.6rem;
    color: var(--terra-vermelha);
    margin-top: 1.5rem;
}

p { margin-bottom: 1.2rem; text-align: justify; }
.lead { font-size: 1.3rem; font-weight: 400; color: #555; }

/* ── Cards ───────────────────────────────────────── */
.card {
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,.1);
    border: none;
    margin-bottom: 2rem;
    transition: transform .3s, box-shadow .3s;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,.15); }

.card-header {
    background: var(--bg-grad);
    color: white;
    font-weight: 700;
    font-size: 1.3rem;
    border-radius: 1rem 1rem 0 0 !important;
    padding: 1.2rem;
}

.card-body { padding: 1.5rem; font-size: 1.1rem; }

/* ── Badges ──────────────────────────────────────── */
.badge-fase {
    background-color: var(--verde-pista);
    color: white;
    font-size: .85rem;
    font-weight: 700;
    border-radius: 2rem;
    padding: .3rem .9rem;
    margin-right: .3rem;
}
.badge-duracao {
    background-color: var(--amarelo-palotina);
    color: #1a1a1a;
    font-size: .85rem;
    font-weight: 700;
    border-radius: 2rem;
    padding: .3rem .9rem;
    margin-right: .3rem;
}
.badge-nivel {
    background-color: var(--terra-vermelha);
    color: white;
    font-size: .85rem;
    font-weight: 700;
    border-radius: 2rem;
    padding: .3rem .9rem;
}

/* ── Circuito ferradura (mapa) ───────────────────── */
.circuit-container {
    position: relative;
    width: 100%;
    min-height: 700px;
    margin: 2rem auto;
}

.circuit-background-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    opacity: .12;
    pointer-events: none;
}

.circuit-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.circuit-path {
    stroke: var(--verde-pista);
    stroke-width: 3;
    opacity: .5;
}

.circuit-connector {
    stroke: var(--amarelo-palotina);
    stroke-width: 2;
}

/* Nodos das fases */
.circuit-node {
    position: absolute;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    text-decoration: none;
    color: #2c3e50;
    transition: transform .2s;
    width: 260px;
}
.circuit-node:hover { transform: scale(1.04); color: var(--verde-pista); }

.circuit-node[data-fase="1"] { top:   3%; left:  2%; }
.circuit-node[data-fase="2"] { top:  26%; left:  0%; }
.circuit-node[data-fase="3"] { top:  52%; left:  2%; }
.circuit-node[data-fase="4"] { top:  52%; right: 2%; left: auto; }
.circuit-node[data-fase="5"] { top:  26%; right: 2%; left: auto; }
.circuit-node[data-fase="6"] { top:   3%; right: 2%; left: auto; }

.node-circle {
    width: 3.5rem; height: 3.5rem;
    background: var(--verde-pista);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(26,122,60,.4);
    transition: background .2s;
}
.circuit-node:hover .node-circle { background: var(--terra-vermelha); }

.node-number { font-size: 1.1rem; font-weight: 900; }

.node-content h5 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 .2rem;
    color: var(--verde-pista);
}
.circuit-node:hover .node-content h5 { color: var(--terra-vermelha); }

.node-description {
    font-size: .85rem;
    color: #666;
    margin: .3rem 0 0;
    line-height: 1.4;
}

/* ── Imagem de fase ──────────────────────────────── */
.img-fase {
    width: 100%;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    margin: 1.5rem 0 2rem;
    max-height: 400px;
    object-fit: cover;
}

/* ── content-section ─────────────────────────────── */
.content-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

/* ── Console block ───────────────────────────────── */
.console-block {
    background-color: var(--cinza-console);
    color: #c8f0a0;
    font-family: var(--font-mono);
    font-size: .9rem;
    border-radius: .75rem;
    padding: 1.5rem;
    line-height: 1.7;
    box-shadow: 0 4px 20px rgba(0,0,0,.35);
    overflow-x: auto;
    margin: 1.5rem 0;
}
.console-block .prompt { color: #5af78e; }
.console-block .borda  { color: #f4c430; }
.console-block .enter  { color: #75bfff; font-style: italic; }
.console-block .result { color: #ff8c42; }
.console-block .comment{ color: #888; }

/* ── Alertas customizados ────────────────────────── */
.alert-ferradura {
    background: linear-gradient(135deg, #e8f5e9, #f9fbe7);
    border-left: 5px solid var(--verde-pista);
    border-radius: .75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.alert-ferradura h4 { color: var(--verde-pista); margin-bottom: .75rem; }

.alert-palotina {
    background: linear-gradient(135deg, #fff8e1, #fffde7);
    border-left: 5px solid var(--amarelo-palotina);
    border-radius: .75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.alert-palotina h4 { color: #8a6d00; margin-bottom: .75rem; }

.alert-terra {
    background: linear-gradient(135deg, #fce4ec, #fff3e0);
    border-left: 5px solid var(--terra-vermelha);
    border-radius: .75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.alert-terra h4 { color: var(--terra-vermelha); margin-bottom: .75rem; }

/* ── Checklist items ─────────────────────────────── */
.checklist-item {
    background: white;
    border-radius: .6rem;
    padding: .8rem 1rem;
    margin-bottom: .6rem;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    transition: background .2s;
}
.checklist-item:hover { background: var(--cinza-claro); }
.checklist-item input[type="checkbox"] {
    width: 1.1rem; height: 1.1rem;
    accent-color: var(--verde-pista);
    margin-top: .25rem;
    flex-shrink: 0;
}
.checklist-item label { cursor: pointer; margin: 0; }
.checklist-item input:checked + label { text-decoration: line-through; color: #888; }

/* ── Progresso ───────────────────────────────────── */
#progress-indicator {
    background: var(--cinza-claro);
    border: 1px solid var(--verde-claro);
    border-radius: .75rem;
    color: var(--verde-pista);
    font-weight: 700;
    padding: .75rem 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ── Botões ──────────────────────────────────────── */
.btn-ferradura {
    background-color: var(--verde-pista);
    border-color: var(--verde-pista);
    color: white;
    font-weight: 700;
    border-radius: .6rem;
}
.btn-ferradura:hover {
    background-color: var(--verde-escuro);
    border-color: var(--verde-escuro);
    color: white;
}
.btn-palotina {
    background-color: var(--amarelo-palotina);
    border-color: var(--amarelo-palotina);
    color: #1a1a1a;
    font-weight: 700;
    border-radius: .6rem;
}
.btn-palotina:hover { filter: brightness(.9); color: #1a1a1a; }

/* ── Certificado ─────────────────────────────────── */
.certificado-container {
    background: white;
    border: 6px double var(--verde-pista);
    border-radius: 1.5rem;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 8px 40px rgba(26,122,60,.15);
    position: relative;
    overflow: hidden;
}
.certificado-container::before {
    content: '🏁';
    position: absolute;
    top: 1.5rem; left: 1.5rem;
    font-size: 2rem; opacity: .3;
}
.certificado-container::after {
    content: '🏁';
    position: absolute;
    bottom: 1.5rem; right: 1.5rem;
    font-size: 2rem; opacity: .3;
}
.certificado-titulo {
    color: var(--verde-pista);
    font-size: 2.5rem;
    font-weight: 900;
    border-bottom: 3px solid var(--amarelo-palotina);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
.certificado-aluno {
    font-size: 2rem;
    font-weight: 800;
    color: var(--terra-vermelha);
    margin: 1rem 0;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: .5rem;
}
.certificado-codigo {
    font-family: var(--font-mono);
    background: var(--cinza-claro);
    border: 1px solid var(--verde-claro);
    border-radius: .5rem;
    padding: .5rem 1rem;
    font-size: .95rem;
    color: var(--verde-pista);
    display: inline-block;
    margin-top: .5rem;
}

/* ── Flashcards ──────────────────────────────────── */
.flashcard-container { perspective: 1000px; }
.flashcard {
    background: transparent;
    cursor: pointer;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform .5s;
    border: none;
    margin-bottom: 0;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
    backface-visibility: hidden;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: absolute;
    width: 100%; height: 100%;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
}
.flashcard-front {
    background: var(--bg-grad);
    color: white;
}
.flashcard-back {
    background: white;
    color: var(--verde-pista);
    border: 2px solid var(--verde-claro);
    transform: rotateY(180deg);
}

/* ── LGPD Banner ─────────────────────────────────── */
.lgpd-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--cinza-console);
    color: #ccc;
    padding: 1rem 0;
    z-index: 9999;
    border-top: 3px solid var(--verde-pista);
}

/* ── List groups ─────────────────────────────────── */
.list-group-item {
    border-radius: .6rem !important;
    margin-bottom: .4rem;
    border: 1px solid #e0e0e0;
    font-size: 1.05rem;
}
.list-group-item:before {
    content: '🏎 ';
    margin-right: .3rem;
}

/* ── Footer ──────────────────────────────────────── */
footer {
    background-color: var(--cinza-console);
    color: #aaa;
    padding: 2rem 0;
    margin-top: 3rem;
    font-size: .95rem;
}
footer a { color: var(--verde-claro); }
footer a:hover { color: var(--amarelo-palotina); }

/* ── Navegação entre fases ───────────────────────── */
.nav-fases {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding: 1rem;
    background: white;
    border-radius: .75rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.nav-fases a { font-weight: 700; }

/* ── Responsivo ──────────────────────────────────── */
@media (max-width: 768px) {
    .hero-title  { font-size: 2rem; }
    .hero-image  { height: 300px; }
    .circuit-node { width: 200px; }
    .circuit-container { min-height: 500px; }
    .circuit-node { font-size: .85rem; }
    .certificado-titulo { font-size: 1.8rem; }
    .certificado-aluno  { font-size: 1.4rem; }
}
