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

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* Paleta clara (Tailwind hardcodeado): azul primario + slate. */
:root {
  --primary:       #2563eb;   /* blue-600 */
  --primary-dark:  #1d4ed8;   /* blue-700 */
  --primary-light: #60a5fa;   /* blue-400 */

  --bg:        #EEF2F8;
  --bg-1:      #FFFFFF;
  --bg-2:      #F8FAFC;
  --surface:   #FFFFFF;
  --surface-2: #F1F5F9;
  --border:    #E2E8F0;
  --border-2:  #CBD5E1;

  --text:      #0f172a;
  --text-2:    #475569;
  --text-3:    #94a3b8;

  /* acento de la marca (azul primario) */
  --accent:      #2563eb;
  --accent-dim:  #EEF2FF;
  --accent-glow: 0 0 0 3px rgba(37,99,235,.15);

  --amber:     #d97706;
  --amber-dim: #fffbeb;

  --green:     #16a34a;
  --green-dim: #f0fdf4;

  --red:       #dc2626;
  --red-dim:   #fef2f2;

  /* Colores de rutas (compartidos por editor.css, editor.html y canvas.js) */
  --ruta-evac:       #16a34a;
  --ruta-ordinaria:  #111827;
  --ruta-reciclable: #9ca3af;
  --ruta-biosani:    #dc2626;

  --shadow:    0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 6px 24px rgba(0,0,0,.13);

  --font-d: 'Inter', sans-serif;
  --font-b: 'Inter', sans-serif;
  --font-m: 'JetBrains Mono', monospace;

  --nav-h: 64px;
  --r:     10px;
  --r-lg:  18px;
  --ease:  cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAV ─────────────────────────────────────────────────── */

header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
  box-shadow: var(--shadow);
}

header nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand a {
  font-family: var(--font-d);
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
}

