
:root {
  --bg: #f5f5f7;
  --bg-card: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #1d4ed8;
  --accent-soft: #dbeafe;
  --border: #e5e7eb;
}

[data-theme="dark"] {
  --bg: #020617;
  --bg-card: #020617;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #60a5fa;
  --accent-soft: #0b1120;
  --border: #1f2937;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.page {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text);
}

/* Header */

.header {
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  flex: 1;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
}

.brand-text {
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Nav */

.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.nav-text {
  color: var(--text-muted);
}

.nav-link {
  text-decoration: none;
  color: var(--accent);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.nav-link:hover {
  background-color: var(--accent-soft);
}

.nav-link--primary {
  border: 1px solid var(--accent);
}

/* Theme toggle */

.theme-toggle {
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

/* Messages */

.messages {
  max-width: 960px;
  margin: 0.75rem auto 0;
  padding: 0 1rem;
}

.message {
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  background-color: var(--bg-card);
}

.message--success {
  border-color: #16a34a33;
  background-color: #22c55e11;
}

/* Main */

.main {
  max-width: 960px;
  margin: 1.25rem auto 2rem;
  padding: 0 1rem;
}

/* Footer */

.footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  background-color: var(--bg-card);
}

.footer-text {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* Estilo para listas de ayuda dentro de formularios (password rules, etc.) */
form ul {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  padding-left: 1.25rem;   /* sangría para los bullets */
  list-style-type: disc;
}

form ul li {
  margin-bottom: 0.15rem;
}

/* Quill render (Delta -> HTML) */
.question-html {
  line-height: 1.6;
  width: 100%;
  flex: 1 1 auto;
}
.question-html h1,
.question-html h2,
.question-html h3 {
  margin: 0.4em 0 0.2em;
  font-weight: 700;
}
.question-html p {
  margin: 0.3em 0;
}
.question-html ul,
.question-html ol {
  margin: 0.35em 0 0.35em 1.2em;
  padding: 0;
}
.question-html ul {
  list-style: disc;
}
.question-html ol {
  list-style: decimal;
}
.question-html li {
  margin: 0.15em 0;
}
.question-html table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
}
.question-html th,
.question-html td {
  border: 1px solid #cbd5e1;
  padding: 6px 8px;
}
.dark .question-html th,
.dark .question-html td {
  border-color: #334155;
}
.question-html blockquote {
  margin: 0.6em 0;
  padding: 0.4em 0.8em;
  border-left: 3px solid #94a3b8;
  background: #f8fafc;
}
.dark .question-html blockquote {
  border-left-color: #475569;
  background: #0b1220;
}
.question-html code {
  background: #f1f5f9;
  padding: 0.1em 0.3em;
  border-radius: 4px;
}
.dark .question-html code {
  background: #111827;
}
.question-html pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.7em;
  border-radius: 6px;
  overflow: auto;
}
.dark .question-html pre {
  background: #020617;
  color: #e2e8f0;
  border: 1px solid #1f2937;
}
.question-html a {
  color: #1d4ed8;
  text-decoration: underline;
}
.dark .question-html a {
  color: #60a5fa;
}
.question-html img {
  display: block;
  max-width: 100%;
  height: auto;
}
.question-html .ql-align-center {
  text-align: center;
}
.question-html .ql-align-right {
  text-align: right;
}
.question-html .ql-align-justify {
  text-align: justify;
}
.question-html .ql-align-center img,
.question-html .ql-align-justify img {
  margin-left: auto;
  margin-right: auto;
}
.question-html .ql-align-right img {
  margin-left: auto;
  margin-right: 0;
}
.question-html img.ql-align-center,
.question-html img.ql-align-justify {
  margin-left: auto;
  margin-right: auto;
}
.question-html img.ql-align-right {
  margin-left: auto;
  margin-right: 0;
}
.question-html img[data-align="center"],
.question-html img[data-align="justify"] {
  margin-left: auto;
  margin-right: auto;
}
.question-html img[data-align="right"] {
  margin-left: auto;
  margin-right: 0;
}
.question-html hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 0.8em 0;
}
.dark .question-html hr {
  border-top-color: #334155;
}
.question-html .ql-formula,
.question-html .ql-latex {
  display: inline-block;
  vertical-align: middle;
}
.question-html .ql-align-center .ql-formula,
.question-html .ql-align-center .ql-latex,
.question-html .ql-align-justify .ql-formula,
.question-html .ql-align-justify .ql-latex {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.question-html .ql-align-right .ql-formula,
.question-html .ql-align-right .ql-latex {
  display: block;
  margin-left: auto;
  margin-right: 0;
}
.question-html .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0;
}

/* Quill editor (WYSIWYG) alignment */
.ql-editor img {
  max-width: 100%;
  height: auto;
}
.ql-editor .ql-align-center img,
.ql-editor img[data-align="center"],
.ql-editor img[data-align="justify"] {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.ql-editor .ql-align-right img,
.ql-editor img[data-align="right"] {
  display: block;
  margin-left: auto;
  margin-right: 0;
}
.ql-editor .ql-align-center .ql-formula,
.ql-editor .ql-align-center .ql-latex,
.ql-editor .ql-align-justify .ql-formula,
.ql-editor .ql-align-justify .ql-latex {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.ql-editor .ql-align-right .ql-formula,
.ql-editor .ql-align-right .ql-latex {
  display: block;
  margin-left: auto;
  margin-right: 0;
}
