:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #1c1f26;
  --text-muted: #666d78;
  --primary: #3454d1;
  --primary-hover: #2842aa;
  --danger: #c0392b;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.navbar .brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
}

.navbar .nav-user {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

main { padding: 32px 0 60px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 360px;
}

.auth-logo {
  display: block;
  width: 180px;
  max-width: 100%;
  margin: 0 auto 20px;
}

.brand-logo {
  display: block;
  height: 44px;
  width: auto;
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 4px;
}

.auth-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.9rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 16px;
}

input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

button, .btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 1rem;
  cursor: pointer;
}

button:hover, .btn:hover { background: var(--primary-hover); text-decoration: none; }

.error {
  background: #fdecea;
  color: var(--danger);
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
}

.materias-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.materias-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.materias-list li:last-child { border-bottom: none; }

/* --- Repaso de tarjetas (pensado para niños) --- */
.flashcard-wrap {
  max-width: 520px;
  margin: 0 auto;
}

.flashcard-progreso {
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 12px;
}

.flashcard {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 20px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  font-size: 1.5rem;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.flashcard .respuesta {
  color: var(--primary);
  margin-top: 16px;
  font-weight: 700;
}

.flashcard-hint {
  text-align: center;
  color: var(--text-muted);
  margin: 14px 0 24px;
  font-size: 1rem;
}

.flashcard-botones {
  display: flex;
  gap: 16px;
}

.btn-grande {
  flex: 1;
  border: none;
  border-radius: 16px;
  padding: 22px 12px;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
}

.btn-sabia { background: #2e7d32; }
.btn-sabia:hover { background: #256428; }
.btn-no-sabia { background: #d17b1f; }
.btn-no-sabia:hover { background: #b5680f; }

.flashcard-final {
  text-align: center;
  padding: 40px 20px;
}
.flashcard-final .emoji { font-size: 3.5rem; margin-bottom: 8px; }
