/* ═══════════════════════════════════════════════════════
   PSPO I — Plano de Estudos — page-specific styles
   Depende de: style.css (design tokens) + simulators.css
   ═══════════════════════════════════════════════════════ */

:root {
  --pspo-bg:          var(--z-bg);
  --pspo-surface:     var(--z-surface);
  --pspo-surface2:    var(--z-card);
  --pspo-border:      var(--z-border);
  --pspo-accent:      var(--z-primary);
  --pspo-accent-lt:   rgba(43,184,184,.85);
  --pspo-accent-dim:  rgba(43,184,184,.12);
  --pspo-text:        var(--z-text);
  --pspo-muted:       var(--z-text-2);
  --pspo-dim:         var(--z-text-muted);
  --pspo-green:       #4ade80;
  --pspo-green-dim:   rgba(74,222,128,.1);
  --pspo-amber:       #fbbf24;
  --pspo-amber-dim:   rgba(251,191,36,.1);
  --pspo-red:         #f87171;
  --font-head:  'Ubuntu', sans-serif;
  --font-body:  'Ubuntu', sans-serif;
}

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

body {
  background: var(--pspo-bg);
  color: var(--pspo-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); }

/* ── Grain overlay ── */
.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.wrapper {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Header ── */
.pspo1-header {
  margin-bottom: 48px;
  border-bottom: 1px solid var(--pspo-border);
  padding-bottom: 32px;
}

.pspo-badge {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pspo-accent-lt);
  background: var(--pspo-accent-dim);
  border: 1px solid rgba(43,184,184,.25);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
}

h1 {
  font-family: var(--font-head);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 12px;
}

h1 em {
  font-style: italic;
  color: var(--pspo-accent-lt);
}

.subtitle {
  color: var(--pspo-muted);
  font-size: 14px;
  font-weight: 300;
}

/* ── Meta strip ── */
.meta-strip {
  display: flex;
  gap: 24px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.meta-item { display: flex; flex-direction: column; gap: 2px; }

.meta-label {
  font-family: var(--font-head);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pspo-dim);
}

.meta-value { font-size: 14px; font-weight: 500; color: var(--pspo-text); }

/* ── Progress ── */
.progress-section {
  background: var(--pspo-surface);
  border: 1px solid var(--pspo-border);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 40px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-label {
  font-family: var(--font-head);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pspo-muted);
}

.progress-pct {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 500;
  color: var(--pspo-accent-lt);
}

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

.pspo-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pspo-accent), var(--pspo-accent-lt));
  border-radius: 3px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-stats { display: flex; gap: 16px; margin-top: 12px; }

.pspo-stat { font-size: 12px; color: var(--pspo-muted); }
.pspo-stat span { color: var(--pspo-green); font-weight: 600; }

/* ── Phase ── */
.phase { margin-bottom: 36px; }

.phase-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.phase-number {
  font-family: var(--font-head);
  font-size: 11px;
  color: var(--pspo-dim);
  min-width: 32px;
}

.phase-title {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 400;
  color: #fff;
}

.phase-duration {
  margin-left: auto;
  font-family: var(--font-head);
  font-size: 11px;
  color: var(--pspo-accent-lt);
  background: var(--pspo-accent-dim);
  padding: 3px 8px;
  border-radius: 4px;
}

/* ── Topic cards ── */
.topics { display: flex; flex-direction: column; gap: 8px; }

.topic {
  background: var(--pspo-surface);
  border: 1px solid var(--pspo-border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.topic:hover { border-color: var(--pspo-accent); background: var(--pspo-surface2); }

.topic.done {
  border-color: rgba(74,222,128,.2);
  background: var(--pspo-green-dim);
}

.topic.done .topic-title { text-decoration: line-through; color: var(--pspo-muted); }

.checkbox {
  width: 18px; height: 18px;
  border: 1.5px solid var(--pspo-border);
  border-radius: 4px;
  flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}

.topic.done .checkbox { background: var(--pspo-green); border-color: var(--pspo-green); }

.checkmark { display: none; width: 10px; height: 10px; }
.topic.done .checkmark { display: block; }

.topic-body { flex: 1; min-width: 0; }

.topic-title {
  font-size: 14px; font-weight: 500; color: var(--pspo-text);
  margin-bottom: 2px; transition: color 0.2s;
}

.topic-desc { font-size: 12px; color: var(--pspo-muted); line-height: 1.5; }

.topic-tag {
  font-family: var(--font-head);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 2px;
}

.tag-study    { background: rgba(59,130,246,.12); color: #93c5fd; }
.tag-practice { background: rgba(251,191,36,.12);  color: var(--pspo-amber); }
.tag-review   { background: rgba(43,184,184,.12);  color: var(--pspo-accent-lt); }
.tag-exam     { background: rgba(248,113,113,.12); color: var(--pspo-red); }

/* ── Resources ── */
.resources {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--pspo-border);
}

.section-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 400;
  color: #fff;
  margin-bottom: 20px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.resource-card {
  background: var(--pspo-surface);
  border: 1px solid var(--pspo-border);
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.2s ease;
}

.resource-card:hover {
  background: var(--pspo-surface2);
  border-color: var(--pspo-accent);
  transform: translateY(-2px);
}

.resource-icon { font-size: 20px; margin-bottom: 8px; }
.resource-title { font-family: var(--font-head); font-size: 13px; font-weight: 600; color: var(--pspo-text); margin-bottom: 4px; }
.resource-desc  { font-size: 12px; color: var(--pspo-muted); line-height: 1.5; }

.resource-tag {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-head);
  font-size: 10px;
  color: var(--pspo-green);
  background: var(--pspo-green-dim);
  padding: 2px 6px;
  border-radius: 3px;
}

/* ── Tip box ── */
.tip-box {
  margin-top: 32px;
  background: var(--pspo-accent-dim);
  border: 1px solid rgba(43,184,184,.25);
  border-radius: 10px;
  padding: 20px 24px;
}

.tip-box strong {
  display: block;
  font-size: 11px;
  color: var(--pspo-accent-lt);
  margin-bottom: 8px;
  font-family: var(--font-head);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tip-box p { font-size: 13px; color: var(--pspo-muted); line-height: 1.6; }

/* ── Divider ── */
.phase-divider { height: 1px; background: var(--pspo-border); margin: 8px 0 24px 44px; }

/* ── Mobile ── */
@media (max-width: 500px) {
  .meta-strip { gap: 16px; }
  .phase-duration { display: none; }
  .wrapper { padding: 32px 16px 60px; }
}
