:root {
  --teal: #024959;
  --teal-dark: #013844;
  --orange: #d95d41;
  --orange-hover: #c24f36;
  --ink: #1f2933;
  --muted: #5f6c7b;
  --line: #d9e2e7;
  --bg: #f4f7f8;
  --card: #ffffff;
  --ok: #1f7a4c;
  --danger: #b42318;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(2, 73, 89, 0.08);
  --font: "PT Sans", "Roboto", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--teal); }
img { max-width: 100%; height: auto; }

.panel-body { min-height: 100vh; }
.panel-top {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo { height: 52px; width: auto; }
.brand-sm .brand-logo { height: 42px; }

.panel-main {
  width: min(920px, calc(100% - 2rem));
  margin: 1.5rem auto 3rem;
}

/* Auth split layout */
.auth-body {
  min-height: 100vh;
  background: #fff;
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
}
.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #fff;
  min-height: 100vh;
}
/* Continuidad arriba: misma foto ampliada y difuminada (evita el “corte”) */
.auth-visual__fill {
  position: absolute;
  inset: -12%;
  z-index: 0;
  background-image: var(--auth-hero);
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  filter: blur(22px) saturate(1.05) brightness(0.78);
  transform: scale(1.18);
}
.auth-visual__media {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: var(--auth-hero);
  /* Zoom + anclar abajo: el grupo llena la mitad inferior */
  background-size: 185% auto;
  background-position: center bottom;
  background-repeat: no-repeat;
  transform: translate3d(0, 20%, 0) scale(1.1);
  animation: auth-pan 18s ease-in-out infinite alternate;
  /* Fundido suave hacia el fill de arriba */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.35) 10%, #000 26%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.35) 10%, #000 26%, #000 100%);
}
.auth-visual__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(165deg, rgba(2, 73, 89, 0.78) 0%, rgba(2, 73, 89, 0.55) 45%, rgba(217, 93, 65, 0.42) 100%);
}
.auth-visual__overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(1, 56, 68, 0.45) 0%, rgba(1, 56, 68, 0.2) 28%, rgba(1, 56, 68, 0.18) 72%, rgba(1, 56, 68, 0.42) 100%),
    radial-gradient(circle at 80% 12%, rgba(217, 93, 65, 0.22), transparent 40%);
}
.auth-visual__copy {
  position: relative;
  z-index: 3;
  width: min(44rem, calc(100% - 4rem));
  max-width: none;
  margin-top: 0;
  margin-bottom: auto;
  padding: 2.75rem 3rem 1.5rem;
  animation: auth-fade-up 0.7s ease both;
}
.auth-visual__eyebrow {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffd2c4;
}
.auth-visual__title {
  margin: 0 0 0.85rem;
  font-family: "PT Sans", sans-serif;
  font-size: clamp(1.9rem, 2.6vw, 2.55rem);
  line-height: 1.18;
  font-weight: 700;
  max-width: 100%;
}
.auth-visual__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.08rem;
  max-width: 36rem;
  line-height: 1.45;
}
.auth-side {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #fff;
  border-left: 1px solid var(--line);
}
.auth-side__header {
  padding: 1.25rem 1.75rem 0.5rem;
  animation: auth-fade-up 0.55s ease both;
}
.auth-side__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.25rem 2.25rem 2rem;
  min-height: 0;
  overflow-y: auto;
}
.auth-side__footer {
  text-align: center;
  color: var(--muted);
  padding: 1rem 1.5rem 1.4rem;
  font-size: 0.92rem;
}
.auth-side__footer a { color: var(--muted); text-decoration: none; }
.auth-side__footer a:hover { color: var(--teal); }

.auth-panel {
  width: 100%;
  animation: auth-fade-up 0.65s ease 0.08s both;
}
.auth-panel h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.7rem, 2.1vw, 2.05rem);
  max-width: none;
}
.auth-kicker {
  margin: 0 0 0.45rem;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
}
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 1.1rem;
}
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  font-size: 0.95rem;
}
.auth-muted-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.auth-muted-link:hover { color: var(--teal); text-decoration: underline; }

.info-block, .service-card, .directory-preview, .preview-block, .status-banner, .empty-state {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 700; color: var(--orange); margin: 0 0 0.5rem; }
h1, h2, h3, h4 { font-family: "PT Sans", sans-serif; color: var(--teal); line-height: 1.2; }
.lead { color: var(--muted); margin: 0 0 1.35rem; }

@keyframes auth-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes auth-pan {
  from { transform: translate3d(0, 20%, 0) scale(1.1); }
  to { transform: translate3d(-1%, 22%, 0) scale(1.14); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-visual__media,
  .auth-visual__copy,
  .auth-side__header,
  .auth-panel {
    animation: none;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 4px;
  border: 1px solid transparent;
  padding: 0.7rem 1.1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: 0.15s ease;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-hover); color: #fff; }
.btn-secondary { background: var(--teal); color: #fff; }
.btn-secondary:hover { background: var(--teal-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--teal); color: var(--teal); }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.9rem; }
.btn-block { width: 100%; }
.btn-link, .btn-icon {
  background: none; border: 0; color: var(--teal); cursor: pointer; font: inherit; text-decoration: underline;
}
.btn-icon { text-decoration: none; font-size: 1.3rem; line-height: 1; color: var(--muted); padding: 0 0.35rem; }

.field { margin-bottom: 1.1rem; }
.field-spaced { margin-top: 1.75rem; margin-bottom: 1.5rem; }
.field-spaced > label { margin-bottom: 0.65rem; }
.field label, fieldset.field legend { display: block; font-weight: 700; margin-bottom: 0.35rem; color: var(--teal); }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field input[type="file"],
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  background: #fff;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid rgba(2,73,89,0.25);
  border-color: var(--teal);
}
.hint, .char-count { color: var(--muted); font-size: 0.92rem; margin: 0.35rem 0 0; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 5rem; }
.toggle-password {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--teal); font-weight: 700; cursor: pointer;
}
.check label { display: flex; gap: 0.55rem; align-items: flex-start; font-weight: 400; color: var(--ink); }
.form-error { color: var(--danger); margin: 0.5rem 0; }
.form-success { color: var(--ok); margin: 0.5rem 0; }
.auth-switch { margin-top: 1.2rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }

