/* ============================================================
   Jewel MU — Panel editar perfil (secciones + efectos)
   ============================================================ */

.sp-edit-panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(240, 165, 0, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(22, 24, 31, 0.98) 0%, rgba(17, 19, 24, 0.99) 100%);
  border: 1px solid rgba(240, 165, 0, 0.12);
  border-top: none;
  padding: 0 clamp(16px, 2.5vw, 32px) 28px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sp-edit-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 165, 0, 0.45), transparent);
  pointer-events: none;
}

.sp-edit-panel.is-visible .sp-edit-section {
  animation: spEditSectionIn 0.55s ease backwards;
}

.sp-edit-panel.is-visible .sp-edit-section:nth-child(1) { animation-delay: 0.04s; }
.sp-edit-panel.is-visible .sp-edit-section:nth-child(2) { animation-delay: 0.09s; }
.sp-edit-panel.is-visible .sp-edit-section:nth-child(3) { animation-delay: 0.14s; }
.sp-edit-panel.is-visible .sp-edit-section:nth-child(4) { animation-delay: 0.19s; }
.sp-edit-panel.is-visible .sp-edit-section:nth-child(5) { animation-delay: 0.24s; }

@keyframes spEditSectionIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hero */
.sp-edit-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 20px;
  padding: 22px 0 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sp-edit-hero-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.sp-edit-hero-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(240, 165, 0, 0.18), rgba(240, 165, 0, 0.05));
  border: 1px solid rgba(240, 165, 0, 0.25);
  box-shadow: 0 0 24px rgba(240, 165, 0, 0.12);
}

.sp-edit-hero-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sp-edit-hero-sub {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.45;
}

.sp-edit-store-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-2);
  text-decoration: none;
  background: rgba(240, 165, 0, 0.08);
  border: 1px solid rgba(240, 165, 0, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sp-edit-store-pill:hover {
  transform: translateY(-2px);
  background: rgba(240, 165, 0, 0.14);
  box-shadow: 0 8px 24px rgba(240, 165, 0, 0.18);
  color: var(--gold);
}

/* Sections */
.sp-edit-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sp-edit-section {
  position: relative;
  padding: 18px 18px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.sp-edit-section:hover {
  border-color: rgba(240, 165, 0, 0.14);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.sp-edit-section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.sp-edit-section-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  border-radius: 11px;
  background: var(--card-3);
  border: 1px solid var(--border-2);
}

.sp-edit-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.sp-edit-section-desc {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--text-3);
  line-height: 1.45;
  max-width: 52ch;
}

/* Grid & fields */
.sp-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.sp-edit-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.sp-edit-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.sp-edit-field--full { grid-column: 1 / -1; }

.sp-edit-field-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.sp-edit-lbl {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.01em;
  text-transform: none;
}

.sp-required { color: var(--red-2); }

.sp-input--glow {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sp-input--glow:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
}

.sp-input--glow:focus {
  border-color: rgba(240, 165, 0, 0.55);
  box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.12), 0 0 20px rgba(240, 165, 0, 0.08);
}

.sp-textarea.sp-input--glow { min-height: 96px; line-height: 1.5; }

.sp-edit-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--text-3);
  line-height: 1.45;
  margin: 0;
}

.sp-edit-hint-icon { flex-shrink: 0; opacity: 0.85; }

.sp-edit-static {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
}

/* Inline visibility toggle (per field) */
.sp-field-visibility {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.sp-field-visibility-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.sp-field-visibility-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.sp-field-visibility-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-3);
  transition: transform 0.22s ease, background 0.22s ease;
}

.sp-field-visibility-input:checked + .sp-field-visibility-track {
  background: rgba(240, 165, 0, 0.35);
  border-color: rgba(240, 165, 0, 0.5);
  box-shadow: 0 0 12px rgba(240, 165, 0, 0.2);
}

.sp-field-visibility-input:checked + .sp-field-visibility-track .sp-field-visibility-thumb {
  transform: translateX(14px);
  background: var(--gold-2);
}

