/* ── config-form ── estilo unificado (referencia: redactor-form) ── */

.cs-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px;
  align-items: start;
  padding: 28px;
}

/* ── Main ── */
.cs-main {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Secciones ── */
.cs-section {
  padding: 24px 0;
  border-bottom: 1px solid #DDE2DC;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dark .cs-section { border-color: #2C3040; }
.cs-section:first-child { padding-top: 0; }
.cs-section:last-child  { border-bottom: none; padding-bottom: 0; }

.cs-section__title {
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #0099BB;
  margin: 0;
  padding-bottom: 4px;
  border-bottom: 1px solid #DDE2DC;
}
.dark .cs-section__title { color: #00C4E0; border-color: #2C3040; }

.cs-section__desc {
  font-size: 0.8rem;
  color: #5A6478;
  margin: -4px 0 0;
  line-height: 1.6;
}
.dark .cs-section__desc { color: #8A92A8; }
.cs-section__desc code {
  font-size: 0.78rem;
  background: #E9ECE7;
  padding: 1px 5px;
  border-radius: 4px;
  color: #5A6478;
}
.dark .cs-section__desc code { background: #242830; color: #8A92A8; }

/* ── Bloque identidad: logo + nombre/slogan (patrón redactor) ── */
.cs-identity {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  align-items: start;
}

.cs-identity__photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.cs-identity__hint {
  font-size: 0.72rem;
  color: #8F9BAD;
  text-align: center;
  margin: 0;
  line-height: 1.4;
}
.cs-identity__hint span {
  font-size: 0.65rem;
  color: #adb5c0;
}

.cs-identity__fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
}

/* ── Grupos de campo ── */
.cs-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cs-label {
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #5A6478;
}
.dark .cs-label { color: #8A92A8; }

.cs-required { color: #D94343; }
.cs-error    { font-size: 0.72rem; color: #D94343; margin: 0; }

.cs-hint {
  font-size: 0.72rem;
  color: #8F9BAD;
  line-height: 1.4;
}

.cs-errors {
  margin: 0 0 16px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #7f1d1d;
  font-size: 0.84rem;
}

/* ── Inputs ── */
.cs-layout input[type="text"],
.cs-layout input[type="email"],
.cs-layout input[type="url"],
.cs-layout textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #DDE2DC;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  background: #FFFFFF;
  color: #1A1F2E;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.cs-layout input:focus,
.cs-layout textarea:focus {
  border-color: #0099BB;
  box-shadow: 0 0 0 3px rgba(0,153,187,.12);
}
.dark .cs-layout input[type="text"],
.dark .cs-layout input[type="email"],
.dark .cs-layout input[type="url"],
.dark .cs-layout textarea {
  background: #1C1F27;
  border-color: #2C3040;
  color: #E8EAF0;
}
.cs-layout textarea { resize: vertical; }

/* ── File picker Google Search Console ── */
.cs-file-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Estado: archivo cargado */
.cs-file-picker__loaded {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, #0099BB 30%, #DDE2DC);
  border-radius: 10px;
  background: color-mix(in srgb, #0099BB 5%, #fff);
  color: #1A1F2E;
}
.dark .cs-file-picker__loaded {
  background: color-mix(in srgb, #0099BB 8%, #1C1F27);
  border-color: color-mix(in srgb, #0099BB 30%, #2C3040);
  color: #E8EAF0;
}
.cs-file-picker__loaded svg { color: #0099BB; flex-shrink: 0; }

.cs-file-picker__name {
  flex: 1;
  font-size: 0.84rem;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-file-picker__badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0099BB;
  background: color-mix(in srgb, #0099BB 12%, transparent);
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

.cs-file-picker__clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #D94343;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background .15s;
}
.cs-file-picker__clear:hover { background: #fef2f2; }

/* Estado: vacío / drop zone */
.cs-file-picker__drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 20px;
  border: 2px dashed #DDE2DC;
  border-radius: 10px;
  text-align: center;
  transition: border-color .2s, background .2s;
  cursor: default;
}
.cs-file-picker__drop--over {
  border-color: #0099BB;
  background: color-mix(in srgb, #0099BB 4%, #fff);
}
.dark .cs-file-picker__drop {
  border-color: #2C3040;
  background: transparent;
}
.dark .cs-file-picker__drop--over {
  border-color: #0099BB;
  background: color-mix(in srgb, #0099BB 6%, #1C1F27);
}
.cs-file-picker__drop svg { color: #8F9BAD; }

.cs-file-picker__drop-text {
  font-size: 0.84rem;
  color: #5A6478;
  margin: 0;
}
.dark .cs-file-picker__drop-text { color: #8A92A8; }

.cs-file-picker__btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border: 1px solid #DDE2DC;
  border-radius: 8px;
  background: #fff;
  color: #1A1F2E;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.cs-file-picker__btn:hover {
  border-color: #0099BB;
  color: #0099BB;
  background: color-mix(in srgb, #0099BB 4%, #fff);
}
.dark .cs-file-picker__btn {
  background: #1C1F27;
  border-color: #2C3040;
  color: #E8EAF0;
}
.dark .cs-file-picker__btn:hover {
  border-color: #0099BB;
  color: #0099BB;
}

.cs-file-picker__drop-hint {
  font-size: 0.72rem;
  color: #8F9BAD;
  margin: 0;
}
.cs-file-picker__drop-hint code {
  font-size: 0.72rem;
  background: #E9ECE7;
  padding: 1px 4px;
  border-radius: 4px;
  color: #5A6478;
}
.dark .cs-file-picker__drop-hint code { background: #242830; color: #8A92A8; }

/* ── Rail ── */
.cs-rail {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 20px;
  background: #FFFFFF;
  border: 1px solid #DDE2DC;
  border-radius: 12px;
  padding: 16px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.dark .cs-rail { background: #1C1F27; border-color: #2C3040; }

.cs-rail__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #DDE2DC;
}
.dark .cs-rail__section { border-color: #2C3040; }

.cs-rail__label {
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0099BB;
  margin: 0;
}
.dark .cs-rail__label { color: #00C4E0; }

/* ── Botones al fondo ── */
.cs-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 20px;
  margin-top: 4px;
  border-top: 1px solid #DDE2DC;
  flex-wrap: wrap;
}
.dark .cs-bottom { border-color: #2C3040; }

.cs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  line-height: 1;
  transition: opacity .15s, background .15s;
  white-space: nowrap;
}
.cs-btn--primary { background: #0099BB; color: #fff; }
.cs-btn--primary:hover { opacity: .88; }
.cs-btn--ghost {
  background: transparent;
  color: #5A6478;
  border: 1px solid #DDE2DC;
}
.cs-btn--ghost:hover { background: #E9ECE7; color: #1A1F2E; }
.dark .cs-btn--ghost { border-color: #2C3040; color: #8A92A8; }
.dark .cs-btn--ghost:hover { background: #242830; color: #E8EAF0; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .cs-layout {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    gap: 24px;
  }
  .cs-rail {
    position: static;
    max-height: none;
    order: -1;
  }
  .cs-rail__section { flex-direction: row; flex-wrap: wrap; gap: 12px 24px; }
  .cs-rail__section .cs-group { min-width: 180px; flex: 1; }
}

@media (max-width: 700px) {
  .cs-identity {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .cs-identity__photo { flex-direction: row; align-items: center; }
  .cs-identity__hint  { text-align: left; }
  .cs-bottom { flex-direction: column; align-items: stretch; }
  .cs-btn { width: 100%; padding: 12px 24px; }
  .cs-rail__section { flex-direction: column; }
}