
/* ===== VARIABLES ===== */
:root {
  --bg-deep:       #080604;
  --bg-dark:       #0d0a07;
  --bg-mid:        #151008;
  --bg-card:       #1c1510;
  --bg-elevated:   #231a12;
  --wine:          #5c1010;
  --wine-light:    #8B1A1A;
  --gold:          #c49a38;
  --gold-light:    #e8c17a;
  --gold-dim:      #8a6c28;
  --beige:         #c4a882;
  --beige-dim:     #7a6045;
  --text-primary:  #f0e6d3;
  --text-secondary:#a08878;
  --text-dim:      #5a4535;
  --border:        rgba(196,154,56,0.14);
  --border-strong: rgba(196,154,56,0.28);
  --radius:        8px;
  --radius-lg:     16px;
  --transition:    0.25s ease;
  --font-display:  'Cinzel', serif;
  --font-body:     'Montserrat', sans-serif;
  --font-hero:     'Bebas Neue', cursive;
  --nav-h:         64px;
  --header-h:      58px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; font-family: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }

/* Film grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9998;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }

/* ===== UTILITIES ===== */
.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}


/* ============================================================
   LOGIN SCREEN
   ============================================================ */
#login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
}
#login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%,   rgba(92,16,16,.45) 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(196,154,56,.07) 0%, transparent 60%);
  pointer-events: none;
}
.login-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0,0,0,.85), 0 0 0 1px rgba(196,154,56,.08);
  animation: slideUp .55s ease forwards;
}
.login-tagline {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .32em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: 10px;
}
.login-divider {
  width: 48px;
  height: 1px;
  background: var(--border-strong);
  margin: 28px auto;
}
.login-field { margin-bottom: 14px; text-align: left; }
.login-field label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 7px;
}
.login-field input {
  width: 100%;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.login-field input:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(196,154,56,.1);
}
.login-field input::placeholder { color: var(--text-dim); }
.login-error {
  font-size: 12px;
  color: #e05555;
  margin-bottom: 14px;
  display: none;
  padding: 10px 14px;
  background: rgba(224,85,85,.08);
  border: 1px solid rgba(224,85,85,.2);
  border-radius: var(--radius);
}
.btn-login {
  width: 100%;
  padding: 16px;
  background: var(--wine-light);
  border: none;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(196,154,56,.18) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 2.2s infinite;
}
.btn-login:hover  { background: #7a1515; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(92,16,16,.5); }
.btn-login:active { transform: translateY(0); }
.login-footer {
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .04em;
}


/* ============================================================
   APP SHELL
   ============================================================ */
#app { min-height: 100dvh; padding-bottom: var(--nav-h); }

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: linear-gradient(to bottom, rgba(8,6,4,.98) 0%, rgba(8,6,4,.92) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.header-nav-tabs { display: none; gap: 2px; }
.header-user { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--wine);
  border: 1.5px solid var(--gold-dim);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--gold-light);
  font-weight: 600;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(8,6,4,.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  border: none; background: none;
  color: var(--text-dim);
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition);
  padding: 8px 4px;
}
.nav-item.active { color: var(--gold); }
.nav-item svg { width: 22px; height: 22px; transition: transform var(--transition); }
.nav-item.active svg { transform: translateY(-2px); }
.nav-label { font-size: 9px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; line-height: 1; }

/* Views */
.view { display: none; animation: fadeIn .3s ease; }
.view.active { display: block; }


/* ============================================================
   PRINCIPAL TAB
   ============================================================ */
.hero-section { padding: 28px 20px 0; }
.hero-greeting { font-size: 10px; font-weight: 300; letter-spacing: .3em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 4px; }
.hero-title {
  font-family: var(--font-hero);
  font-size: clamp(30px, 9vw, 52px);
  letter-spacing: .06em;
  line-height: 1;
  margin-bottom: 4px;
}
.hero-title span { color: var(--gold); }