.nav-logo {
  width: 26px; height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,.85);
  padding: 0.45rem 0.9rem;
  border-radius: var(--r);
  transition: color .2s, background .2s;
  text-decoration: none;
}
.nav-links a:hover { color: #ffffff; background: rgba(255,255,255,.14); }

.nav-links form { display: inline; }
.nav-links button {
  font-family: var(--font-b);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: var(--r);
  cursor: pointer;
  transition: all .2s;
  background: transparent;
  border: 1px solid rgba(255,255,255,.4);
  color: rgba(255,255,255,.9);
}
.nav-links button:hover { border-color: #ffffff; color: #ffffff; background: rgba(255,255,255,.12); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600 !important;
  padding: 0.45rem 1.1rem !important;
  background: #ffffff !important;
  color: var(--primary) !important;
  border-radius: var(--r) !important;
  transition: all .2s var(--ease) !important;
}
.nav-cta:hover {
  background: rgba(255,255,255,.9) !important;
  color: var(--primary-dark) !important;
  box-shadow: var(--shadow);
}

/* ── MAIN ────────────────────────────────────────────────── */

main { padding-top: var(--nav-h); min-height: 100vh; }

/* ── MESSAGES ────────────────────────────────────────────── */

.messages {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 0 2rem;
}
.message {
  padding: 0.75rem 1rem;
  border-radius: var(--r);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  border: 1px solid;
}
.message.success { background: var(--green-dim); color: var(--green); border-color: rgba(22,163,74,.25); }
.message.error   { background: var(--red-dim);   color: var(--red);   border-color: rgba(220,38,38,.25); }
.message.warning { background: var(--amber-dim); color: var(--amber); border-color: rgba(217,119,6,.25); }

/* ── HERO ────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 4rem 2rem;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image: url('/static/img/logo.png');
  background-repeat: no-repeat;
  background-position: 105% 50%;
  background-size: 55%;
  opacity: .06;
}

.hero-glow {
  position: absolute;
  top: -15%; right: -5%;
  width: 55%; height: 75%;
  background: radial-gradient(ellipse, rgba(37,99,235,.06) 0%, transparent 68%);
  pointer-events: none;
}

.hero-glow-2 {
  position: absolute;
  bottom: -10%; left: 10%;
  width: 40%; height: 50%;
  background: radial-gradient(ellipse, rgba(22,163,74,.05) 0%, transparent 68%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-m);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(37,99,235,.22);
  border-radius: 100px;
  padding: 0.35rem 0.9rem;
  margin-bottom: 1.5rem;
}

.hero-tag-dot {
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.hero-title {
  font-family: var(--font-d);
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent) 0%, var(--green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-2);
  line-height: 1.72;
  max-width: 460px;
  margin-bottom: 2.5rem;
}

.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn-primary-lg {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-b);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.8rem;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  cursor: pointer;
  text-decoration: none;
  transition: all .25s var(--ease);
}
.btn-primary-lg:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: var(--accent-glow);
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-ghost-lg {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-b);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.85rem 1.8rem;
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
}
.btn-ghost-lg:hover {
  border-color: var(--text-2);
  color: var(--text);
  text-decoration: none;
}

/* Floor plan SVG */
.hero-visual { display: flex; justify-content: center; align-items: center; }

.floor-plan-svg {
  width: 100%;
  max-width: 480px;
  filter: drop-shadow(0 20px 60px rgba(37,99,235,.15));
}

.route-escape {
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  animation: draw-route 2.8s var(--ease) 0.6s forwards;
}
.route-escape-b {
  stroke-dasharray: 350;
  stroke-dashoffset: 350;
  animation: draw-route 2.2s var(--ease) 1.1s forwards;
}
.route-sanitary {
  stroke-dasharray: 380;
  stroke-dashoffset: 380;
  animation: draw-route 2.2s var(--ease) 2s forwards;
}
.label-fade {
  opacity: 0;
  animation: fade-in .5s ease-out 2.8s forwards;
}

@keyframes draw-route { to { stroke-dashoffset: 0; } }
@keyframes fade-in    { to { opacity: 1; } }

/* ── FEATURES ────────────────────────────────────────────── */

.features {
  padding: 6rem 2rem;
  position: relative;
}

.section-inner { max-width: 1200px; margin: 0 auto; }

.section-kicker {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-m);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.section-kicker::before {
  content: '';
  display: block;
  width: 22px; height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-d);
  font-size: clamp(1.75rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.85rem;
  line-height: 1.1;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 500px;
  line-height: 1.72;
  margin-bottom: 3.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem;
  transition: all .3s var(--ease);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px);
}
.feature-card.visible {
  opacity: 1;
  transform: none;
  transition: opacity .5s ease, transform .5s var(--ease), border-color .3s, background .3s;
}
.feature-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--card-color, var(--accent)), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.feature-card:hover { border-color: var(--border-2); background: var(--surface-2); transform: translateY(-3px); }
.feature-card:hover::after { opacity: 1; }

.feature-card.c-cyan  { --card-color: var(--accent); }
.feature-card.c-amber { --card-color: var(--amber); }
.feature-card.c-green { --card-color: var(--green); }
.feature-card.c-red   { --card-color: var(--red); }

.feature-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.35rem;
}
.feature-icon.i-cyan  { background: var(--accent-dim); }
.feature-icon.i-amber { background: var(--amber-dim); }
.feature-icon.i-green { background: var(--green-dim); }
.feature-icon.i-red   { background: var(--red-dim); }

.feature-card h3 {
  font-family: var(--font-d);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 0.55rem;
}
.feature-card p {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.66;
}

/* ── HOW IT WORKS ────────────────────────────────────────── */

.how-it-works {
  padding: 6rem 2rem;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 3.5rem;
  position: relative;
}
.steps::before {
  content: '';
  position: absolute;
  top: 28px;
  left: calc(16.67% + 1rem);
  right: calc(16.67% + 1rem);
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--green));
  opacity: 0.25;
}

.step { text-align: center; }

.step-num {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-family: var(--font-m);
  font-size: 0.8rem;
  color: var(--accent);
  position: relative;
  z-index: 1;
  transition: all .3s;
}
.step:hover .step-num {
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}

