/* ==========================================================================
   Área do Aluno — Thayna Freire
   ========================================================================== */

:root {
  --wine-900: #4a1f28;
  --wine-800: #5c2732;
  --wine-700: #6f2f3c;
  --wine-600: #7c3f4d;
  --wine-500: #954a59;
  --wine-100: #f4e3e7;
  --gold: #c9a267;
  --gold-light: #e4cfa0;
  --cream: #fbf5ee;
  --cream-alt: #f5ebe0;
  --white: #fffdfb;
  --ink: #362027;
  --ink-soft: #6b565c;
  --sidebar-w: 340px;
  --header-h: 72px;
  --font-title: "Cormorant Garamond", serif;
  --font-body: "Poppins", sans-serif;
  --radius-sm: 10px;
  --radius-md: 18px;
  --shadow-sm: 0 4px 14px rgba(74, 31, 40, 0.08);
  --shadow-md: 0 12px 32px rgba(74, 31, 40, 0.12);
  --transition: 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ---------------- Botões ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}
.btn--primary {
  background: linear-gradient(135deg, var(--wine-600), var(--wine-800));
  color: var(--white);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn--ghost {
  background: var(--white);
  color: var(--wine-700);
  border-color: rgba(74, 31, 40, 0.15);
}
.btn--ghost:hover:not(:disabled) { background: var(--wine-100); }
.btn--ghost:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--block { width: 100%; }

/* ==========================================================================
   Login
   ========================================================================== */
.aluno-auth {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--wine-900), var(--wine-700));
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.auth-page__back {
  position: absolute;
  top: 24px;
  left: 24px;
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-page__back:hover { color: var(--gold-light); }

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 40px 36px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.auth-card__logo { height: 48px; margin: 0 auto 20px; }
.auth-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--wine-100);
  color: var(--wine-700);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.auth-card h1 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--wine-900);
  margin-bottom: 8px;
}
.auth-card__sub { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 28px; }

.auth-form { text-align: left; }
.auth-form__group { margin-bottom: 18px; }
.auth-form__group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--wine-800);
  margin-bottom: 6px;
}
.auth-form__group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(74,31,40,0.15);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}
.auth-form__group input:focus {
  outline: none;
  border-color: var(--wine-600);
  box-shadow: 0 0 0 3px rgba(124,63,77,0.12);
}
.auth-form .btn { margin-top: 8px; }

.auth-demo {
  margin-top: 24px;
  padding: 14px 16px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-align: left;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.auth-demo i { color: var(--wine-600); margin-top: 2px; }
.auth-demo code {
  background: var(--wine-100);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--wine-800);
}

/* ==========================================================================
   App layout
   ========================================================================== */
.aluno-app { min-height: 100vh; }

.aluno-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid rgba(74,31,40,0.08);
  z-index: 200;
  box-shadow: var(--shadow-sm);
}

.aluno-header__inner {
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.aluno-header__brand img { height: 38px; }
.aluno-header__course { flex: 1; min-width: 0; }
.aluno-header__label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}
.aluno-header__course strong {
  display: block;
  font-size: 0.9rem;
  color: var(--wine-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aluno-header__user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.aluno-header__avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wine-600), var(--wine-800));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.aluno-header__info strong { display: block; font-size: 0.85rem; color: var(--wine-900); }
.aluno-header__info span { font-size: 0.75rem; color: var(--ink-soft); }
.aluno-header__logout {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(74,31,40,0.12);
  background: var(--white);
  color: var(--wine-700);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.aluno-header__logout:hover { background: var(--wine-100); }

.aluno-header__menu {
  display: none;
  width: 40px; height: 40px;
  border: none;
  background: transparent;
  color: var(--wine-900);
  font-size: 1.2rem;
}

.aluno-layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ---------------- Sidebar ---------------- */
.aluno-sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  background: var(--white);
  border-right: 1px solid rgba(74,31,40,0.08);
  overflow-y: auto;
  z-index: 150;
  display: flex;
  flex-direction: column;
}

.aluno-sidebar__head {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(74,31,40,0.06);
}
.aluno-sidebar__thumb {
  width: 80px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
}
.aluno-sidebar__head h2 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  color: var(--wine-900);
  line-height: 1.25;
  margin-bottom: 16px;
}