.code-inputs { display: flex; gap: 0.5rem; margin: 1rem 0; }
.code-digit {
  width: 3rem; height: 3.2rem; text-align: center; font-size: 1.4rem; font-weight: 700;
  border: 1px solid var(--line); border-radius: 8px;
}
.verify-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }

.panel-nav { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; }
.panel-nav a {
  color: var(--teal); text-decoration: none; font-weight: 700; font-size: 0.95rem;
  border-bottom: 2px solid transparent; padding-bottom: 0.15rem;
}
.panel-nav a.active, .panel-nav a:hover { border-color: var(--orange); color: var(--orange); }

.wizard-progress {
  width: min(920px, calc(100% - 2rem));
  margin: 1rem auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.wizard-step {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  text-align: center; padding: 0.55rem 0.75rem; font-weight: 700; color: var(--muted); font-size: 0.92rem;
}
.wizard-step.done { color: var(--teal); border-color: rgba(2,73,89,0.3); }
.wizard-step.current { background: var(--teal); color: #fff; border-color: var(--teal); }

.page-head { margin-bottom: 1.25rem; }
.page-head.with-action { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.page-head h1, .page-head h2 { margin: 0 0 0.35rem; }
.section-title { margin: 1.5rem 0 0.75rem; font-size: 1.2rem; }

.readonly-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 0; }
.readonly-grid dt { color: var(--muted); font-size: 0.9rem; }
.readonly-grid dd { margin: 0.15rem 0 0; font-weight: 700; color: var(--teal); }
.grid-2, .grid-3 { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.choice-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.choice {
  border: 1px solid var(--line); border-radius: 8px; padding: 0.65rem 0.9rem; cursor: pointer; background: #fff;
}
.choice:has(input:checked) { border-color: var(--orange); background: rgba(217,93,65,0.08); }
.choice input { margin-right: 0.4rem; }

.dynamic-list { display: grid; gap: 0.5rem; margin-bottom: 0.6rem; }
.dynamic-item { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem; align-items: center; }
.extra-block { border: 1px dashed var(--line); border-radius: 10px; padding: 0.85rem 1rem; margin-bottom: 1rem; background: #fff; }
.extra-block summary { cursor: pointer; font-weight: 700; color: var(--teal); }
.logo-preview { margin-top: 0.75rem; width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.85rem; }
.quick-link {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem; text-decoration: none; color: var(--teal); font-weight: 700; box-shadow: var(--shadow);
}
.quick-link:hover { border-color: var(--orange); color: var(--orange); }

.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.service-card-top { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.service-card h2, .service-card h3 { margin: 0; font-size: 1.15rem; }
.meta-list { display: flex; gap: 1rem; padding: 0; list-style: none; color: var(--muted); }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.85rem; }
.badge { display: inline-flex; padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.badge-ok { background: rgba(31,122,76,0.12); color: var(--ok); }
.badge-draft { background: rgba(95,108,123,0.12); color: var(--muted); }

.status-banner { margin-bottom: 1rem; }
.status-banner.ok { border-color: rgba(31,122,76,0.3); background: rgba(31,122,76,0.06); }
.status-banner.warn { border-color: rgba(217,93,65,0.35); background: rgba(217,93,65,0.08); }
.status-banner ul { margin: 0.5rem 0 0; padding-left: 1.1rem; }

.preview-header { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.preview-logo { width: 72px; height: 72px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.preview-services { display: grid; gap: 1rem; margin: 1.25rem 0; }
.preview-service { border-top: 1px solid var(--line); padding-top: 1rem; }
.contact-row { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--muted); margin-bottom: 1.25rem; }
.empty-state { text-align: center; }
.legal-card p { color: var(--muted); }
.d-none { display: none !important; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.is-loading { opacity: 0.7; pointer-events: none; }

@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual {
    min-height: 220px;
    max-height: 34vh;
  }
  .auth-visual__copy {
    padding: 1.4rem 1.25rem;
    max-width: none;
  }
  .auth-visual__title { font-size: 1.45rem; }
  .auth-visual__text { display: none; }
  .auth-side { min-height: auto; border-left: 0; }
  .auth-side__main {
    max-width: 36rem;
    padding: 1rem 1.25rem 2rem;
  }
}

@media (max-width: 768px) {
  .input-row, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .panel-top { flex-direction: column; align-items: flex-start; }
  .wizard-progress { grid-template-columns: 1fr; }
  .code-digit { width: 2.6rem; height: 2.8rem; }
  .panel-main, .wizard-progress { width: min(100% - 1.25rem, 920px); }
  .auth-row { align-items: flex-start; flex-direction: column; }
}
