/* style.css — Design system completo, mobile-first */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Space+Mono:wght@400;700&display=swap');

/* ─── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --c-bg:       #f0f4ff;
  --c-surface:  #ffffff;
  --c-surface2: #e8eeff;
  --c-border:   #d0d9f5;
  --c-text:     #1a1e3a;
  --c-muted:    #6b73a8;
  --c-accent:   #4361ee;
  --c-accent2:  #7b2ff7;
  --c-green:    #06b96f;
  --c-yellow:   #f5a623;
  --c-red:      #e53e3e;
  --c-grad:     linear-gradient(135deg, #4361ee 0%, #7b2ff7 100%);

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  22px;
  --radius-xl:  32px;

  --shadow-sm:  0 2px 8px rgba(67,97,238,.10);
  --shadow-md:  0 4px 20px rgba(67,97,238,.16);
  --shadow-lg:  0 8px 40px rgba(67,97,238,.22);

  --font-body:  'Nunito', sans-serif;
  --font-mono:  'Space Mono', monospace;

  --transition: .2s cubic-bezier(.4,0,.2,1);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--c-grad);
  color: #fff;
  padding: 0 1rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.topbar-logo {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -.5px;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.topbar-logo span { font-size: 1.4rem; }
.topbar-right { display: flex; gap: .5rem; align-items: center; }

.page {
  flex: 1;
  padding: 1.2rem 1rem 5rem;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
.page-wide {
  max-width: 900px;
}

/* ─── Tipografia ─────────────────────────────────────────────────────────── */
h1 { font-size: 1.7rem; font-weight: 900; line-height: 1.2; }
h2 { font-size: 1.25rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
.label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); }

/* ─── Componentes de tela ────────────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--c-border);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card + .card, .card + .btn, .btn + .card { margin-top: .85rem; }

.card-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .85rem;
}
.card-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--c-surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ─── Botões ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: .8rem 1.4rem;
  transition: all var(--transition);
  text-align: center;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  background: var(--c-grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(67,97,238,.35);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(67,97,238,.45); }
.btn-secondary {
  background: var(--c-surface2);
  color: var(--c-accent);
  border: 1.5px solid var(--c-border);
}
.btn-secondary:hover { background: var(--c-border); }
.btn-success {
  background: var(--c-green);
  color: #fff;
  box-shadow: 0 4px 14px rgba(6,185,111,.3);
}
.btn-danger {
  background: var(--c-red);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--c-muted);
  border: 1.5px solid var(--c-border);
}
.btn-ghost:hover { background: var(--c-surface2); color: var(--c-text); }
.btn-full { width: 100%; }
.btn-sm { font-size: .85rem; padding: .5rem .9rem; border-radius: var(--radius-sm); }
.btn-lg {
  font-size: 1.1rem;
  padding: 1rem 1.8rem;
  border-radius: var(--radius-lg);
}
.btn:disabled { opacity: .5; pointer-events: none; }

/* ─── Formulários ────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .85rem; }
.form-label { font-size: .82rem; font-weight: 700; color: var(--c-muted); }
.form-control {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: .75rem 1rem;
  font-size: 1rem;
  color: var(--c-text);
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(67,97,238,.15);
}
.form-control::placeholder { color: var(--c-muted); opacity: .7; }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b73a8' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* ─── Chips / Badge ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .22rem .65rem;
  border-radius: 100px;
}
.badge-pending  { background: #fff3cd; color: #856404; }
.badge-done     { background: #d1f5e4; color: #0a6638; }
.badge-error    { background: #fde8e8; color: #9b1c1c; }
.badge-ai       { background: #ede9fe; color: #5b21b6; }

/* ─── Upload zone ────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2.5px dashed var(--c-border);
  border-radius: var(--radius-lg);
  padding: 2rem 1rem;
  text-align: center;
  background: var(--c-surface);
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}
.upload-zone.drag-over {
  border-color: var(--c-accent);
  background: rgba(67,97,238,.05);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.upload-text  { font-weight: 700; font-size: 1rem; margin-bottom: .3rem; }
.upload-sub   { font-size: .83rem; color: var(--c-muted); }

/* ─── Progress bar ───────────────────────────────────────────────────────── */
.progress-wrap {
  background: var(--c-surface2);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
  margin-top: .6rem;
}
.progress-bar {
  height: 100%;
  background: var(--c-grad);
  border-radius: 100px;
  transition: width .3s ease;
  width: 0;
}