.section { padding: 24px 0 4px; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; padding: 0 20px; margin-bottom: 14px; }
.section-title { font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.section-link { font-size: 11px; color: var(--gold-dim); cursor: pointer; transition: color var(--transition); }
.section-link:hover { color: var(--gold); }

/* Featured */
.featured-module {
  margin: 16px 20px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 8;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}
.featured-module:hover { border-color: var(--border-strong); }
.featured-bg { position: absolute; inset: 0; }
.featured-bg img { width: 100%; height: 100%; object-fit: cover; }
.featured-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(8,6,4,.95) 0%, rgba(8,6,4,.55) 55%, rgba(8,6,4,.2) 100%);
}
.featured-content {
  position: absolute; inset: 0;
  padding: 24px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.featured-tag {
  display: inline-block;
  font-size: 9px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  padding: 3px 8px; border-radius: 3px;
  margin-bottom: 10px; align-self: flex-start;
}
.featured-title { font-family: var(--font-display); font-size: clamp(16px,5vw,28px); font-weight: 700; line-height: 1.2; margin-bottom: 8px; }
.featured-desc {
  font-size: 12px; color: var(--beige); line-height: 1.5; margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.btn-play {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--wine-light); border: none; border-radius: var(--radius);
  padding: 10px 20px; color: var(--text-primary);
  font-family: var(--font-display); font-size: 10px; font-weight: 600; letter-spacing: .14em;
  transition: background var(--transition);
  align-self: flex-start;
}
.btn-play:hover { background: #7a1515; }

/* Carousel */
.carousel-scroll {
  display: flex; gap: 14px;
  overflow-x: auto; padding: 0 20px 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.carousel-scroll::-webkit-scrollbar { display: none; }

/* Module card */
.module-card {
  flex-shrink: 0; width: 138px;
  cursor: pointer; scroll-snap-align: start;
  transition: transform var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.module-card:hover { transform: translateY(-4px); }
.module-card:active { transform: scale(0.97); }

/* TODO: CAPA → Para cada módulo, substitua o <img> dentro de .module-poster por um com src apontando para a imagem real (proporção 1080x1600). */
.module-poster {
  width: 100%; aspect-ratio: 9/16;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.module-card:hover .module-poster { box-shadow: 0 14px 36px rgba(0,0,0,.8); border-color: var(--border-strong); }
.module-poster img { width: 100%; height: 100%; object-fit: cover; }

.module-meta { padding: 8px 2px 0; }
.module-meta-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.module-meta-lessons { font-size: 10px; color: var(--text-secondary); margin-bottom: 6px; }

/* Progress bar */
.progress-bar { width: 100%; height: 2px; background: var(--bg-elevated); border-radius: 1px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--wine-light), var(--gold)); border-radius: 1px; transition: width .5s ease; }


/* ============================================================
   MODULE DETAIL (OVERLAY)
   ============================================================ */
#module-detail {
  position: fixed; inset: 0;
  background: var(--bg-deep);
  z-index: 500;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
#module-detail.open { transform: translateX(0); }

.detail-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: rgba(8,6,4,.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.btn-back {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 50%;
  color: var(--text-primary);
  transition: background var(--transition);
  flex-shrink: 0;
}
.btn-back:hover { background: var(--bg-card); }
.detail-header-title { font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: .08em; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Player */
.player-container { width: 100%; aspect-ratio: 16/9; background: #000; position: relative; overflow: hidden; }
.player-container iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.player-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-mid) 100%);
  cursor: pointer;
}
.play-icon-large {
  width: 64px; height: 64px;
  background: var(--wine-light); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition), background var(--transition);
  box-shadow: 0 8px 32px rgba(92,16,16,.5);
}
.player-placeholder:hover .play-icon-large { transform: scale(1.1); background: #7a1515; }
.player-lesson-title { font-size: 12px; font-family: var(--font-display); letter-spacing: .1em; color: var(--text-secondary); text-align: center; padding: 0 24px; }

/* Detail content */
.detail-content { padding: 24px 20px 48px; }
.detail-module-number { font-size: 10px; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; color: var(--gold-dim); margin-bottom: 6px; }
.detail-module-title { font-family: var(--font-display); font-size: clamp(20px,6vw,32px); font-weight: 700; line-height: 1.15; margin-bottom: 12px; }
.detail-module-desc { font-size: 14px; line-height: 1.65; color: var(--beige); margin-bottom: 28px; }
.detail-lessons-title { font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

/* Lesson items */
.lesson-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: var(--radius);
  cursor: pointer; margin-bottom: 4px;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}
.lesson-item:hover  { background: var(--bg-card); border-color: var(--border); }
.lesson-item.active { background: var(--bg-elevated); border-color: var(--border-strong); }
.lesson-number {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  flex-shrink: 0;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.lesson-item.active .lesson-number { background: var(--wine); border-color: var(--wine-light); color: var(--gold-light); }
.lesson-info { flex: 1; min-width: 0; }
.lesson-label { font-size: 10px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 2px; }
.lesson-title { font-size: 13px; font-weight: 500; color: var(--text-primary); line-height: 1.3; }
.lesson-play-icon { color: var(--text-dim); transition: color var(--transition); flex-shrink: 0; }
.lesson-item:hover .lesson-play-icon,
.lesson-item.active .lesson-play-icon { color: var(--gold); }


/* ============================================================
   CONTINUE WATCHING
   ============================================================ */
.continue-item {
  display: flex; gap: 14px;
  padding: 16px 20px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.continue-item:hover { background: var(--bg-card); }
.continue-thumb { width: 100px; aspect-ratio: 9/16; border-radius: var(--radius); overflow: hidden; flex-shrink: 0; position: relative; }
.continue-thumb img { width: 100%; height: 100%; object-fit: cover; }
.continue-thumb-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.4);
}
.continue-thumb-play span {
  width: 28px; height: 28px;
  background: rgba(92,16,16,.9); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.continue-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.continue-module-name { font-size: 10px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: var(--gold-dim); margin-bottom: 4px; }
.continue-lesson-title { font-size: 13px; font-weight: 500; line-height: 1.3; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.continue-progress-wrap { display: flex; align-items: center; gap: 8px; }
.continue-progress-text { font-size: 10px; color: var(--text-secondary); white-space: nowrap; }


/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 40vh; padding: 48px 32px; text-align: center; }
.empty-icon { width: 56px; height: 56px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; color: var(--text-dim); }
.empty-title { font-family: var(--font-display); font-size: 14px; font-weight: 600; letter-spacing: .08em; margin-bottom: 8px; }
.empty-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.55; max-width: 260px; }


/* ============================================================
   MORE CONTENT
   ============================================================ */
.content-section { padding: 24px 20px; border-bottom: 1px solid var(--border); }
.content-section-title {
  font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
  color: var(--gold-dim); margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.content-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.content-item { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(196,154,56,.05); transition: opacity var(--transition); cursor: pointer; }
.content-item:last-child { border-bottom: none; }
.content-item:hover { opacity: .72; }
.content-item-icon { width: 40px; height: 40px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 17px; }
.content-item-title { font-size: 13px; font-weight: 500; margin-bottom: 3px; line-height: 1.3; }
.content-item-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }


/* ============================================================
   WORKBOOK
   ============================================================ */
.workbook-hero { margin: 24px 20px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); position: relative; }
/* TODO: WORKBOOK_COVER → Dentro de .workbook-hero, substitua o SVG gerado por <img src="capa-workbook.jpg" style="width:100%;display:block"> para usar a capa real. */
.workbook-hero-visual { width: 100%; min-height: 260px; position: relative; }
.workbook-hero-content {
  position: relative; z-index: 2;
  padding: 36px 28px; text-align: center;
}
.workbook-label { font-size: 10px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.workbook-title { font-family: var(--font-hero); font-size: clamp(36px,11vw,68px); letter-spacing: .08em; line-height: 1; margin-bottom: 12px; }
.workbook-subtitle { font-size: 13px; color: var(--beige); line-height: 1.55; max-width: 300px; margin: 0 auto 28px; }
/* TODO: WORKBOOK_URL → Substitua href="#" no .btn-download pelo link real do PDF do workbook */
.btn-download {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--gold); border: none; border-radius: var(--radius);
  padding: 14px 30px; color: var(--bg-deep);
  font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: .16em;
  text-decoration: none; transition: background var(--transition), transform var(--transition);
}
.btn-download:hover { background: var(--gold-light); transform: translateY(-2px); }

.workbook-how { padding: 24px 20px; }
.workbook-section-title { font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.workbook-body { font-size: 14px; line-height: 1.7; color: var(--beige); margin-bottom: 28px; }
.workbook-chapters { display: flex; flex-direction: column; gap: 10px; }
.chapter-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.chapter-num { font-family: var(--font-hero); font-size: 22px; color: var(--gold-dim); letter-spacing: .04em; flex-shrink: 0; width: 28px; }
.chapter-title-text { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.chapter-desc-text { font-size: 11px; color: var(--text-secondary); }


/* ============================================================
   SETTINGS
   ============================================================ */
.settings-profile { margin: 24px 20px; padding: 24px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; align-items: center; gap: 16px; }
.settings-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--wine); border: 2px solid var(--gold-dim); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--gold-light); flex-shrink: 0; }
.settings-name { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: .06em; margin-bottom: 4px; }
.settings-email { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.settings-plan { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); background: rgba(196,154,56,.1); border: 1px solid rgba(196,154,56,.22); padding: 3px 8px; border-radius: 3px; }

.settings-section { padding: 4px 20px 0; }
.settings-label { font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--text-dim); padding: 0 4px; margin-bottom: 8px; }
.settings-list { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.settings-item { display: flex; align-items: center; gap: 14px; padding: 15px 16px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background var(--transition); }
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: var(--bg-elevated); }
.settings-item-icon { width: 32px; height: 32px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; }
.settings-item-label { font-size: 14px; font-weight: 500; }
.settings-item-value { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }
.settings-arrow { color: var(--text-dim); margin-left: auto; }

