:root {
  --color-bg: #f7f6f2;
  --color-surface: #ffffff;
  --color-text: #1f2933;
  --color-text-soft: #52606d;
  --color-accent: #ff6f00;
  --color-accent-soft: #fff2e0;
  --color-border: #e4e7eb;
  --color-link: #c2410c;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.05);
  --radius: 10px;
  --max-width: 800px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* HEADER */
.site-header {
  background: linear-gradient(135deg, #ff6f00 0%, #ff9800 100%);
  color: #fff;
  padding: 40px 0;
  margin-bottom: 32px;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 8px;
}

.header-text h1 {
  margin: 0 0 4px 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.tagline {
  margin: 0 0 8px 0;
  font-size: 15px;
  opacity: 0.9;
}

.meta {
  margin: 0;
  font-size: 13px;
  opacity: 0.85;
}

.meta strong { font-weight: 600; }

/* CONTENT */
.content {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

/* TOC */
.toc {
  background: var(--color-accent-soft);
  border: 1px solid #ffcc99;
  border-radius: var(--radius);
  padding: 20px 24px 20px 24px;
  margin-bottom: 32px;
}

.toc h2 {
  margin: 0 0 12px 0;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-accent);
}

.toc ol {
  margin: 0;
  padding: 0 0 0 20px;
  columns: 2;
  column-gap: 24px;
}

.toc li {
  margin-bottom: 6px;
  font-size: 14px;
}

.toc a {
  color: var(--color-link);
  text-decoration: none;
}

.toc a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .toc ol { columns: 1; }
}

/* TYPOGRAPHY */
.lead {
  font-size: 17px;
  color: var(--color-text);
}

h2 {
  font-size: 22px;
  margin: 36px 0 12px 0;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text);
}

section:first-of-type h2,
#introduccion + section h2 {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

#introduccion {
  margin-bottom: 24px;
}

h3 {
  font-size: 17px;
  margin: 24px 0 8px 0;
  color: var(--color-text);
}

p { margin: 8px 0 12px 0; }

ul, ol { margin: 8px 0 16px 0; padding-left: 24px; }
li { margin-bottom: 6px; }

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover { text-decoration: none; }

code {
  background: var(--color-accent-soft);
  color: var(--color-link);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.info-list {
  list-style: none;
  padding: 0;
  background: #fafafa;
  border-left: 3px solid var(--color-accent);
  border-radius: 4px;
  padding: 12px 16px;
}

.info-list li {
  padding: 4px 0;
  margin: 0;
}

.note {
  background: #fff8e1;
  border-left: 4px solid #ffa000;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14.5px;
  margin: 16px 0;
}

/* PERMISSIONS */
.permission {
  background: #fafafa;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
}

.permission h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 600;
}

.permission-key {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-soft);
  background: #eef0f3;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 4px;
  white-space: nowrap;
}

.permission p { margin: 0; font-size: 15px; }

#permiso-camara {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

/* TABLE */
.services {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.services th, .services td {
  border: 1px solid var(--color-border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.services th {
  background: var(--color-accent-soft);
  color: var(--color-link);
  font-weight: 600;
}

.services tr:nth-child(even) td {
  background: #fafafa;
}

@media (max-width: 600px) {
  .services { font-size: 13px; }
  .services th, .services td { padding: 8px 6px; }
}

/* FOOTER */
.site-footer {
  background: var(--color-text);
  color: #cbd2d9;
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
}

/* BACK TO TOP */
#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--color-accent);
  color: #fff;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  transform: translateY(-2px);
  background: #c2410c;
}

/* MOBILE */
@media (max-width: 600px) {
  .site-header { padding: 28px 0; }
  .header-text h1 { font-size: 22px; }
  .logo { width: 60px; height: 60px; }
  .content { padding: 24px 18px; border-radius: 0; }
  h2 { font-size: 19px; }
  h3 { font-size: 16px; }
  .container { padding: 0 16px; }
}
