/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #0d0d14;
    --bg-card:   #13131f;
    --bg-input:  #1a1a2a;
    --border:    #2a2a3d;
    --gold:      #C8973A;
    --gold-dim:  #a07828;
    --text:      #f0ede8;
    --text-muted:#9a9499;
    --danger:    #c0392b;
    --success:   #27ae60;
    --radius:    8px;
    --shadow:    0 2px 16px rgba(0,0,0,.45);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.65;
    min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
    font-family: Georgia, serif;
    font-weight: normal;
    line-height: 1.25;
}
h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
h2 { font-size: clamp(1.2rem, 3vw, 1.6rem); }
h3 { font-size: 1.1rem; }

.gold { color: var(--gold); }
.muted { color: var(--text-muted); font-size: .9rem; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; padding: 2rem 0 4rem; }

/* ── Header / Nav ────────────────────────────────────────────────────────── */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: .9rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    font-size: 1.1rem;
    letter-spacing: .03em;
    color: var(--gold);
    font-style: italic;
}

.logo span { color: var(--text); font-style: normal; }

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .875rem;
}

.nav-user .nome { color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: .65rem 1.4rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-family: Georgia, serif;
    font-size: .95rem;
    transition: opacity .15s, transform .1s;
    text-align: center;
    line-height: 1.4;
}

.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--gold);
    color: #0d0d14;
    font-weight: bold;
}

.btn-secondary {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

.btn-sm { padding: .4rem .9rem; font-size: .85rem; }
.btn-lg { padding: .85rem 2rem; font-size: 1.05rem; }
.btn-full { display: block; width: 100%; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card + .card { margin-top: 1rem; }

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
}

.card-title { font-size: 1.05rem; color: var(--text); }
.card-sub   { color: var(--text-muted); font-size: .875rem; }

/* ── Mentorado Cards (grid) ──────────────────────────────────────────────── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.mentorado-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color .2s, box-shadow .2s;
    display: block;
    color: var(--text);
}

.mentorado-card:hover {
    border-color: var(--gold-dim);
    box-shadow: 0 4px 20px rgba(200,151,58,.12);
    text-decoration: none;
}

.mentorado-card .nome { font-size: 1.05rem; margin-bottom: .25rem; }

.badge {
    display: inline-block;
    font-size: .75rem;
    padding: .2rem .6rem;
    border-radius: 100px;
    background: rgba(200,151,58,.15);
    color: var(--gold);
    margin-bottom: .75rem;
}

/* ── Progress Bar ────────────────────────────────────────────────────────── */
.progress-wrap {
    margin: .5rem 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: .3rem;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 100px;
    transition: width .4s ease;
}

.progress-fill.completo { background: var(--success); }

/* ── Block Status Pills ──────────────────────────────────────────────────── */
.status-pill {
    display: inline-block;
    font-size: .75rem;
    padding: .15rem .55rem;
    border-radius: 100px;
    font-style: normal;
}

.status-concluido  { background: rgba(39,174,96,.18); color: #4ade80; }
.status-andamento  { background: rgba(200,151,58,.18); color: var(--gold); }
.status-pendente   { background: rgba(255,255,255,.07); color: var(--text-muted); }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

label {
    display: block;
    margin-bottom: .4rem;
    font-size: .9rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: Georgia, serif;
    font-size: .95rem;
    padding: .65rem .85rem;
    transition: border-color .2s;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--gold);
}

select option { background: var(--bg-input); }

textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 540px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
    padding: .8rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .9rem;
}

.alert-error   { background: rgba(192,57,43,.15); border: 1px solid rgba(192,57,43,.35); color: #e57368; }
.alert-success { background: rgba(39,174,96,.15);  border: 1px solid rgba(39,174,96,.35);  color: #4ade80; }
.alert-info    { background: rgba(200,151,58,.1);   border: 1px solid rgba(200,151,58,.3);  color: var(--gold); }

/* ── Divider ─────────────────────────────────────────────────────────────── */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* ── Login Page ──────────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo h1 { font-size: 1.8rem; color: var(--gold); font-style: italic; }
.login-logo p  { color: var(--text-muted); margin-top: .3rem; font-size: .9rem; }

.login-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.login-box h2 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--gold);
}

/* ── Pergunta Page ───────────────────────────────────────────────────────── */
.pergunta-header {
    margin-bottom: 1.75rem;
}

.pergunta-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .5rem;
    flex-wrap: wrap;
}

.pergunta-num {
    font-size: .85rem;
    color: var(--text-muted);
}

.pergunta-texto {
    font-size: 1.15rem;
    line-height: 1.55;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.pergunta-nav {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.25rem;
}

.nav-left  { display: flex; gap: .75rem; }
.nav-right { display: flex; gap: .75rem; }

.auto-save-status {
    font-size: .78rem;
    color: var(--text-muted);
    align-self: center;
}

/* ── Bloco List (mentorado dashboard) ────────────────────────────────────── */
.bloco-list { margin-top: 1.25rem; }

.bloco-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

.bloco-num {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
    color: var(--text-muted);
}

.bloco-num.done { background: rgba(39,174,96,.15); border-color: #27ae60; color: #4ade80; }
.bloco-num.active { background: rgba(200,151,58,.12); border-color: var(--gold); color: var(--gold); }

.bloco-info { flex: 1; min-width: 0; }
.bloco-titulo { font-size: .95rem; }
.bloco-action { flex-shrink: 0; }

/* ── Respostas (mentor view) ─────────────────────────────────────────────── */
.bloco-section { margin-bottom: 2.5rem; }

.bloco-section-title {
    font-size: 1rem;
    color: var(--gold);
    border-bottom: 1px solid var(--border);
    padding-bottom: .6rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.resposta-item {
    padding: .9rem 0;
    border-bottom: 1px solid rgba(42,42,61,.6);
}

.resposta-item:last-child { border-bottom: none; }

.resposta-pergunta {
    font-size: .875rem;
    color: var(--text-muted);
    margin-bottom: .4rem;
}

.resposta-texto {
    white-space: pre-wrap;
    font-size: .95rem;
    line-height: 1.65;
    color: var(--text);
}

.sem-resposta { color: var(--text-muted); font-style: italic; font-size: .875rem; }

/* ── Page Title bar ──────────────────────────────────────────────────────── */
.page-title-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

/* ── Relative full report CTA ────────────────────────────────────────────── */
.relatorio-cta {
    background: rgba(200,151,58,.08);
    border: 1px solid rgba(200,151,58,.3);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── Misc utils ──────────────────────────────────────────────────────────── */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.flex { display: flex; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }

/* ── Responsive tweaks ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .btn-lg { padding: .75rem 1.5rem; }
    main { padding: 1.25rem 0 3rem; }
    .card { padding: 1rem; }
    .login-box { padding: 1.5rem; }
    .pergunta-nav { flex-direction: column; align-items: stretch; }
    .nav-left, .nav-right { justify-content: center; }
    .relatorio-cta { flex-direction: column; }
}
