/* =======================================================
   XÍCARA ABERTA - STYLESHEET COMPLETO + ACESSIBILIDADE
   WCAG 2.1 AA
   ======================================================= */

/* --- 1. DESIGN SYSTEM --------------------------------- */
:root {
  --bg:          #0a0604;
  --bg-card:     #130d0a;
  --bg-sidebar:  #0f0907;
  --accent:      #f49a24;
  --accent-h:    #ffb144;
  --accent-dim:  rgba(244,154,36,.12);
  --text:        #f7f3eb;
  --muted:       #b0a090;
  --border:      #241a14;
  --border-mid:  #2d201a;
  --success:     #43704e;
  --error:       #962a1d;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
body  { background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; line-height: 1.6; min-height: 100vh; overflow-x: hidden; }
img   { max-width: 100%; display: block; }
.hidden { display: none !important; }

/* --- 2. ACESSIBILIDADE (WCAG 2.1 AA) ------------------ */

/* Skip link - pula para o conteudo principal */
.skip-link {
  position: absolute; top: -100%; left: 0;
  background: var(--accent); color: #000;
  padding: 12px 20px; font-weight: 700; font-size: 14px;
  z-index: 99999; border-radius: 0 0 8px 0;
  text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 0; }

/* Visivel apenas para leitores de tela */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Foco visivel para navegacao por teclado */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

.mach-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent), 0 0 18px rgba(244,154,36,.45);
  transform: translateY(-2px);
}
.lesson-item:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px;
  color: var(--accent); background: rgba(244,154,36,.06);
}
.option-label:focus-within, .quiz-opt-label:focus-within {
  border-color: var(--accent);
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.nav-links a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 4px;
  border-radius: 3px; color: var(--accent);
}
.tab-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -1px;
  border-radius: 4px 4px 0 0; color: var(--accent);
}

/* Tamanho minimo de alvo de toque (WCAG 2.5.5 - 44x44px) */
.mach-btn      { min-width: 44px; min-height: 44px; }
.filter-btn    { min-height: 44px; }
.tab-btn       { min-height: 44px; }
.lesson-item   { min-height: 44px; }
.modal-close   { min-width: 44px; min-height: 44px; }

/* Regiao ao vivo - garante espaco minimo */
[aria-live] { min-height: 20px; }

/* Animacoes reduzidas (conforto visual) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .steam-anim span  { display: none; }
  .led.blinking     { animation: none; opacity: 1; }
  .gauge-needle     { transition: none; }
  .progress-fill    { transition: none; }
}

/* Alto contraste forcado pelo SO */
@media (forced-colors: active) {
  .mach-btn             { border: 2px solid ButtonText; }
  .lesson-dot.watched   { background: Highlight; border-color: Highlight; }
  .badge-premium        { border: 1px solid AccentColor; }
}