/* ─── Atividade item ─────────────────────────────────────────────────────── */
.ativ-item {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: .65rem;
  animation: slideUp .3s ease both;
}
.ativ-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}
.ativ-nome { font-weight: 700; font-size: .95rem; }
.ativ-data { font-size: .75rem; color: var(--c-muted); }
.ativ-nota {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c-accent);
  background: var(--c-surface2);
  border-radius: var(--radius-sm);
  padding: .2rem .6rem;
  text-align: center;
}
.ativ-comentario {
  font-size: .88rem;
  color: var(--c-muted);
  background: var(--c-surface2);
  border-radius: var(--radius-sm);
  padding: .5rem .7rem;
}
.ativ-link {
  font-size: .82rem;
  color: var(--c-accent);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

/* ─── Turma selector (aluno) ─────────────────────────────────────────────── */
.selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .65rem;
  margin-top: .75rem;
}
.selector-card {
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 1rem .8rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 700;
  font-size: .95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  -webkit-tap-highlight-color: transparent;
}
.selector-card:hover, .selector-card.selected {
  border-color: var(--c-accent);
  background: rgba(67,97,238,.06);
  color: var(--c-accent);
}
.selector-card .s-icon { font-size: 1.8rem; }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  background: var(--c-grad);
  border-radius: var(--radius-xl);
  padding: 1.8rem 1.4rem;
  color: #fff;
  margin-bottom: 1.2rem;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  bottom: -60px; right: -40px;
}
.hero-title  { font-size: 1.4rem; font-weight: 900; margin-bottom: .3rem; }
.hero-sub    { font-size: .9rem; opacity: .85; }
.hero-badge  {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
  border-radius: 100px;
  padding: .25rem .75rem;
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: .75rem;
}

/* ─── Admin tabs ─────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: .35rem;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: .35rem;
  margin-bottom: 1.2rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 1;
  min-width: max-content;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  padding: .6rem .9rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .88rem;
  color: var(--c-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.tab-btn.active {
  background: var(--c-grad);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,12,30,.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  padding: 1rem;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--c-surface);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  width: 100%;
  max-width: 520px;
  max-height: 85dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: popIn .25s cubic-bezier(.34,1.56,.64,1) both;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.modal-close {
  background: var(--c-surface2);
  border: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--c-border); }

/* ─── Login ──────────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--c-bg);
}
.login-card {
  background: var(--c-surface);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  border: 1.5px solid var(--c-border);
  text-align: center;
}
.login-logo { font-size: 3rem; margin-bottom: .5rem; }
.login-title { font-size: 1.5rem; font-weight: 900; margin-bottom: .25rem; }
.login-sub   { font-size: .9rem; color: var(--c-muted); margin-bottom: 1.5rem; }

/* ─── Estados vazios ─────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--c-muted);
}
.empty-icon { font-size: 2.8rem; margin-bottom: .5rem; }
.empty-text { font-weight: 700; font-size: 1rem; }
.empty-sub  { font-size: .85rem; margin-top: .25rem; }

/* ─── Toast ──────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  align-items: center;
  width: calc(100% - 2rem);
  max-width: 400px;
  pointer-events: none;
}
.toast {
  background: var(--c-text);
  color: #fff;
  border-radius: var(--radius-md);
  padding: .75rem 1.1rem;
  font-size: .9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .5rem;
  box-shadow: var(--shadow-md);
  animation: slideUp .3s ease both;
  width: 100%;
  pointer-events: all;
}
.toast.success { background: var(--c-green); }
.toast.error   { background: var(--c-red); }
.toast.info    { background: var(--c-accent); }
.toast.fade-out { animation: fadeOut .4s ease both; }

/* ─── Spinner ────────────────────────────────────────────────────────────── */
.spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.spinner.dark {
  border-color: rgba(67,97,238,.2);
  border-top-color: var(--c-accent);
}

/* ─── Animações ──────────────────────────────────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.88); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateY(10px); }
}

/* ─── Divisores / utilitários ────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--c-border);
  margin: 1rem 0;
}
.mt-1  { margin-top: .4rem; }
.mt-2  { margin-top: .85rem; }
.mt-3  { margin-top: 1.4rem; }
.mb-1  { margin-bottom: .4rem; }
.mb-2  { margin-bottom: .85rem; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: .4rem; }
.gap-2 { gap: .85rem; }
.text-center { text-align: center; }
.text-muted  { color: var(--c-muted); }
.text-sm     { font-size: .85rem; }
.fw-bold     { font-weight: 700; }
.w-full      { width: 100%; }

/* ─── Responsivo tablet+ ─────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .page { padding: 1.5rem 1.5rem 5rem; }
  h1 { font-size: 2rem; }
  .hero { padding: 2.2rem 2rem; }
}
@media (min-width: 900px) {
  .topbar { padding: 0 2rem; }
  .page { padding: 2rem 2rem 4rem; }
}
