/* ========================================================
   MODAL COMPOSITOR & FORMULARIOS - LIVE ECHOES
   Diseño minimalista estilo Linear / Threads (Sin elementos IA)
   ======================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.composer-window {
  width: 100%;
  max-width: 520px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px);
  transition: transform var(--transition-normal);
}

.modal-backdrop.active .composer-window {
  transform: translateY(0);
}

.composer-header {
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.composer-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-xs);
  transition: color var(--transition-fast);
}

.btn-close-modal:hover {
  color: var(--text-primary);
}

.composer-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(85vh - 120px);
  overflow-y: auto;
}

/* Textarea limpia */
.textarea-group {
  position: relative;
}

.confession-textarea {
  width: 100%;
  min-height: 110px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast);
}

.confession-textarea:focus {
  border-color: var(--border-strong);
}

.char-counter {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

/* Selector de Tonos Mate */
.theme-selector-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.themes-carousel {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.theme-circle:hover {
  transform: scale(1.1);
}

.theme-circle.active {
  border-color: var(--accent-white);
  transform: scale(1.15);
}

.theme-circle.theme-midnight { background-color: var(--card-theme-charcoal); }
.theme-circle.theme-cyberpunk { background-color: var(--card-theme-navy); }
.theme-circle.theme-crimson { background-color: var(--card-theme-wine); }
.theme-circle.theme-emerald { background-color: var(--card-theme-forest); }
.theme-circle.theme-aurora { background-color: var(--card-theme-slate); }
.theme-circle.theme-obsidian { background-color: var(--bg-surface-elevated); }

/* Switch de Modo Spoiler (Limpio y sutil) */
.spoiler-toggle-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.spoiler-toggle-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.spoiler-icon-badge {
  font-size: 1.15rem;
  color: var(--text-secondary);
}

.spoiler-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.spoiler-desc {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-medium);
  transition: .2s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-primary);
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-white);
}

input:checked + .slider:before {
  transform: translateX(18px);
  background-color: var(--accent-black);
}

/* Categoría y Duración */
.form-row-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.custom-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.custom-select:focus {
  border-color: var(--border-strong);
}

/* Subida de Imagen */
.image-upload-dropzone {
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg-input);
  transition: border-color var(--transition-fast);
}

.image-upload-dropzone:hover {
  border-color: var(--border-strong);
}

.dropzone-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.preview-container {
  position: relative;
  margin-top: 0.4rem;
  display: none;
}

.preview-img {
  max-height: 120px;
  border-radius: var(--radius-xs);
  object-fit: cover;
}

.btn-remove-image {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.75);
  border: none;
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
}

/* Aviso de Privacidad Guardián (Discreto) */
.guardian-notice {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.6rem 0.75rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Pie del Composer */
.composer-footer {
  padding: 0.85rem 1.25rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.btn-submit-confession {
  background: var(--accent-white);
  border: none;
  color: var(--accent-black);
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: opacity var(--transition-fast);
}

.btn-submit-confession:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-submit-confession:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