.step h3 {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.step p { font-size: 0.875rem; color: var(--text-2); line-height: 1.66; }

/* ── CTA ─────────────────────────────────────────────────── */

.cta-section {
  padding: 6rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse, rgba(37,99,235,.06) 0%, transparent 70%);
  pointer-events: none;
}
.cta-section h2 {
  font-family: var(--font-d);
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.cta-section p { color: var(--text-2); font-size: 1rem; margin-bottom: 2rem; }

/* ── FOOTER ──────────────────────────────────────────────── */

footer {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
}
footer p {
  font-family: var(--font-m);
  font-size: 0.76rem;
  color: var(--text-3);
  letter-spacing: 0.03em;
}

/* ── AUTH PAGES ──────────────────────────────────────────── */

.auth-page {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/static/img/logo.png');
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: 45%;
  opacity: .06;
}
.auth-page::after {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 500px; height: 280px;
  background: radial-gradient(ellipse, rgba(37,99,235,.06) 0%, transparent 70%);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2.5rem;
  box-shadow: 0 18px 48px rgba(15,23,42,.14);
}

.auth-logo {
  font-family: var(--font-d);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
}
.auth-logo-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
}

.auth-card h1 {
  font-family: var(--font-d);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.35rem;
  text-align: center;
}
.auth-sub {
  font-size: 0.875rem;
  color: var(--text-2);
  text-align: center;
  margin-bottom: 2rem;
}

/* Django form fields */
.auth-card form p { margin-bottom: 1.2rem; }

.auth-card label,
.auth-card form p > label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}

.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="email"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 0.9rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.auth-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.auth-card input::placeholder { color: var(--text-3); }

.auth-card ul.errorlist { list-style: none; margin-top: 0.35rem; }
.auth-card ul.errorlist li { font-size: 0.78rem; color: var(--red); }
.auth-card .helptext { font-size: 0.76rem; color: var(--text-3); margin-top: 0.3rem; display: block; }

.auth-card button[type="submit"] {
  width: 100%;
  padding: 0.8rem;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  font-family: var(--font-b);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--ease);
  margin-top: 0.5rem;
}
.auth-card button[type="submit"]:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: var(--accent-glow);
}

.auth-foot {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-2);
}
.auth-foot a { color: var(--accent); font-weight: 500; }

/* Reglas de contraseña de Django: compactas y discretas, no bullets gigantes */
.auth-card ul {
  font-size: 0.78rem;
  color: var(--text-3);
  padding-left: 1.1rem;
  margin: 0.35rem 0 0.9rem;
  line-height: 1.5;
}

/* ── GENERAL BUTTONS ─────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--r);
  font-family: var(--font-b);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all .2s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-primary:hover { background: transparent; color: var(--accent); }
.btn-secondary { background: var(--surface-2); color: var(--text-2); border-color: var(--border-2); }
.btn-secondary:hover { color: var(--text); border-color: var(--text-3); }
.btn-danger { background: var(--red-dim); color: var(--red); border-color: rgba(220,38,38,.25); }
.btn-danger:hover { background: var(--red); color: var(--bg); }

/* ── INNER PAGES ─────────────────────────────────────────── */

.page-inner { max-width: 1200px; margin: 0 auto; padding: 3rem 2rem; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.page-header h1 {
  font-family: var(--font-d);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

/* ── PROJECT LIST ────────────────────────────────────────── */

.project-list, .project-detail { max-width: 1100px; margin: 0 auto; padding: 2.5rem 2rem; }
.project-list h1 { margin-bottom: 1rem; }
.project-list > .btn { margin-bottom: 1.25rem; }
.project-list ul { list-style: none; }
.project-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.6rem;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color .2s;
}
.project-list li:hover { border-color: var(--border-2); }
.project-list li a { font-size: 1rem; font-weight: 500; color: var(--text); }
.project-list li a:hover { color: var(--accent); text-decoration: none; }
.project-list .meta { display: block; color: var(--text-3); font-size: 0.78rem; font-family: var(--font-m); margin-top: 0.25rem; }

.empty {
  text-align: center;
  padding: 3rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--r);
  color: var(--text-2);
  font-size: 0.9rem;
}

/* ── PROJECT FORM ────────────────────────────────────────── */