.btn-logout { width: calc(100% - 40px); margin: 4px 20px 48px; padding: 14px; background: transparent; border: 1px solid rgba(224,85,85,.28); border-radius: var(--radius); color: #e05555; font-family: var(--font-display); font-size: 11px; font-weight: 600; letter-spacing: .16em; transition: background var(--transition), border-color var(--transition); }
.btn-logout:hover { background: rgba(224,85,85,.07); border-color: rgba(224,85,85,.5); }

/* View header */
.view-header { padding: 28px 20px 0; }
.view-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-dim); margin-bottom: 4px; }
.view-title { font-family: var(--font-display); font-size: clamp(22px,7vw,36px); font-weight: 700; letter-spacing: .06em; margin-bottom: 6px; }
.view-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; }


/* ============================================================
   DESKTOP
   ============================================================ */
@media (min-width: 768px) {
  #app { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .app-header { padding: 0 40px; }
  .header-nav-tabs { display: flex; }
  .header-tab { padding: 8px 14px; font-family: var(--font-display); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-secondary); border: none; background: none; border-radius: var(--radius); transition: color var(--transition), background var(--transition); }
  .header-tab:hover { color: var(--text-primary); background: var(--bg-card); }
  .header-tab.active { color: var(--gold); }

  .hero-section       { padding: 40px 40px 0; }
  .section-header     { padding: 0 40px; }
  .carousel-scroll    { padding: 0 40px 20px; }
  .featured-module    { margin: 20px 40px 0; aspect-ratio: 16/7; }
  .module-card        { width: 175px; }
  .continue-item      { padding: 18px 40px; }
  .content-section    { padding: 24px 40px; }
  .workbook-hero      { margin: 28px 40px; }
  .workbook-how       { padding: 28px 40px; }
  .settings-profile   { margin: 28px 40px; }
  .settings-section   { padding: 4px 40px 0; }
  .btn-logout         { width: calc(100% - 80px); margin: 4px 40px 48px; }
  .view-header        { padding: 40px 40px 0; }
  .detail-content     { max-width: 860px; padding: 32px 40px 60px; }
}