/* Preferencia por mais contraste */
@media (prefers-contrast: more) {
  :root { --muted: #c8b8a8; --border: #4a3020; --border-mid: #5a4030; }
}

/* --- 3. TIPOGRAFIA ------------------------------------ */
.eyebrow { display: block; font-size: 11px; text-transform: uppercase; color: var(--accent); letter-spacing: 2px; font-weight: 700; margin-bottom: 8px; }
h2 { font-family: 'Playfair Display', serif; font-size: clamp(1.8rem, 4vw, 2.4rem); color: #fff; line-height: 1.2; }
.app-grid h2 { font-family: 'Inter', sans-serif; font-size: 1.1rem; color: var(--text); }

/* --- 4. NAVBAR ---------------------------------------- */
.global-navbar {
  position: fixed; top: 0; left: 0; width: 100%; height: 66px;
  background: rgba(10,6,4,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; z-index: 1000;
}
.nav-logo { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 800; color: var(--accent); cursor: pointer; user-select: none; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: #fff; }
.btn-nav-login { background: transparent; border: 1px solid var(--accent); color: var(--accent); padding: 8px 18px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 14px; transition: .2s; }
.btn-nav-login:hover { background: var(--accent); color: #000; }

/* --- 5. HOME HERO ------------------------------------- */
.home-hero {
  position: relative; padding: 155px 40px 90px; text-align: center;
  background: radial-gradient(ellipse at 50% 40%, #291808 0%, var(--bg) 65%); overflow: hidden;
}
.hero-bg-grain { position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"); pointer-events: none; }
.badge-premium { display: inline-block; background: var(--accent-dim); color: var(--accent); padding: 6px 16px; border-radius: 50px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 20px; }
.home-hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 900; line-height: 1.1; color: #fff; margin-bottom: 20px; }
.home-hero h1 em { color: var(--accent); font-style: italic; }
.home-hero p { max-width: 620px; margin: 0 auto 40px; color: var(--muted); font-size: 17px; }
.hero-actions { display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; }
.btn-primary-large { background: var(--accent); color: #000; border: none; padding: 15px 32px; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; transition: .2s; }
.btn-primary-large:hover { background: var(--accent-h); transform: translateY(-2px); }
.btn-link { color: var(--muted); text-decoration: none; font-size: 15px; transition: color .2s; }
.btn-link:hover { color: #fff; }

/* --- 6. INTRO STRIP ----------------------------------- */
.intro-strip { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.intro-strip article { padding: 30px 32px; border-right: 1px solid var(--border); }
.intro-strip article:last-child { border-right: none; }
.strip-num { font-family: 'Playfair Display', serif; font-size: 26px; color: rgba(244,154,36,.18); font-weight: 900; display: block; margin-bottom: 6px; }
.intro-strip strong { color: #fff; font-size: 15px; display: block; margin-bottom: 5px; }
.intro-strip p { font-size: 13px; color: var(--muted); }

/* =======================================================
   7. MAQUINA INTERATIVA
   ======================================================= */
.machine-hub-section { padding: 72px 4%; background: #060402; }
.machine-hub-intro { text-align: center; max-width: 560px; margin: 0 auto 56px; }
.machine-hub-intro h2 { margin-bottom: 12px; }
.machine-hub-intro p  { color: var(--muted); font-size: 15px; }

.machine-scene { display: flex; align-items: center; justify-content: center; gap: 36px; }

.machine-legend { display: flex; flex-direction: column; gap: 28px; width: 190px; flex-shrink: 0; }
.legend-item { display: flex; align-items: center; gap: 14px; }
.legend-line { flex: 1; height: 1px; background: linear-gradient(to right, var(--border-mid), transparent); }
.right-legend .legend-line { background: linear-gradient(to left, var(--border-mid), transparent); }
.legend-text strong { display: block; font-size: 13px; color: var(--text); font-weight: 600; }
.legend-text span   { font-size: 11px; color: var(--muted); }
.legend-text.right  { text-align: right; }

.machine-wrapper { position: relative; width: 360px; flex-shrink: 0; filter: drop-shadow(0 30px 60px rgba(0,0,0,.8)); }

/* Painel superior */
.mach-top-panel {
  background: #171008; border: 2px solid #0a0604; border-bottom: none;
  border-radius: 10px 10px 0 0; padding: 12px 16px 10px; position: relative; z-index: 2;
}
.mach-display {
  background: #000; border: 1px solid #2a1a0e; border-radius: 4px;
  padding: 5px 10px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Courier New', monospace;
}
.mach-disp-label { font-size: 10px; color: #3a2508; letter-spacing: 1px; font-weight: 700; }
.mach-disp-val   { font-size: 12px; color: var(--accent); font-weight: 700; transition: color .3s; }
.mach-buttons-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 0 2px; }
.mach-btn-group { display: flex; flex-direction: column; align-items: center; gap: 5px; }

.mach-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: radial-gradient(circle at 40% 30%, #3a2518, #1e1008);
  color: #666; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; position: relative;
  box-shadow: 0 3px 6px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06), 0 0 0 2px #0f0704;
}
.mach-btn svg { width: 16px; height: 16px; transition: .2s; pointer-events: none; }
.mach-btn:hover {
  color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 0 0 2px var(--accent), 0 0 16px rgba(244,154,36,.35), 0 5px 10px rgba(0,0,0,.5);
}
.mach-btn:active { transform: translateY(1px); }
.btn-power:hover { color: #4caf50; box-shadow: 0 0 0 2px #4caf50, 0 0 16px rgba(76,175,80,.35), 0 5px 10px rgba(0,0,0,.5); }
.mach-btn-label { font-size: 10px; color: #3a2a18; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; white-space: nowrap; }

/* Corpo de aco */
.mach-body {
  position: relative; height: 260px;
  background: linear-gradient(160deg, #d6d6d6 0%, #bebebe 20%, #d2d2d2 40%, #b4b4b4 60%, #c6c6c6 80%, #a6a6a6 100%);
  border-left: 2px solid #0a0604; border-right: 2px solid #0a0604; overflow: hidden;
}
.steel-reflection { position: absolute; top: 0; left: 18px; width: 36px; height: 100%; background: linear-gradient(to right, transparent, rgba(255,255,255,.18), transparent); pointer-events: none; }
.steel-reflection.r2 { left: auto; right: 60px; width: 18px; background: linear-gradient(to right, transparent, rgba(255,255,255,.09), transparent); }

/* Manometro */
.mach-gauge-wrap { position: absolute; top: 18px; right: 24px; }
.mach-gauge { position: relative; width: 76px; height: 76px; }
.gauge-chrome-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(#bbb 0deg, #eee 90deg, #aaa 180deg, #ddd 270deg, #bbb 360deg);
  box-shadow: 0 3px 8px rgba(0,0,0,.5);
}
.gauge-face { position: absolute; top: 7px; left: 7px; right: 7px; bottom: 7px; border-radius: 50%; background: #0d0d0d; display: flex; align-items: center; justify-content: center; }
.gauge-mark { position: absolute; width: 2px; height: 5px; background: #444; top: 4px; left: calc(50% - 1px); transform-origin: 1px 27px; transform: rotate(var(--ang)); }
.gauge-needle { position: absolute; width: 2px; height: 20px; background: linear-gradient(to top, transparent 0%, #e63946 40%); bottom: 50%; left: calc(50% - 1px); transform-origin: bottom center; transform: rotate(-60deg); transition: transform 1s ease; border-radius: 2px 2px 0 0; }
.gauge-pivot { position: absolute; width: 7px; height: 7px; background: #bbb; border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 2; }
.gauge-inner-label { position: absolute; bottom: 8px; font-size: 8px; color: #444; font-weight: 700; letter-spacing: 1px; }

/* Marca */
.mach-brand-area { position: absolute; bottom: 92px; left: 0; right: 0; text-align: center; pointer-events: none; }
.mach-brand-name { display: block; font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 900; color: rgba(40,22,8,.3); letter-spacing: 5px; }
.mach-brand-model { display: block; font-size: 8px; color: rgba(40,22,8,.2); letter-spacing: 4px; margin-top: 2px; }

/* Grupo de extracao */
.mach-group-area { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.mach-group-collar { width: 130px; height: 18px; background: linear-gradient(to bottom, #999, #777); border-radius: 4px 4px 0 0; border: 1px solid #666; }
.mach-group-head { width: 106px; height: 44px; background: linear-gradient(to bottom, #808080, #5a5a5a); border-radius: 0 0 53px 53px; display: flex; align-items: center; justify-content: center; border: 1px solid #555; border-top: none; }
.cert-btn { background: none; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; color: rgba(255,255,255,.5); transition: .2s; padding: 4px 8px; border-radius: 6px; min-width: 44px; min-height: 44px; justify-content: center; }
.cert-btn:hover { color: var(--accent); background: rgba(244,154,36,.08); }
.cert-icon  { font-size: 14px; line-height: 1; }
.cert-label { font-size: 8px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; white-space: nowrap; }
.mach-portafilter { width: 116px; display: flex; flex-direction: column; align-items: center; }
.portafilter-neck { width: 116px; height: 16px; background: linear-gradient(to bottom, #6a6a6a, #4a4a4a); border-radius: 0 0 8px 8px; }
.portafilter-spouts { display: flex; gap: 28px; }
.spout { width: 8px; height: 18px; background: linear-gradient(to bottom, #5a5a5a, #3a3a3a); border-radius: 0 0 4px 4px; }

/* Vapor animado */
.steam-anim { position: absolute; bottom: 62px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; pointer-events: none; }
.steam-anim span { width: 3px; background: linear-gradient(to top, rgba(255,255,255,.3), transparent); border-radius: 3px; animation: steamRise 2s infinite ease-in-out; }
.steam-anim span:nth-child(1) { height: 14px; animation-delay: 0s; }
.steam-anim span:nth-child(2) { height: 20px; animation-delay: .4s; }
.steam-anim span:nth-child(3) { height: 12px; animation-delay: .8s; }
@keyframes steamRise { 0%,100%{opacity:0;transform:translateY(0)} 40%{opacity:.6} 80%{opacity:0;transform:translateY(-12px)} }

/* Wand de vapor */
.mach-wand { position: absolute; top: 108px; right: -42px; display: flex; flex-direction: column; align-items: center; }
.wand-shaft  { width: 8px; height: 60px; background: linear-gradient(to right, #aaa, #ddd, #aaa); border-radius: 4px; transform: rotate(12deg); transform-origin: top center; }
.wand-knob   { width: 14px; height: 10px; background: #888; border-radius: 3px; margin-top: -2px; margin-left: 6px; }
.wand-arm    { width: 6px; height: 22px; background: linear-gradient(to right, #bbb, #eee, #bbb); border-radius: 3px; }
.wand-tip    { width: 12px; height: 12px; background: radial-gradient(circle, #ddd, #888); border-radius: 50%; border: 2px solid #666; }

/* Bandeja */
.mach-tray { border-left: 2px solid #0a0604; border-right: 2px solid #0a0604; height: 22px; background: #b0b0b0; position: relative; overflow: hidden; }
.tray-surface { position: absolute; inset: 0; }
.tray-g { position: absolute; background: #999; }
.tray-g.h { width: 100%; height: 1px; }
.tray-g.v { height: 100%; width: 1px; }

/* Base */
.mach-base { height: 46px; background: #0e0b09; border: 2px solid #0a0604; border-top: none; border-radius: 0 0 8px 8px; position: relative; }
.base-red { position: absolute; bottom: 8px; width: 52px; height: 12px; background: #e63946; border-radius: 3px; }
.base-red.left  { left: 30px; }
.base-red.right { right: 30px; }

/* Status LED */
.led.green { width: 12px; height: 12px; border-radius: 50%; background: #00ff66; box-shadow: 0 0 10px #00ff66; }
.blinking  { animation: machinePulse 1.8s infinite; }
@keyframes machinePulse { 0%,100%{opacity:.25} 50%{opacity:1} }

/* =======================================================
   8. CALCULADORA 4:6
   ======================================================= */
.calc-section { padding: 72px 5%; background: #060301; }
.section-head-center { text-align: center; max-width: 560px; margin: 0 auto 48px; }
.section-head-center h2 { margin-bottom: 12px; }
.section-head-center p  { color: var(--muted); font-size: 15px; }
.calc-card { max-width: 660px; margin: 0 auto; background: #160f0b; border: 3px solid #36241c; border-radius: 18px; padding: 28px; box-shadow: 0 0 0 1px #0d0805, 0 24px 50px rgba(0,0,0,.7); }
.calc-screen { background: #000; border: 2px solid rgba(244,154,36,.1); border-radius: 8px; padding: 14px 16px; font-family: 'Courier New', monospace; margin-bottom: 22px; }
.calc-screen-label { font-size: 10px; color: #5a3503; font-weight: 700; letter-spacing: 1px; margin-bottom: 4px; display: block; }
.calc-screen-val   { font-size: 13px; color: var(--accent); font-weight: 700; min-height: 20px; }
.calc-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.control-group { display: flex; flex-direction: column; gap: 6px; }
.control-group label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .8px; }
.control-group input, .calc-select { width: 100%; background: #0c0705; border: 2px solid #36241c; border-radius: 7px; padding: 11px 12px; color: #fff; font-size: 14px; font-weight: 600; outline: none; transition: border-color .2s; }
.control-group input:focus, .calc-select:focus { border-color: var(--accent); }
.calc-select option { background: #0c0705; }
.calc-steps { background: rgba(0,0,0,.25); border-left: 3px solid var(--accent); border-radius: 4px; padding: 16px; margin-bottom: 22px; min-height: 50px; }
.calc-steps h4 { color: var(--accent); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.step-line { font-size: 13px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.03); color: var(--text); }
.step-line:last-child { border-bottom: none; }
.calc-ai { background: #100b09; border: 2px dashed #36241c; border-radius: 10px; padding: 18px; }
.calc-ai-header { font-size: 11px; font-weight: 800; color: var(--accent); margin-bottom: 10px; letter-spacing: .5px; }
.calc-ai-hint   { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* ── Chat conversacional ── */
.chat-history {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 380px; overflow-y: auto;
  padding: 6px 4px 10px; margin-bottom: 12px;
  scrollbar-width: thin; scrollbar-color: #36241c transparent;
}
.chat-history::-webkit-scrollbar { width: 4px; }
.chat-history::-webkit-scrollbar-track { background: transparent; }
.chat-history::-webkit-scrollbar-thumb { background: #36241c; border-radius: 2px; }

.chat-message {
  padding: 10px 14px; border-radius: 10px;
  font-size: 13px; line-height: 1.65; max-width: 92%;
}
.chat-assistant {
  background: #1a0f0a; border: 1px solid rgba(244,154,36,.18);
  border-radius: 10px 10px 10px 3px; align-self: flex-start; color: var(--text);
}
.chat-user {
  background: rgba(244,154,36,.12); border: 1px solid rgba(244,154,36,.25);
  border-radius: 10px 10px 3px 10px; align-self: flex-end;
  color: var(--text); text-align: right;
}
.chat-grind-note {
  background: rgba(244,154,36,.08); border-left: 3px solid var(--accent);
  padding: 7px 10px; border-radius: 4px; font-size: 12px;
  color: var(--muted); margin: 6px 0;
}
.chat-torra-note {
  background: rgba(244,154,36,.12); border-left: 3px solid #e8953a;
  padding: 8px 10px; border-radius: 4px; font-size: 12px;
  color: #d4a96a; margin: 6px 0;
}
.chat-custom-receita {
  background: rgba(244,154,36,.1); border: 1px solid rgba(244,154,36,.35);
  border-radius: 7px; padding: 10px 12px; margin-top: 8px; font-size: 13px;
}
.chat-hint-final { font-size: 11px; color: var(--muted); }
.chat-typing { display: flex; align-items: center; gap: 5px; padding: 12px 16px; }
.chat-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); opacity: .4;
  animation: typing-bounce .9s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .4; }
  40%            { transform: translateY(-6px); opacity: 1; }
}

.calc-ai-row { display: flex; gap: 8px; }
.calc-ai-row input { flex: 1; background: #0c0705; border: 2px solid #281a13; border-radius: 6px; padding: 10px 12px; color: #fff; font-size: 13px; outline: none; transition: border-color .2s; }
.calc-ai-row input:focus { border-color: var(--accent); }
.btn-ai { background: var(--accent); color: #000; border: none; border-radius: 6px; padding: 0 16px; font-weight: 700; font-size: 12px; cursor: pointer; white-space: nowrap; transition: .2s; min-height: 44px; }
.btn-ai:hover { background: var(--accent-h); }

.chat-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn-recomecar {
  background: transparent; color: var(--muted); border: 1px solid #36241c;
  border-radius: 6px; padding: 7px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: .2s; min-height: 36px;
}
.btn-recomecar:hover { color: var(--accent); border-color: var(--accent); }
.btn-copiar {
  background: transparent; color: var(--accent); border: 1px solid rgba(244,154,36,.4);
  border-radius: 6px; padding: 7px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: .2s; min-height: 36px;
}
.btn-copiar:hover { background: rgba(244,154,36,.1); }
.ai-response { margin-top: 12px; background: #0c0705; border: 1px solid rgba(244,154,36,.2); border-radius: 7px; padding: 12px; font-size: 13px; color: var(--text); line-height: 1.6; }

/* =======================================================
   9. HOME - FEATURES, SOBRE, FOOTER
   ======================================================= */
.home-section { padding: 72px 5%; }
.home-section.alt-bg { background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { margin-bottom: 10px; }
.section-header p  { color: var(--muted); font-size: 15px; max-width: 540px; margin: 0 auto; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); padding: 26px; border-radius: 12px; transition: .3s; }
.feature-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.card-icon { font-size: 26px; margin-bottom: 12px; }
.feature-card h3 { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.feature-card p  { color: var(--muted); font-size: 13px; line-height: 1.6; }
.info-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; max-width: 1080px; margin: 0 auto; align-items: center; }
.info-text h2 { margin: 8px 0 16px; }
.info-text p  { color: var(--muted); font-size: 15px; line-height: 1.7; margin-bottom: 18px; }
.bullets-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.bullets-list li { font-size: 14px; color: var(--muted); display: flex; gap: 8px; }
.bullets-list li::before { content: "\2713"; color: var(--accent); font-weight: 800; flex-shrink: 0; }
.site-footer { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; padding: 32px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.site-footer strong { color: var(--text); font-size: 15px; }

/* Secao Barista */
.barista-section { max-width: 1000px; margin: 0 auto; }
.barista-badge { text-align: center; margin-bottom: 48px; }
.barista-badge h2 { margin-top: 6px; }
.barista-card { display: flex; gap: 48px; align-items: flex-start; background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 40px; }
.barista-avatar { flex-shrink: 0; }
.barista-avatar-placeholder { width: 130px; height: 130px; border-radius: 50%; background: var(--border-mid); border: 3px solid var(--accent); display: flex; align-items: center; justify-content: center; font-size: 52px; box-shadow: 0 0 0 6px rgba(244,154,36,.1); }
.barista-bio { flex: 1; }
.barista-name { font-family: 'Playfair Display', serif; font-size: 1.6rem; color: #fff; margin-bottom: 4px; }
.barista-role { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 18px; letter-spacing: .5px; }
.barista-text { color: var(--muted); font-size: 15px; line-height: 1.75; margin-bottom: 16px; font-style: italic; }
.barista-quote {
  border-left: 3px solid var(--accent); margin: 20px 0 28px;
  padding: 10px 16px; font-style: italic; font-size: 15px;
  color: var(--text); line-height: 1.6; background: rgba(244,154,36,.06);
  border-radius: 0 6px 6px 0;
}

/* =======================================================
   10. LOGIN
   ======================================================= */
#screen-login { min-height: 100vh; padding-top: 66px; }
.login-container { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 66px); padding: 40px 20px; }
.login-card { background: var(--bg-card); border: 1px solid var(--border); padding: 36px; border-radius: 14px; width: 100%; max-width: 390px; }
.login-logo  { font-size: 34px; text-align: center; margin-bottom: 14px; }
.login-title { font-family: 'Playfair Display', serif; font-size: 24px; text-align: center; margin-bottom: 6px; color: #fff; }
.login-sub   { color: var(--muted); text-align: center; font-size: 14px; margin-bottom: 26px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; font-weight: 600; }
.form-group input { width: 100%; background: var(--bg); border: 1px solid var(--border-mid); padding: 12px 13px; border-radius: 7px; color: #fff; font-size: 15px; outline: none; transition: border-color .2s; }
.form-group input:focus { border-color: var(--accent); }
.form-group input::placeholder { color: #5a4030; }
.btn-primary { width: 100%; background: var(--accent); color: #000; border: none; padding: 14px; border-radius: 7px; font-weight: 700; font-size: 15px; cursor: pointer; transition: .2s; min-height: 44px; }
.btn-primary:hover { background: var(--accent-h); }
.divider { text-align: center; margin: 18px 0; position: relative; }
.divider::before { content: ""; position: absolute; top: 50%; left: 0; width: 100%; height: 1px; background: var(--border); }
.divider span { position: relative; background: var(--bg-card); padding: 0 10px; color: var(--muted); font-size: 12px; }
.btn-google { width: 100%; background: #fff; color: #000; border: none; padding: 12px; border-radius: 7px; font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; transition: .2s; min-height: 44px; }
.btn-google:hover { background: #f0f0f0; }
.login-back { text-align: center; margin-top: 18px; font-size: 13px; }
.login-back a { color: var(--muted); text-decoration: none; transition: color .2s; }
.login-back a:hover { color: var(--accent); }

/* =======================================================
   11. APP DASHBOARD
   ======================================================= */
.app-grid { display: grid; grid-template-columns: 290px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-top-actions { padding: 14px 14px 10px; border-bottom: 1px solid rgba(255,255,255,.03); }
.btn-back-home { background: rgba(255,255,255,.03); color: var(--muted); border: 1px solid var(--border); width: 100%; text-align: left; padding: 10px 13px; border-radius: 6px; font-size: 13px; cursor: pointer; transition: .2s; font-weight: 500; min-height: 44px; }
.btn-back-home:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; border-bottom: 1px solid var(--border); }
.avatar { font-size: 22px; background: var(--border); padding: 7px; border-radius: 50%; line-height: 1; }
.sidebar-user h4 { font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 2px; }
.progress-txt { font-size: 11px; color: var(--accent); }
.sidebar-progress-bar { height: 4px; background: var(--border); }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width .4s ease; }
.sidebar-title { font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 18px 18px 6px; letter-spacing: 1.5px; font-weight: 600; }
.module-group { border-bottom: 1px solid rgba(255,255,255,.02); }
.module-trigger { padding: 12px 18px; cursor: pointer; transition: .15s; user-select: none; min-height: 44px; display: flex; align-items: center; }
.module-trigger:hover { background: rgba(255,255,255,.02); }
.module-trigger h4 { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.3; }
.lessons-collapsible { display: none; }
.module-group.open .lessons-collapsible { display: block; }
.module-group.locked { opacity: .35; pointer-events: none; }

/* Indicador de aula assistida */
.lesson-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2);
  background: transparent; flex-shrink: 0;
  display: inline-block; transition: background .25s, border-color .25s, box-shadow .25s;
}
.lesson-dot.watched {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 6px rgba(244,154,36,.45);
}

.lesson-item { padding: 10px 18px 10px 30px; font-size: 12px; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 10px; transition: .15s; min-height: 44px; }
.lesson-item:hover { color: #fff; background: rgba(255,255,255,.01); }
.lesson-item.active { color: var(--accent); background: rgba(244,154,36,.05); border-left: 3px solid var(--accent); padding-left: 27px; }
.quiz-item-nav { color: #dfb271; font-weight: 500; }
.btn-logout { margin: auto 18px 0; background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 10px; border-radius: 6px; cursor: pointer; font-size: 13px; transition: .2s; min-height: 44px; }
.btn-logout:hover { border-color: var(--error); color: #e07b70; }

.main-content { padding: 32px 36px; overflow-y: auto; }
.app-header { margin-bottom: 22px; }
.badge-module { color: var(--accent); font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; display: block; margin-bottom: 5px; }
.video-section { margin-bottom: 28px; }
.video-wrapper { position: relative; padding-bottom: 56.25%; background: #000; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.tabs-nav { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tab-btn { background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--muted); padding: 11px 16px; cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; transition: .2s; margin-bottom: -1px; }
.tab-btn:hover { color: #fff; }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-btn[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.inner-tab-card { background: var(--bg-card); border: 1px solid var(--border); padding: 22px; border-radius: 9px; }
.inner-tab-card h3 { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.inner-tab-card > p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.objectives-live-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.live-card { background: var(--bg); border: 1px solid var(--border); padding: 14px; border-radius: 7px; transition: .2s; }
.live-card:hover { border-color: rgba(244,154,36,.3); }
.live-icon { font-size: 20px; display: block; margin-bottom: 6px; }
.live-card strong { font-size: 13px; color: var(--accent); display: block; margin-bottom: 3px; }
.live-card p { font-size: 13px; color: var(--muted); }
.objectives-alert { background: rgba(244,154,36,.05); border-left: 3px solid var(--accent); padding: 11px 14px; font-size: 13px; color: var(--muted); border-radius: 0 5px 5px 0; }
.objectives-alert strong { color: var(--text); }

/* Quiz */
.quiz-box { background: var(--bg-card); border: 1px solid var(--border); padding: 26px; border-radius: 10px; }
.quiz-header-inside { margin-bottom: 22px; }
.quiz-header-inside h3 { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 5px; }
.quiz-header-inside p  { font-size: 13px; color: var(--muted); }
.quiz-item-block { background: var(--bg); border: 1px solid var(--border); padding: 18px; border-radius: 7px; margin-bottom: 14px; transition: .2s; }
.quiz-q-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.options-stack { display: flex; flex-direction: column; gap: 7px; }
.options-stack label, .option-label { background: var(--bg-card); border: 1px solid var(--border); padding: 12px 13px; border-radius: 6px; cursor: pointer; display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--text); transition: .15s; min-height: 44px; }
.options-stack label:hover, .option-label:hover { border-color: var(--accent); }
.quiz-item-block.item-right { border-color: var(--success); background: rgba(67,112,78,.04); }
.quiz-item-block.item-wrong { border-color: var(--error);   background: rgba(150,42,29,.04); }
.badge-right { background: var(--success); color: #fff; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; display: inline-block; margin-top: 10px; }
.badge-wrong { background: var(--error);   color: #fff; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; display: inline-block; margin-top: 10px; }
.wrong-details { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.05); font-size: 13px; }
.wrong-details p { margin-top: 5px; color: var(--muted); }
.txt-marked  { color: #e07b70; text-decoration: line-through; }
.txt-correct { color: #8ec499; font-weight: 600; }
.question-text { font-size: 15px; color: var(--text); margin-bottom: 14px; font-weight: 500; }
.feedback-msg { padding: 14px; border-radius: 7px; font-weight: 600; margin-top: 16px; font-size: 14px; }
.feedback-msg.success { background: rgba(67,112,78,.15); color: #8ec499; border: 1px solid var(--success); }
.feedback-msg.error   { background: rgba(150,42,29,.15); color: #e07b70; border: 1px solid var(--error); }

/* Comunidade */
.comment-box { margin-bottom: 4px; }
.comment-box textarea { width: 100%; height: 90px; background: var(--bg); border: 1px solid var(--border-mid); padding: 12px; border-radius: 7px; color: #fff; margin-bottom: 10px; resize: vertical; font-size: 14px; font-family: 'Inter', sans-serif; outline: none; display: block; line-height: 1.5; }
.comment-box textarea:focus { border-color: var(--accent); }
.comments-feed { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.comment-card { display: flex; gap: 11px; background: var(--bg-card); border: 1px solid var(--border); padding: 14px; border-radius: 8px; }
.comment-card strong { font-size: 13px; color: var(--text); display: block; margin-bottom: 3px; }
.comment-card p { font-size: 13px; color: var(--muted); }

/* =======================================================
   12. MODAIS
   ======================================================= */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.78); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 20px; }
.modal-card { background: var(--bg-card); border: 1px solid var(--border-mid); border-radius: 16px; padding: 36px; max-width: 460px; width: 100%; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-close { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--muted); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 14px; transition: .2s; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--error); color: #fff; border-color: var(--error); }
.modal-icon { font-size: 36px; text-align: center; margin-bottom: 14px; }
.modal-card h3 { font-family: 'Playfair Display', serif; font-size: 22px; color: #fff; text-align: center; margin-bottom: 6px; }
.modal-sub { color: var(--muted); text-align: center; font-size: 14px; margin-bottom: 22px; }
.faq-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.faq-list details { background: var(--bg); border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.faq-list summary { padding: 13px 14px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); list-style: none; min-height: 44px; display: flex; align-items: center; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: " v"; color: var(--accent); font-size: 12px; margin-left: auto; }
.faq-list details[open] summary::after { content: " ^"; }
.faq-list p { padding: 0 14px 12px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.modal-input { width: 100%; background: var(--bg); border: 1px solid var(--border-mid); padding: 12px 13px; border-radius: 7px; color: #fff; font-size: 14px; outline: none; transition: border-color .2s; margin-bottom: 4px; }
.modal-input:focus { border-color: var(--accent); }
.modal-textarea { resize: vertical; min-height: 90px; font-family: inherit; line-height: 1.5; }
.support-email-row { display: flex; align-items: center; gap: 10px; background: var(--accent-dim); border: 1px solid var(--border-mid); border-radius: 8px; padding: 10px 14px; margin: 12px 0; }
.support-email-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.support-email-link { font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 600; word-break: break-all; }
.support-email-link:hover { text-decoration: underline; }
.cert-trophy { font-size: 64px; margin-bottom: 16px; display: block; text-align: center; }
.cert-locked-icon { font-size: 48px; margin-bottom: 16px; display: block; text-align: center; }
.cert-progress-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
.cert-stat { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px; text-align: center; }
.cert-stat strong { display: block; font-size: 1.6rem; color: var(--accent); font-family: 'Playfair Display', serif; }
.cert-stat span { font-size: 12px; color: var(--muted); }

/* =======================================================
   13. CONTROLE DE TELAS
   ======================================================= */
.screen-view { display: block; }
.screen-view.hidden { display: none !important; }
.app-grid.screen-view { display: grid; }
.app-grid.screen-view.hidden { display: none !important; }

/* =======================================================
   14. RESPONSIVIDADE
   ======================================================= */
@media (max-width: 1100px) {
  .machine-scene { flex-wrap: wrap; gap: 24px; }
  .machine-legend { width: 100%; flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 16px 32px; }
  .legend-line { display: none; }
  .legend-text.right { text-align: left; }
  .info-split { grid-template-columns: 1fr; gap: 36px; }
  .app-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .barista-card { flex-direction: column; align-items: center; text-align: center; padding: 28px 20px; }
}
@media (max-width: 768px) {
  .global-navbar { padding: 0 20px; }
  .nav-links a:not(.btn-nav-login) { display: none; }
  .home-hero { padding: 120px 24px 64px; }
  .intro-strip { grid-template-columns: 1fr; }
  .intro-strip article { border-right: none; border-bottom: 1px solid var(--border); }
  .machine-wrapper { width: 300px; }
  .mach-btn { width: 44px; height: 44px; }
  .calc-controls { grid-template-columns: 1fr; }
  .objectives-live-grid { grid-template-columns: 1fr; }
  .main-content { padding: 20px 16px; }
}