/* ================================================================
   Calculadora de Estudos — Design System
   Baseado no Checklist da Aprovação (mesma identidade visual)
   ================================================================ */

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

:root {
  --primary:    #1A2E5A;
  --accent:     #2D9CDB;
  --success:    #27AE60;
  --locked:     #BDBDBD;
  --bg:         #F7F8FA;
  --card:       #FFFFFF;
  --text:       #1C1C1E;
  --text-muted: #6B7280;
  --border:     #E5E7EB;
  --danger:     #EB5757;
  --cta-bg:     #EBF5FB;
  --step-done:  #F0FFF4;

  --radius:  12px;
  --shadow:  0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --transition: .18s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── TYPOGRAPHY ───────────────────────────────────────────────── */
h1 { font-size: 2rem;   font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.125rem; font-weight: 600; }
p  { margin-bottom: .75rem; }
p:last-child { margin-bottom: 0; }

/* ── LAYOUT ───────────────────────────────────────────────────── */
.container { width: 100%; max-width: 840px; margin: 0 auto; padding: 0 1rem; }
.container--narrow { max-width: 480px; }

/* ── HEADER ───────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: .875rem 1.25rem;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 900px; margin: 0 auto; gap: 1rem;
}
.site-header__logo {
  font-size: 1.05rem; font-weight: 700; color: var(--primary);
  text-decoration: none; display: flex; align-items: center; gap: .4rem; white-space: nowrap;
}
.site-header__right {
  display: flex; align-items: center; gap: 1rem;
  font-size: .9rem; color: var(--text-muted);
}
.site-header__greeting { font-weight: 500; }

/* ── BUTTONS ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.3rem; border-radius: 8px; font-size: .9375rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn--primary        { background: var(--primary); color: #fff; }
.btn--primary:hover  { background: #15264d; }
.btn--accent         { background: var(--accent); color: #fff; }
.btn--accent:hover   { background: #2489c5; }
.btn--success        { background: var(--success); color: #fff; }
.btn--success:hover  { background: #219652; }
.btn--ghost          { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn--ghost:hover    { background: var(--bg); color: var(--text); }
.btn--lg             { padding: .85rem 2rem; font-size: 1rem; border-radius: 10px; }
.btn--sm             { padding: .45rem .9rem; font-size: .85rem; }
.btn--full           { width: 100%; }

/* ── FORMS ────────────────────────────────────────────────────── */
.form-group   { margin-bottom: 1.1rem; }
.form-label   { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .35rem; color: var(--text); }
.form-control {
  width: 100%; padding: .65rem .9rem;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: .9375rem; color: var(--text); background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit; line-height: 1.5;
}
.form-control:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,156,219,.15);
}
.form-control::placeholder { color: #9CA3AF; }
.form-control:disabled     { background: var(--bg); opacity: .7; }
textarea.form-control      { resize: vertical; min-height: 90px; }
.form-hint  { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }
.form-error { font-size: .85rem; color: var(--danger); margin-top: .3rem; }

/* Radio cards (perguntas a–e) */
.radio-group { display: flex; flex-wrap: wrap; gap: .5rem .75rem; }
.radio-label {
  display: flex; align-items: flex-start; gap: .5rem;
  font-size: .9rem; cursor: pointer;
  padding: .5rem .875rem; border: 1.5px solid var(--border); border-radius: 8px;
  transition: border-color var(--transition), background var(--transition);
  user-select: none; line-height: 1.4;
}
.radio-label:hover                  { border-color: var(--accent); background: var(--cta-bg); }
.radio-label:has(input:checked)     { border-color: var(--accent); background: var(--cta-bg); }
.radio-label input:checked + span   { color: var(--accent); font-weight: 600; }
.radio-label input                  { accent-color: var(--accent); flex-shrink: 0; margin-top: 3px; }

/* Radio cards para lista de cargos */
.cargo-group  { display: flex; flex-direction: column; gap: .5rem; }
.cargo-label  {
  display: flex; align-items: center; gap: .75rem;
  padding: .875rem 1rem; border: 1.5px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: border-color var(--transition), background var(--transition);
  user-select: none;
}
.cargo-label:hover                  { border-color: var(--accent); background: var(--cta-bg); }
.cargo-label:has(input:checked)     { border-color: var(--accent); background: var(--cta-bg); }
.cargo-label input:checked + span   { font-weight: 700; color: var(--primary); }
.cargo-label__num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.cargo-label:has(input:checked) .cargo-label__num { background: var(--accent); }

/* ── CARD ─────────────────────────────────────────────────────── */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }

/* ── AUTH PAGES ───────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 2rem 1rem;
}
.auth-box {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-md);
  padding: 2rem; width: 100%; max-width: 440px;
}
.auth-box__logo       { text-align: center; margin-bottom: 1.5rem; }
.auth-box__logo-text  { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.auth-box h1          { font-size: 1.5rem; text-align: center; margin-bottom: .35rem; }
.auth-box__sub        { text-align: center; color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5rem; }
.auth-box__footer     { text-align: center; font-size: .875rem; margin-top: 1.25rem; color: var(--text-muted); }

/* ── ALERT ────────────────────────────────────────────────────── */
.alert              { padding: .75rem 1rem; border-radius: 8px; font-size: .9rem; margin-bottom: 1rem; border-left: 4px solid transparent; }
.alert--error       { background: #FEE2E2; border-color: var(--danger);  color: #991B1B; }
.alert--success     { background: #D1FAE5; border-color: var(--success); color: #065F46; }
.alert--info        { background: var(--cta-bg); border-color: var(--accent); color: #1e3a5f; }

/* ── PROGRESS BAR ─────────────────────────────────────────────── */
.progress-bar-wrap {
  position: sticky; top: 53px; z-index: 90;
  background: var(--card); border-bottom: 1px solid var(--border); padding: .75rem 1.25rem;
}
.progress-bar-inner { max-width: 900px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; }
.progress-bar-label { font-size: .85rem; color: var(--text-muted); white-space: nowrap; }
.progress-bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-bar-fill  { height: 100%; background: linear-gradient(90deg, var(--accent), var(--success)); border-radius: 99px; transition: width .4s ease; }

/* ── CHECKLIST LAYOUT ─────────────────────────────────────────── */
.checklist-layout {
  display: grid; grid-template-columns: 48px 1fr;
  gap: 0 1rem; max-width: 860px; margin: 1.5rem auto;
  padding: 0 1rem 3rem; align-items: start;
}

/* Progress vertical sidebar */
.steps-sidebar { display: flex; flex-direction: column; align-items: center; padding-top: 1.1rem; position: sticky; top: 110px; }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
  border: 2px solid var(--border); background: var(--card); color: var(--text-muted);
}
.step-dot--done   { background: var(--success); border-color: var(--success); color: #fff; }
.step-dot--active { background: var(--accent);  border-color: var(--accent);  color: #fff; }
.step-dot--locked { background: var(--bg);      border-color: var(--locked);  color: var(--locked); }
.step-connector   { width: 2px; height: 40px; background: var(--border); transition: background var(--transition); }
.step-connector--done { background: var(--success); }

/* ── STEP CARDS ───────────────────────────────────────────────── */
.steps-list   { display: flex; flex-direction: column; gap: .75rem; min-width: 0; overflow-x: hidden; }
.step-card    { background: var(--card); border-radius: var(--radius); min-width: 0; width: 100%; box-shadow: var(--shadow); border-left: 4px solid var(--border); overflow: hidden; transition: border-color var(--transition), box-shadow var(--transition); }
.step-card--done   { border-left-color: var(--success); background: var(--step-done); }
.step-card--active { border-left-color: var(--accent); box-shadow: var(--shadow-md); }
.step-card--locked { border-left-color: var(--locked); background: #FAFAFA; }

.step-card__header {
  display: flex; align-items: center; gap: .875rem;
  padding: 1rem 1.25rem; cursor: pointer; user-select: none;
  transition: background var(--transition);
}
.step-card--locked .step-card__header { cursor: not-allowed; }
.step-card__icon        { font-size: 1.2rem; flex-shrink: 0; width: 28px; text-align: center; }
.step-card__title-wrap  { flex: 1; min-width: 0; }
.step-card__step-label  { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .1rem; }
.step-card__title       { font-size: 1rem; font-weight: 700; color: var(--primary); line-height: 1.25; }
.step-card__status      { font-size: .8rem; color: var(--text-muted); text-align: right; flex-shrink: 0; }
.step-card--done   .step-card__status { color: var(--success); font-weight: 600; }
.step-card--locked .step-card__status { color: var(--locked); }
.step-card__chevron     { font-size: 1rem; color: var(--text-muted); transition: transform var(--transition); flex-shrink: 0; }
.step-card--active .step-card__chevron { transform: rotate(180deg); }

.step-card__body    { display: none; padding: 0 1.25rem 1.5rem; border-top: 1px solid var(--border); }
.step-card--active .step-card__body { display: block; }

.step-card__explain {
  background: var(--bg); border-radius: 8px; padding: .875rem 1rem;
  margin: 1rem 0; font-size: .9rem; color: var(--text-muted); border-left: 3px solid var(--accent);
}

.step-card__fields { margin-top: 1rem; }
.step-card__fields h4 {
  font-size: .85rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: .875rem;
}

.step-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem;
  padding-top: 1rem; border-top: 1px solid var(--border);
}

.save-indicator { font-size: .8rem; color: var(--success); opacity: 0; transition: opacity .3s; }
.save-indicator--visible { opacity: 1; }

/* ── CTA BOX ──────────────────────────────────────────────────── */
.cta-box {
  background: var(--cta-bg); border-left: 4px solid var(--accent); border-radius: 8px;
  padding: 1rem 1.25rem; margin-top: 1.25rem; display: flex; flex-direction: column; gap: .875rem;
}
.cta-box__text { font-size: .9rem; color: var(--text); line-height: 1.55; }
.cta-box__btn  { align-self: flex-start; white-space: normal; word-break: break-word; text-align: center; }

/* ── BADGE ────────────────────────────────────────────────────── */
.badge        { display: inline-block; padding: .25em .6em; border-radius: 99px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.badge--green { background: #D1FAE5; color: #065F46; }
.badge--blue  { background: var(--cta-bg); color: #1e3a5f; }
.badge--gray  { background: #F3F4F6; color: #6B7280; }

/* ── TOAST ────────────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast { padding: .7rem 1.1rem; border-radius: 8px; font-size: .875rem; font-weight: 500; color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.15); animation: toastIn .25s ease; pointer-events: auto; max-width: 300px; }
.toast--success { background: var(--success); }
.toast--error   { background: var(--danger); }
.toast--info    { background: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── RESULTADO ────────────────────────────────────────────────── */
/* Bloco principal da nota */
.nota-box {
  background: linear-gradient(135deg, var(--primary) 0%, #243d78 100%);
  color: #fff; border-radius: 16px; padding: 2.5rem 2rem; text-align: center; margin-bottom: 1.5rem;
}
.nota-box__label { font-size: .9rem; opacity: .8; margin-bottom: .5rem; }
.nota-box__dias  { font-size: 4rem; font-weight: 800; line-height: 1; margin-bottom: .25rem; }
.nota-box__dias span { font-size: 1.5rem; font-weight: 500; opacity: .8; }
.nota-box__subs  { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-top: 1rem; font-size: .9rem; opacity: .85; }
.nota-box__sub   { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.nota-box__sub strong { font-size: 1.1rem; font-weight: 700; }

/* Share link */
.share-wrap  { display: flex; justify-content: center; gap: .75rem; flex-wrap: wrap; margin: 1rem 0; }
.share-copied { font-size: .85rem; color: var(--success); opacity: 0; transition: opacity .3s; }
.share-copied.visible { opacity: 1; }

/* Avaliação */
.avaliacao-section { max-width: 860px; margin: 0 auto 2rem; padding: 0 1rem; }
.avaliacao-box     { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; text-align: center; }
.avaliacao-box--done { background: var(--step-done); }
.av-titulo  { font-weight: 700; font-size: 1rem; margin-bottom: .25rem; }
.av-sub     { color: var(--text-muted); font-size: .85rem; margin-bottom: 1rem; }
.av-notas   { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.av-btn     { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border); background: var(--card); font-weight: 700; font-size: .9rem; cursor: pointer; transition: all var(--transition); }
.av-btn:hover, .av-btn--ativo { border-color: var(--accent); background: var(--accent); color: #fff; }
.av-comentario  { margin-top: 1rem; }
.av-textarea    { width: 100%; border: 1.5px solid var(--border); border-radius: 8px; padding: .65rem .9rem; font-family: inherit; font-size: .9rem; resize: vertical; min-height: 70px; }
.av-enviar      { margin-top: .75rem; }
.av-obrigado    { font-size: 1.1rem; font-weight: 700; color: var(--success); margin-bottom: .25rem; }
.av-nota-salva  { font-size: .9rem; color: var(--text-muted); }

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  h1 { font-size: 1.6rem; }
  .checklist-layout { grid-template-columns: 1fr; padding: 0 .75rem 3rem; }
  .steps-sidebar    { display: none; }
  .step-card__footer { flex-direction: column; }
  .step-card__footer .btn { width: 100%; }
  .site-header__greeting { display: none; }
  .site-header { padding: .6rem 1rem; }
  .step-card__header { gap: .5rem; padding: .75rem .875rem; }
  .step-card__body   { padding: 0 .875rem 1.25rem; }
  .step-card__title  { font-size: .9rem; }
  .nota-box__dias    { font-size: 3rem; }
  .nota-box__subs    { gap: 1rem; }
  .radio-label { font-size: .85rem; }
}

@media (max-width: 400px) {
  .step-card__status { display: none; }
}

@media (max-width: 480px) {
  /* Permite quebra de linha em botões com texto longo no mobile */
  .btn { white-space: normal; text-align: center; line-height: 1.35; }
}

/* ── LANDING PAGE ─────────────────────────────────────────────── */
.landing-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #243d78 100%);
  color: #fff;
  padding: 4rem 1.5rem;
  text-align: center;
}
.landing-hero h1        { font-size: 2.1rem; margin-bottom: .75rem; color: #fff; }
.landing-hero p         { font-size: 1.05rem; opacity: .9; margin-bottom: 2rem; max-width: 540px; margin-left: auto; margin-right: auto; }
.landing-hero__ctas     { display: flex; flex-direction: column; gap: .75rem; align-items: center; max-width: 360px; margin: 0 auto; }

.landing-steps          { padding: 3rem 1rem; background: var(--bg); }
.landing-steps h2       { text-align: center; margin-bottom: 2rem; color: var(--primary); }

.steps-preview {
  display: grid;
  grid-template-columns: 1fr;
  gap: .875rem;
  max-width: 720px;
  margin: 0 auto;
}

.step-preview-item {
  background: var(--card);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
}
.step-preview-item__number {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.step-preview-item__title { font-weight: 600; font-size: .95rem; color: var(--text); }
.step-preview-item__desc  { font-size: .85rem; color: var(--text-muted); margin-top: .2rem; line-height: 1.5; }

.landing-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: .875rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

@media (min-width: 640px) {
  .landing-hero__ctas     { flex-direction: row; max-width: none; justify-content: center; }
  .steps-preview          { grid-template-columns: repeat(2, 1fr); }
  .landing-hero h1        { font-size: 2.4rem; }
}

@media (min-width: 1024px) {
  .steps-preview { grid-template-columns: repeat(3, 1fr); }
}