@media (min-width: 1200px) {
  .hero-section       { padding: 52px 64px 0; }
  .section-header     { padding: 0 64px; }
  .carousel-scroll    { padding: 0 64px 24px; }
  .featured-module    { margin: 24px 64px 0; }
  .module-card        { width: 195px; }
  .continue-item      { padding: 18px 64px; }
  .content-section    { padding: 28px 64px; }
  .workbook-hero      { margin: 32px 64px; }
  .workbook-how       { padding: 32px 64px; }
  .settings-profile   { margin: 32px 64px; }
  .settings-section   { padding: 4px 64px 0; }
  .btn-logout         { width: calc(100% - 128px); margin: 4px 64px 48px; }
  .view-header        { padding: 52px 64px 0; }
}


/* ===== LOGIN PAGE ===== */
.page-login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-wrap { width: 100%; max-width: 380px; text-align: center; }
.login-title { font-family: var(--font-display); color: var(--gold); font-size: 1.8rem; letter-spacing: .08em; margin-bottom: 24px; }
.login-form { display: grid; gap: 14px; text-align: left; }
.login-form label { display: grid; gap: 6px; color: var(--text-secondary); font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.login-form input { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 12px 14px; font: inherit; }
.login-form input:focus { outline: none; border-color: var(--gold); }
.login-form button { background: var(--wine); color: var(--text-primary); border: 1px solid var(--gold-dim); border-radius: var(--radius); padding: 12px; font: inherit; letter-spacing: .08em; text-transform: uppercase; transition: var(--transition); }
.login-form button:hover { background: var(--wine-light); }
.login-erro { background: rgba(92,16,16,0.3); border: 1px solid var(--wine-light); color: var(--text-primary); padding: 10px; border-radius: var(--radius); margin-bottom: 12px; font-size: .9rem; }

/* ===== NAV ===== */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 32px; border-bottom: 1px solid var(--border); background: var(--bg-dark); position: sticky; top: 0; z-index: 100; }
.logo { font-family: var(--font-display); color: var(--gold); font-size: 1.1rem; letter-spacing: .08em; text-decoration: none; }
.topnav { display: flex; gap: 20px; }
.nav-item--ativo { color: var(--gold); border-bottom-color: var(--gold); }
.nav-item--admin { color: var(--wine-light); }
.container { padding: 32px; max-width: 1400px; margin: 0 auto; padding-bottom: calc(var(--nav-h) + 32px); }
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; background: var(--bg-dark); border-top: 1px solid var(--border); height: var(--nav-h); z-index: 100; }
.bnav { flex: 1; display: grid; place-items: center; color: var(--text-secondary); text-decoration: none; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
.bnav.nav-item--ativo { color: var(--gold); }
@media (min-width: 768px) { .bottomnav { display: none; } }
@media (max-width: 767px) { .topnav { display: none; } }

/* ===== HOME ===== */
.hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 40px; min-height: 320px; display: grid; align-items: end; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.45); z-index: 0; }
.hero-content { position: relative; z-index: 1; padding: 32px; }
.hero-titulo { font-family: var(--font-display); color: var(--gold); font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 12px; }
.hero-desc { color: var(--text-secondary); max-width: 520px; margin-bottom: 20px; }
.btn-primary { display: inline-block; background: var(--wine); color: var(--text-primary); border: 1px solid var(--gold-dim); border-radius: var(--radius); padding: 12px 28px; text-decoration: none; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; transition: var(--transition); }
.btn-primary:hover { background: var(--wine-light); }
.secao-titulo { font-family: var(--font-display); color: var(--gold); font-size: 1.4rem; letter-spacing: .06em; margin: 24px 0 16px; }
.grid-modulos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.card-modulo { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: var(--transition); border: 1px solid var(--border); }
.card-modulo:hover { transform: translateY(-4px); border-color: var(--gold-dim); }
.card-modulo img { aspect-ratio: 1080 / 1600; object-fit: cover; width: 100%; background: var(--bg-mid); }
.card-modulo-titulo { padding: 12px; font-family: var(--font-display); font-size: .95rem; color: var(--text-primary); }