.aluno-progress__bar {
  height: 6px;
  background: var(--wine-100);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 8px;
}
.aluno-progress__bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--wine-600), var(--gold));
  border-radius: 100px;
  transition: width 0.5s ease;
}
.aluno-progress p { font-size: 0.78rem; color: var(--ink-soft); }

.lesson-list { flex: 1; padding: 12px 0; }

.lesson-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.lesson-item:hover { background: var(--cream); }
.lesson-item.is-active {
  background: var(--wine-100);
  border-left-color: var(--wine-600);
}
.lesson-item.is-locked { opacity: 0.55; cursor: not-allowed; }
.lesson-item.is-locked:hover { background: transparent; }

.lesson-item__icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--wine-100);
  color: var(--wine-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.lesson-item.is-done .lesson-item__icon { background: #e8f5e9; color: #2e7d32; }
.lesson-item.is-active .lesson-item__icon { background: var(--wine-600); color: var(--white); }
.lesson-item.is-locked .lesson-item__icon { background: #eee; color: #999; }

.lesson-item__text strong {
  display: block;
  font-size: 0.85rem;
  color: var(--wine-900);
  margin-bottom: 2px;
  line-height: 1.3;
}
.lesson-item__text span { font-size: 0.75rem; color: var(--ink-soft); }

.aluno-sidebar__foot {
  padding: 16px 20px;
  border-top: 1px solid rgba(74,31,40,0.06);
}
.tag-mock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--wine-700);
  background: var(--wine-100);
  padding: 6px 12px;
  border-radius: 100px;
}

/* ---------------- Main ---------------- */
.aluno-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 28px 32px 48px;
  max-width: 960px;
}

.aluno-player {
  position: relative;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 16 / 9;
}
.aluno-player video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #111;
}
.aluno-player__locked {
  position: absolute;
  inset: 0;
  background: rgba(74,31,40,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--white);
}
.aluno-player__locked i { font-size: 2.5rem; color: var(--gold-light); }

.aluno-player__error {
  position: absolute;
  inset: 0;
  background: rgba(74, 31, 40, 0.95);
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  z-index: 5;
}
.aluno-player__error i { font-size: 2rem; color: var(--gold-light); }
.aluno-player__error p { font-size: 0.9rem; max-width: 420px; }
.aluno-player__error code { background: rgba(255,255,255,0.12); padding: 2px 6px; border-radius: 4px; }
.aluno-player__error-src { font-size: 0.75rem !important; opacity: 0.7; word-break: break-all; }

.aluno-lesson-info { margin-top: 28px; }
.lesson-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wine-600);
  background: var(--wine-100);
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 12px;
}
.aluno-lesson-info h1 {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--wine-900);
  margin-bottom: 10px;
}
.aluno-lesson-info > p { color: var(--ink-soft); margin-bottom: 16px; }

.aluno-lesson-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.aluno-lesson-meta i { color: var(--wine-600); margin-right: 4px; }

.aluno-lesson-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.aluno-notes {
  margin-top: 40px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.aluno-notes h3 {
  font-size: 1rem;
  color: var(--wine-900);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.aluno-notes h3 i { color: var(--wine-600); }
.aluno-notes textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px;
  border: 1px solid rgba(74,31,40,0.12);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
.aluno-notes textarea:focus {
  outline: none;
  border-color: var(--wine-600);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 140;
}
.sidebar-backdrop.is-visible { display: block; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .aluno-header__course { display: none; }
  .aluno-header__info { display: none; }
  .aluno-header__menu { display: flex; align-items: center; justify-content: center; }

  .aluno-sidebar {
    transform: translateX(-100%);
    transition: transform 0.35s ease;
    box-shadow: var(--shadow-md);
  }
  .aluno-sidebar.is-open { transform: translateX(0); }

  .aluno-main { margin-left: 0; padding: 20px 16px 40px; }
  .aluno-lesson-actions { flex-direction: column; }
  .aluno-lesson-actions .btn { width: 100%; }
}

@media (max-width: 480px) {
  .auth-card { padding: 32px 24px; }
}
