:root {
  --bg: #f4eadc;
  --paper: #fffaf2;
  --paper-strong: #fbf0df;
  --sand: #d8c1a4;
  --arena: #c8aa84;
  --visor: #a88f75;
  --brown: #4f382b;
  --brown-soft: #705949;
  --ink: #2e241d;
  --muted: #806b5c;
  --line: rgba(79, 56, 43, 0.14);
  --shadow: 0 24px 70px rgba(79, 56, 43, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(216, 193, 164, .35), transparent 28rem),
    linear-gradient(135deg, #f6efe5 0%, #efe1cf 100%);
  color: var(--ink);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 4rem);
  background: rgba(244, 234, 220, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .75rem; }
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brown);
  color: #f8ead7;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.8rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(79,56,43,.22);
}
.brand strong { display: block; font-family: "Cormorant Garamond", serif; font-size: 1.35rem; line-height: 1; }
.brand small { display: block; color: var(--muted); font-size: .75rem; margin-top: .18rem; }
.main-nav { display: flex; align-items: center; gap: 1.1rem; color: var(--brown-soft); font-weight: 600; font-size: .94rem; }
.main-nav a:not(.btn):hover { color: var(--brown); }

.section-pad { padding: clamp(4rem, 8vw, 8rem) clamp(1rem, 5vw, 5rem); }
.hero { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(280px, .88fr); align-items: center; gap: clamp(2rem, 5vw, 5rem); min-height: calc(100vh - 84px); }
.eyebrow { margin: 0 0 .9rem; color: var(--visor); letter-spacing: .14em; text-transform: uppercase; font-size: .78rem; font-weight: 800; }
h1, h2, h3 { font-family: "Cormorant Garamond", serif; margin: 0; color: var(--brown); }
h1 { font-size: clamp(3rem, 7vw, 6.7rem); line-height: .88; letter-spacing: -.04em; }
h2 { font-size: clamp(2.2rem, 4.2vw, 4rem); line-height: .98; }
h3 { font-size: 1.7rem; }
.lead { max-width: 760px; margin: 1.5rem 0 0; color: var(--brown-soft); font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 1px solid transparent;
  padding: .9rem 1.15rem;
  min-height: 46px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: .18s ease;
}
.btn-primary { background: var(--brown); color: #fff8ec; box-shadow: 0 16px 35px rgba(79,56,43,.24); }
.btn-primary:hover { transform: translateY(-1px); background: #3b2a20; }
.btn-soft { background: rgba(255,250,242,.72); color: var(--brown); border-color: var(--line); }
.btn-outline { background: transparent; color: var(--brown); border-color: rgba(79,56,43,.32); }
.btn.full { width: 100%; }
.trust-row { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.6rem; }
.trust-row span, .badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .45rem .7rem;
  color: var(--muted);
  background: rgba(255,250,242,.54);
  font-weight: 700;
  font-size: .8rem;
}
.hero-card { min-height: 520px; border-radius: var(--radius-lg); background: linear-gradient(145deg, #80634b, #3d2b22); box-shadow: var(--shadow); position: relative; overflow: hidden; padding: 2rem; }
.hero-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 70% 18%, rgba(255,246,226,.26), transparent 10rem), url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23fff1d8' fill-opacity='0.05'%3E%3Cpath d='M0 0h80v2H0zM0 40h80v1H0zM0 79h80v1H0z'/%3E%3C/g%3E%3C/svg%3E"); }
.moon { position: absolute; top: 3rem; right: 3rem; width: 118px; height: 118px; border-radius: 50%; background: #f8ead7; box-shadow: 0 0 70px rgba(248,234,215,.55); }
.moon::after { content: ""; position: absolute; width: 88px; height: 88px; right: -10px; top: -8px; border-radius: 50%; background: #5b412f; }
.card-paper { position: absolute; left: 2rem; right: 2rem; bottom: 2rem; z-index: 1; padding: 2rem; border-radius: 24px; background: rgba(255,250,242,.92); box-shadow: 0 28px 70px rgba(0,0,0,.22); }
.paper-line { display: block; height: 12px; border-radius: 999px; background: #decbb2; margin: .8rem 0; }
.w80 { width: 80%; } .w55 { width: 55%; } .w70 { width: 70%; }
.signal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-top: 1.6rem; }
.signal-grid div { background: #f2e4d2; border-radius: 16px; padding: 1rem; }
.signal-grid strong { display: block; color: var(--brown); font-size: 1.5rem; }
.signal-grid small { color: var(--muted); font-weight: 700; }

.split-section { display: grid; grid-template-columns: .8fr 1.2fr; gap: 3rem; border-top: 1px solid var(--line); }
.rich-text { color: var(--brown-soft); font-size: 1.05rem; line-height: 1.85; }
.rich-text strong { color: var(--brown); }
.center { text-align: center; }
.cards-section { background: rgba(255,250,242,.35); }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 2.2rem; }
.feature-card, .panel-card, .stat-card {
  background: rgba(255,250,242,.76);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 50px rgba(79,56,43,.08);
}
.feature-card { padding: 1.4rem; min-height: 250px; }
.feature-number { color: var(--visor); font-weight: 900; letter-spacing: .12em; }
.feature-card h3 { margin: 1rem 0 .7rem; }
.feature-card p { color: var(--muted); line-height: 1.7; }
.legal-band { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; background: var(--brown); color: #f8ead7; }
.legal-band h2, .legal-band .eyebrow { color: #f8ead7; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.check-list li { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); padding: 1rem; border-radius: 14px; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 2rem clamp(1rem, 5vw, 5rem); color: var(--muted); border-top: 1px solid var(--line); }

.auth-body { min-height: 100vh; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 480px) 1fr; }
.auth-panel { padding: clamp(1.5rem, 4vw, 4rem); background: rgba(255,250,242,.72); display: flex; flex-direction: column; justify-content: center; }
.auth-panel h1 { margin-top: 2.5rem; font-size: clamp(2.5rem, 5vw, 4.4rem); }
.auth-panel p { color: var(--muted); line-height: 1.6; }
.auth-form, .stack-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.auth-form label { display: grid; gap: .4rem; font-weight: 800; color: var(--brown); }
input, select { width: 100%; border: 1px solid var(--line); background: #fffaf2; color: var(--ink); border-radius: 14px; padding: .95rem 1rem; outline: none; }
input:focus, select:focus { border-color: var(--visor); box-shadow: 0 0 0 4px rgba(168,143,117,.16); }
.form-message { min-height: 1.2rem; color: var(--brown-soft); font-weight: 700; }
.form-message.error { color: #9b2f22; }
.form-message.success { color: #426b42; }
.small-note { font-size: .9rem; }
.auth-visual { display: grid; place-items: center; padding: 2rem; background: linear-gradient(135deg, rgba(79,56,43,.92), rgba(168,143,117,.86)); }
.visual-card { max-width: 560px; border-radius: 32px; padding: 3rem; background: rgba(255,250,242,.13); color: #fff6e8; border: 1px solid rgba(255,255,255,.18); box-shadow: 0 34px 80px rgba(0,0,0,.25); }
.visual-card span { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 900; }
.visual-card h2 { color: #fff6e8; margin-top: 1rem; font-size: clamp(2.5rem, 5vw, 5rem); }

.admin-body { display: grid; grid-template-columns: 290px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 1.2rem; border-right: 1px solid var(--line); background: rgba(255,250,242,.72); display: flex; flex-direction: column; gap: 1.3rem; }
.side-nav { display: grid; gap: .4rem; margin-top: 1rem; }
.side-nav a { padding: .9rem 1rem; border-radius: 14px; color: var(--brown-soft); font-weight: 800; }
.side-nav a.active, .side-nav a:hover { background: var(--brown); color: #fff6e8; }
.admin-main { padding: clamp(1rem, 3vw, 2rem); overflow: hidden; }
.admin-topbar { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin-bottom: 1.4rem; }
.admin-topbar h1 { font-size: clamp(2rem, 4vw, 4rem); }
.dashboard-section { margin: 1.3rem 0; }
.dashboard-section h2 { font-size: 2rem; margin-bottom: 1rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-card { padding: 1.2rem; }
.stat-card span { color: var(--muted); font-weight: 900; }
.stat-card strong { display: block; margin: .5rem 0; font-size: 2.2rem; font-family: "Cormorant Garamond", serif; color: var(--brown); }
.stat-card small { color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1.25fr .75fr; gap: 1rem; align-items: start; }
.panel-card { padding: 1.2rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .9rem .65rem; border-bottom: 1px solid var(--line); color: var(--brown-soft); }
th { color: var(--brown); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.metric-list, .usage-grid { display: grid; gap: .8rem; }
.metric-item { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem; background: var(--paper-strong); border-radius: 14px; color: var(--brown-soft); }
.metric-item strong { color: var(--brown); }
.usage-grid { grid-template-columns: repeat(3, 1fr); }
.privacy-page { max-width: 980px; margin: 0 auto; }

/* Selector de idiomas */
.lang-switch { display: inline-flex; gap: .2rem; padding: .2rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,250,242,.6); }
.lang-switch button { border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: .78rem; padding: .35rem .6rem; border-radius: 999px; cursor: pointer; transition: .15s ease; }
.lang-switch button:hover { color: var(--brown); }
.lang-switch button.active { background: var(--brown); color: #fff6e8; }

/* Enlaces del pie */
.footer-links { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.footer-links a { color: var(--muted); font-weight: 700; font-size: .9rem; }
.footer-links a:hover { color: var(--brown); }

/* Campo de archivo (carga de dibujo) */
.file-label { display: grid; gap: .45rem; font-weight: 800; color: var(--brown); font-size: .92rem; }
.file-label input[type="file"] { font-weight: 500; padding: .7rem; background: #fffaf2; border: 1px dashed var(--visor); border-radius: 14px; cursor: pointer; }

/* Páginas legales */
.legal-page { max-width: 920px; margin: 0 auto; }
.legal-page .rich-text h2 { font-size: 1.7rem; margin-top: 2rem; }
.legal-note { background: rgba(255,250,242,.7); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.1rem 1.3rem; color: var(--brown-soft); margin: 1.5rem 0; }

@media (max-width: 1050px) {
  .hero, .split-section, .legal-band, .two-col { grid-template-columns: 1fr; }
  .feature-grid, .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-body { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}
@media (max-width: 720px) {
  .site-header { align-items: flex-start; }
  .main-nav { display: none; }
  .feature-grid, .stats-grid, .usage-grid { grid-template-columns: 1fr; }
  .hero-card { min-height: 420px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}