/* ===== MÓDULO ===== */
.modulo-titulo { font-family: var(--font-display); color: var(--gold); font-size: 2rem; margin-bottom: 8px; }
.modulo-desc { color: var(--text-secondary); margin-bottom: 20px; max-width: 720px; }
.player-wrap { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
#yt-player, #yt-player iframe { width: 100% !important; height: 100% !important; }
.aula-acoes { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 12px; flex-wrap: wrap; }
.aula-titulo { font-family: var(--font-display); color: var(--text-primary); font-size: 1.2rem; }
.btn-toggle { background: transparent; color: var(--gold); border: 1px solid var(--gold-dim); border-radius: var(--radius); padding: 8px 16px; letter-spacing: .06em; text-transform: uppercase; font-size: .8rem; }
.btn-toggle:hover { background: var(--gold-dim); color: var(--bg-deep); }
.lista-aulas { list-style: none; display: grid; gap: 4px; }
.item-aula a { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--bg-card); border-radius: var(--radius); text-decoration: none; color: var(--text-primary); border: 1px solid var(--border); }
.item-aula--atual a { border-color: var(--gold-dim); }
.badge-concluida { color: var(--gold); font-size: .75rem; letter-spacing: .06em; }
.card-modulo-sub { color: var(--text-secondary); font-size: .8rem; font-family: var(--font-body); margin-top: 2px; }
.barra-progresso { height: 3px; background: var(--bg-mid); }
.barra-progresso-fill { height: 100%; background: var(--gold); }
.link-gold { color: var(--gold); text-decoration: none; }