.sp-field-visibility-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
}

.sp-field-visibility-input:checked ~ .sp-field-visibility-text {
  color: var(--gold-2);
}

/* File upload drops */
.sp-file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 118px;
  padding: 18px 16px;
  border-radius: 14px;
  border: 1.5px dashed rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.12));
  cursor: pointer;
  text-align: center;
  transition: border-color 0.22s ease, background 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.sp-file-drop:hover,
.sp-file-drop:focus-within {
  border-color: rgba(240, 165, 0, 0.45);
  background: rgba(240, 165, 0, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.sp-file-drop--wide { min-height: 118px; }

.sp-file-drop-icon {
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.sp-file-drop-text {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}

.sp-file-drop-hint {
  font-size: 0.72rem;
  color: var(--text-3);
}

.sp-file-drop-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.sp-file-drop.has-file {
  border-style: solid;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.06);
}

.sp-file-chosen {
  font-size: 0.76rem;
  color: var(--online);
  font-weight: 600;
  word-break: break-all;
}

/* Header toggle cards */
.sp-edit-section--header-flags {
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, rgba(240, 165, 0, 0.06), transparent 50%),
    rgba(255, 255, 255, 0.02);
}

.sp-header-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.sp-header-toggle-card {
  position: relative;
  display: block;
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
}

.sp-header-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.sp-header-toggle-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at 30% 30%, rgba(240, 165, 0, 0.2), transparent 65%);
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.sp-header-toggle-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  min-height: 56px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  transition: border-color 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.sp-header-toggle-card:hover .sp-header-toggle-inner {
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.sp-header-toggle-card.is-on .sp-header-toggle-inner,
.sp-header-toggle-input:checked ~ .sp-header-toggle-inner {
  border-color: rgba(240, 165, 0, 0.35);
  background: rgba(240, 165, 0, 0.07);
}

.sp-header-toggle-card.is-on .sp-header-toggle-glow,
.sp-header-toggle-input:checked ~ .sp-header-toggle-glow {
  opacity: 1;
}

.sp-header-toggle-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  border-radius: 9px;
  background: var(--card-3);
}

.sp-header-toggle-label {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-2);
  line-height: 1.3;
}

.sp-header-toggle-card.is-on .sp-header-toggle-label,
.sp-header-toggle-input:checked ~ .sp-header-toggle-inner .sp-header-toggle-label {
  color: var(--text);
}

.sp-header-toggle-switch {
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  transition: background 0.22s ease;
}

.sp-header-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-3);
  transition: transform 0.22s ease, background 0.22s ease;
}

.sp-header-toggle-input:checked ~ .sp-header-toggle-inner .sp-header-toggle-switch {
  background: rgba(240, 165, 0, 0.4);
}

.sp-header-toggle-input:checked ~ .sp-header-toggle-inner .sp-header-toggle-knob {
  transform: translateX(16px);
  background: var(--gold-2);
}

/* Privacy checkbox card */
.sp-check-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
  height: 100%;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.sp-check-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.sp-check-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sp-check-card-box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.sp-check-card input:checked + .sp-check-card-box {
  background: var(--gold);
  border-color: var(--gold);
}

.sp-check-card input:checked + .sp-check-card-box::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 900;
  color: #0d0f14;
}

.sp-check-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sp-check-card-text strong {
  font-size: 0.84rem;
  color: var(--text);
}

.sp-check-card-text small {
  font-size: 0.74rem;
  color: var(--text-3);
  line-height: 1.4;
}

/* Actions */
.sp-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sp-btn-save {
  min-width: 180px;
  padding: 11px 22px;
  box-shadow: 0 4px 18px rgba(240, 165, 0, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.sp-btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(240, 165, 0, 0.35);
}

@media (max-width: 768px) {
  .sp-edit-grid,
  .sp-edit-grid--2 {
    grid-template-columns: 1fr;
  }

  .sp-edit-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .sp-edit-store-pill {
    justify-content: center;
  }

  .sp-header-toggle-grid {
    grid-template-columns: 1fr;
  }
}