.project-form { max-width: 640px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); padding: 2rem; border-radius: var(--r-lg); }
.project-form form p { margin-bottom: 1.2rem; }
.project-form label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text-2); margin-bottom: 0.4rem; }
.project-form input, .project-form textarea { width: 100%; padding: 0.65rem 0.85rem; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--r); color: var(--text); font-family: var(--font-b); font-size: 0.9rem; outline: none; transition: border-color .2s, box-shadow .2s; }
.project-form input:focus, .project-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* ── CONFIRM DELETE ──────────────────────────────────────── */

.confirm-delete { max-width: 480px; margin: 3rem auto; background: var(--surface); border: 1px solid rgba(220,38,38,.2); padding: 2.5rem; border-radius: var(--r-lg); text-align: center; }
.confirm-delete h1 { font-family: var(--font-d); font-size: 1.4rem; font-weight: 800; color: var(--red); margin-bottom: 0.75rem; }
.confirm-delete p { margin: 1rem 0; color: var(--text-2); }

/* ── EDITOR ──────────────────────────────────────────────── */

.editor-container { display: flex; gap: 1rem; height: calc(100vh - var(--nav-h) - 2rem); padding: 1rem; }
.editor-sidebar { width: 280px; background: var(--surface); border: 1px solid var(--border); padding: 1.25rem; border-radius: var(--r-lg); overflow-y: auto; }
.editor-sidebar h2 { font-family: var(--font-d); font-size: 0.85rem; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.75rem; }
.editor-sidebar hr { margin: 1rem 0; border: none; border-top: 1px solid var(--border); }
.tools { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tool-btn { padding: 0.45rem 0.75rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; font-size: 0.8rem; color: var(--text-2); transition: all .2s; font-family: var(--font-b); }
.tool-btn:hover { border-color: var(--border-2); color: var(--text); }
.tool-btn.active { background: var(--accent-dim); border-color: rgba(37,99,235,.35); color: var(--accent); }
.actions { display: flex; flex-direction: column; gap: 0.5rem; }
.editor-canvas { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
#floorCanvas { border: 1px solid var(--border); background: #ffffff; }

/* ── UPLOAD ──────────────────────────────────────────────── */

.upload-form { max-width: 540px; margin: 3rem auto; background: var(--surface); border: 1px solid var(--border); padding: 2rem; border-radius: var(--r-lg); }
.upload-form p { margin-bottom: 1rem; color: var(--text-2); }
.upload-form input[type="file"] { margin-bottom: 1rem; color: var(--text); }

/* ── EXPORT ──────────────────────────────────────────────── */

.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin: 2rem 0; }
.export-card { background: var(--surface); border: 1px solid var(--border); padding: 1.75rem; border-radius: var(--r-lg); text-align: center; transition: border-color .2s, transform .2s; }
.export-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.export-card h3 { font-family: var(--font-d); font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.export-card p { margin-bottom: 1rem; color: var(--text-2); font-size: 0.875rem; }

/* ── PROJECT DETAIL ──────────────────────────────────────── */

.project-detail h1 { font-family: var(--font-d); font-size: 1.75rem; font-weight: 800; letter-spacing: -0.025em; margin-bottom: 0.5rem; }
.project-detail .description { color: var(--text-2); margin-bottom: 1rem; }
.project-detail .actions { margin: 1rem 0; display: flex; flex-direction: row; gap: 0.5rem; }
.project-detail .actions .btn-danger { margin-left: auto; }  /* lo destructivo, lejos */
.plan-list { list-style: none; margin-top: 1rem; }
.plan-list li { background: var(--surface); border: 1px solid var(--border); padding: 1rem 1.25rem; margin-bottom: 0.5rem; border-radius: var(--r); transition: border-color .2s; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.plan-list li a:first-child { font-weight: 500; }
.plan-list li:hover { border-color: var(--border-2); }

/* New plan form */
.new-plan-form { display: flex; gap: 0.5rem; margin: 1rem 0; }
.new-plan-form input { flex: 1; padding: 0.6rem 0.85rem; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--r); color: var(--text); font-family: var(--font-b); font-size: 0.9rem; outline: none; transition: border-color .2s, box-shadow .2s; }
.new-plan-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.new-plan-form input::placeholder { color: var(--text-3); }
.new-plan-form .btn { white-space: nowrap; }

/* ── RESPONSIVE ──────────────────────────────────────────── */

@media (max-width: 900px) {
  header nav { padding: 0 1rem; }
  .hero { padding: 3rem 1.25rem; min-height: auto; }
  .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-sub { max-width: none; }
  .features, .how-it-works, .cta-section { padding: 3.5rem 1.25rem; }
  .steps { grid-template-columns: 1fr; gap: 2rem; }
  .steps::before { display: none; }
  .page-inner, .project-list, .project-detail, .messages { padding-left: 1.25rem; padding-right: 1.25rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .auth-page { padding: 2rem 1.25rem; }
}

@media (max-width: 600px) {
  .nav-links a, .nav-links button { font-size: 0.82rem; padding: 0.4rem 0.6rem; }
  .nav-brand a { font-size: 1.1rem; }
  /* objetivos táctiles cómodos */
  .btn, .btn-primary-lg, .btn-ghost-lg { min-height: 44px; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .upload-form { margin: 1.5rem auto; padding: 1.5rem 1.25rem; }
  .project-list li { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .new-plan-form { flex-direction: column; }
  .project-detail .actions { flex-wrap: wrap; }
  .project-detail .actions .btn-danger { margin-left: 0; }
}

/* ── UPLOAD: guía de colores + preview ───────────────────── */

.up-color-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.6rem;
  margin: 0 0 1.4rem;
}
.up-color-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.7rem 0.5rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  text-align: center;
}
.up-color-card svg { width: 64px; height: 28px; }
.up-color-name { font-weight: 700; font-size: 0.82rem; color: var(--text); }
.up-color-purpose { font-size: 0.72rem; color: var(--text-2); line-height: 1.35; }

.up-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1.6rem 1rem;
  border: 2px dashed var(--border-2);
  border-radius: var(--r-lg);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .2s, background .2s;
  margin-bottom: 1rem;
}
.up-drop:hover { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.up-drop span { font-size: 0.9rem; }

.up-preview {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 1rem;
}
.up-preview[hidden] {
  display: none;
}

.up-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.up-actions .btn { justify-content: center; }
#upSubmit:disabled { opacity: .5; cursor: not-allowed; }

/* ── PROGRESO DE VECTORIZACIÓN ───────────────────────────── */

.progress-page { max-width: 640px; margin: 3rem auto; padding: 0 2rem; }
.progress-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 2.5rem; text-align: center;
}
.progress-card h1 { font-family: var(--font-d); font-size: 1.3rem; font-weight: 800; margin-bottom: 0.6rem; }
.progress-card p { color: var(--text-2); font-size: 0.9rem; }
.progress-spinner {
  width: 40px; height: 40px; margin: 0 auto 1.25rem;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: progress-spin 0.8s linear infinite;
}
@keyframes progress-spin { to { transform: rotate(360deg); } }
.progress-overlay {
  display: block; width: 100%; max-height: 360px; object-fit: contain;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r);
  margin: 1.25rem 0;
}
.progress-overlay[hidden] { display: none; }
.progress-error { color: var(--red); }
.progress-quality {
  text-align: left;
  background: #fef9c3;
  border: 1px solid #eab308;
  border-radius: 8px;
  padding: .8rem 1rem .8rem 1rem;
  margin: 0 0 1rem;
  font-size: .92rem;
}
.progress-quality ul { margin: .4rem 0 0 1.2rem; }
.progress-reprocess { display: inline-flex; gap: .5rem; align-items: center; }
.progress-reprocess select { padding: .5rem; border: 1px solid #d1d5db; border-radius: 8px; }
.progress-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-top: 0.5rem; }

.up-sensitivity-label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text-2); margin: 0.9rem 0 0.35rem; }
.up-sensitivity {
  width: 100%; padding: 0.6rem 0.75rem;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--r);
  color: var(--text); font-family: var(--font-b); font-size: 0.88rem;
}