/* === Admin: flash + tabelas + formulários === */
.flash { padding: 10px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: .9rem; }
.flash-ok   { background: rgba(196,154,56,0.1); border: 1px solid var(--gold-dim); color: var(--gold-light); }
.flash-erro { background: rgba(92,16,16,0.3);  border: 1px solid var(--wine-light); color: var(--text-primary); }
.admin-tabela { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.admin-tabela th, .admin-tabela td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem; }
.admin-tabela th { color: var(--gold); font-family: var(--font-display); letter-spacing: .04em; }
.admin-form { display: grid; gap: 12px; max-width: 560px; margin-bottom: 24px; }
.admin-form label { display: grid; gap: 6px; color: var(--text-secondary); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.admin-form input, .admin-form textarea, .admin-form select { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 10px; font: inherit; }
.admin-form button { background: var(--wine); color: var(--text-primary); border: 1px solid var(--gold-dim); border-radius: var(--radius); padding: 10px; letter-spacing: .06em; text-transform: uppercase; font-size: .85rem; }
.btn-link { background: none; border: none; color: var(--gold); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.btn-danger { color: var(--wine-light); }

/* === Admin: nav === */
.admin-nav { list-style: none; display: grid; gap: 8px; max-width: 320px; }
.admin-nav a { display: block; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); text-decoration: none; }
.admin-nav a:hover { border-color: var(--gold-dim); }
