/* Premium modal styling — applies to any modal-overlay that also has
 * the .modal-premium-dark class. The base .modal-overlay rules from
 * style.css still apply; this file layers on top with:
 *   · radial darkened backdrop + stronger blur
 *   · gradient accent strip on top of the card
 *   · spring-in entrance animation
 *   · refined form fields (label / input / checkbox)
 *   · gradient submit button with lift + press feedback
 *
 * Scoped to .modal-premium-dark so the older / unstyled modal pop-ups
 * keep their current look. Add the class to any new modal to opt in.
 */

/* ── Backdrop ─────────────────────────────────────────────────────── */

.modal-premium-dark {
  background: radial-gradient(
    ellipse at center,
    rgba(15, 23, 42, .55) 0%,
    rgba(2, 6, 23, .82) 70%
  );
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  animation: modalPremiumFade .25s cubic-bezier(.22, 1, .36, 1);
}

@keyframes modalPremiumFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Card ─────────────────────────────────────────────────────────── */

/* Prefix with .modal-overlay so this beats the base style.css rule
 * even when the user's theme is dark and CSS variables resolve dark. */
.modal-overlay.modal-premium-dark .modal-content,
.modal-premium-dark .modal-content {
  position: relative;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfaf8 100%) !important;
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 22px;
  padding: 28px 28px 24px;
  max-width: 520px;
  color: #0f172a;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .9) inset,
    0 30px 70px -20px rgba(15, 23, 42, .35),
    0 8px 24px -8px rgba(249, 115, 22, .18);
  animation: modalPremiumIn .42s cubic-bezier(.22, 1.18, .36, 1);
  transform-origin: center 60%;
}

/* Gradient accent strip at the top of the card. */
.modal-premium-dark .modal-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 3px;
  background: linear-gradient(90deg, #F97316 0%, #FB923C 50%, #FDBA74 100%);
  border-radius: 3px;
  opacity: .9;
}

/* Soft warm highlight on the top edge for depth. */
.modal-premium-dark .modal-content::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 80px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(249, 115, 22, .04), transparent);
  border-radius: 22px 22px 0 0;
}

@keyframes modalPremiumIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.96);
  }
  60% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Header ───────────────────────────────────────────────────────── */

.modal-premium-dark .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(15, 23, 42, .07);
}

.modal-premium-dark .modal-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.3px;
  color: #0f172a;
  background: linear-gradient(180deg, #1e293b 0%, #475569 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Optional subtitle under the title (markup hook: span.modal-subtitle). */
.modal-premium-dark .modal-subtitle {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 500;
  color: #64748b;
  -webkit-text-fill-color: #64748b;
  letter-spacing: 0;
}

/* Close button — works whether the markup provides one or not. */
.modal-premium-dark .modal-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .04);
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 999px;
  color: #64748b;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s, transform .12s, border-color .15s;
}
.modal-premium-dark .modal-close:hover {
  background: rgba(249, 115, 22, .1);
  border-color: rgba(249, 115, 22, .3);
  color: #ea580c;
}
.modal-premium-dark .modal-close:active {
  transform: scale(.92);
}

/* ── Form labels + inputs ─────────────────────────────────────────── */

.modal-premium-dark .form-group {
  margin-bottom: 18px;
}

.modal-premium-dark .form-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
}

.modal-overlay.modal-premium-dark .form-input,
.modal-premium-dark .form-input {
  padding: 13px 16px;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px;
  font-size: 14px;
  color: #0f172a !important;
  transition: background .18s, border-color .18s, box-shadow .18s, transform .18s;
}
.modal-premium-dark .form-input:hover:not(:focus) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.modal-premium-dark .form-input:focus {
  outline: none;
  background: #fff7ed;
  border-color: rgba(249, 115, 22, .6);
  box-shadow:
    0 0 0 4px rgba(249, 115, 22, .12),
    0 4px 14px -6px rgba(249, 115, 22, .35);
  transform: translateY(-1px);
}
.modal-premium-dark .form-input::placeholder {
  color: #94a3b8;
}

/* Textareas keep the same skin. */
.modal-premium-dark textarea.form-input {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

/* ── File input — modern dropzone-style ──────────────────────────── */

.modal-premium-dark input[type="file"] {
  width: 100%;
  padding: 16px 18px;
  background:
    linear-gradient(135deg, rgba(249, 115, 22, .04), rgba(249, 115, 22, .02)),
    #ffffff;
  border: 1.5px dashed rgba(249, 115, 22, .35);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s, box-shadow .2s;
}

.modal-premium-dark input[type="file"]:hover {
  border-color: rgba(249, 115, 22, .6);
  background:
    linear-gradient(135deg, rgba(249, 115, 22, .08), rgba(249, 115, 22, .04)),
    #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -8px rgba(249, 115, 22, .35);
}

.modal-premium-dark input[type="file"]:focus {
  outline: none;
  border-color: var(--primary, #F97316);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .15);
}

/* The native "Choose File" button inside the input — Chromium/Firefox
 * exposes it via this pseudo-element. Replace it with a pill button
 * that matches the primary action style. */
.modal-premium-dark input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #F97316 0%, #FB923C 100%);
  border: none;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px -4px rgba(249, 115, 22, .55);
  transition: filter .15s, transform .12s;
}

.modal-premium-dark input[type="file"]::file-selector-button:hover {
  filter: brightness(1.08);
}

.modal-premium-dark input[type="file"]::file-selector-button:active {
  transform: scale(.96);
}

/* WebKit legacy pseudo (older Safari). */
.modal-premium-dark input[type="file"]::-webkit-file-upload-button {
  margin-right: 12px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #F97316 0%, #FB923C 100%);
  border: none;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}

/* When the file input sits next to a preview image (the markup uses a
 * flex row with the <img> + the <input> wrapper), make the wrapper
 * fill the remaining width nicely. */
.modal-premium-dark input[type="file"][id$="-image-file"] + small,
.modal-premium-dark .form-group small {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
}

/* ── Checkbox (modern check) ──────────────────────────────────────── */

.modal-premium-dark input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  position: relative;
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .12s;
}
.modal-premium-dark input[type="checkbox"]:hover {
  border-color: rgba(249, 115, 22, .55);
}
.modal-premium-dark input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #F97316, #FB923C);
  border-color: transparent;
  box-shadow: 0 4px 14px -4px rgba(249, 115, 22, .55);
}
.modal-premium-dark input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: no-repeat center / 14px 14px url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
}
.modal-premium-dark input[type="checkbox"]:active {
  transform: scale(.92);
}

/* When a label sits next to a checkbox in a row (common pattern in
 * this app — opinion-config-toggle, Activo, etc.).
 */
.modal-premium-dark .form-group:has(> input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.modal-premium-dark .form-group:has(> input[type="checkbox"]) > .form-label {
  margin: 0;
  flex: 1;
  text-transform: none;
  font-size: 14px;
  letter-spacing: 0;
  font-weight: 600;
  color: #1e293b;
}

/* ── Submit / primary button at the bottom ────────────────────────── */

.modal-premium-dark .btn-primary,
.modal-premium-dark button.btn-primary[type="submit"] {
  width: 100%;
  margin-top: 8px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #F97316 0%, #FB923C 100%);
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
  cursor: pointer;
  box-shadow:
    0 8px 22px -10px rgba(249, 115, 22, .55),
    0 1px 0 rgba(255, 255, 255, .15) inset;
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.modal-premium-dark .btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow:
    0 14px 28px -10px rgba(249, 115, 22, .7),
    0 1px 0 rgba(255, 255, 255, .2) inset;
}
.modal-premium-dark .btn-primary:active {
  transform: translateY(0) scale(.98);
  filter: brightness(.96);
}
.modal-premium-dark .btn-primary:disabled {
  filter: grayscale(.4);
  cursor: not-allowed;
  transform: none;
}

/* Secondary button (Cancelar, etc.) gets a softer treatment. */
.modal-premium-dark .btn-secondary {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  transition: background .15s, border-color .15s, color .15s;
}
.modal-premium-dark .btn-secondary:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

/* When the markup wraps the bottom buttons in a row, give them a tidy
 * top border + gap so they look like a footer.
 */
.modal-premium-dark .modal-footer,
.modal-premium-dark form > .modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, .07);
}
.modal-premium-dark .modal-footer > .btn,
.modal-premium-dark form > .modal-actions > .btn {
  flex: 1;
  margin-top: 0;
}

/* ── Reduced motion + small screens ───────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .modal-premium-dark { animation: none; }
  .modal-premium-dark .modal-content { animation: none; }
  .modal-premium-dark .form-input:focus { transform: none; }
}

@media (max-width: 540px) {
  .modal-premium-dark .modal-content {
    padding: 22px 20px 20px;
    border-radius: 18px;
  }
  .modal-premium-dark .modal-title { font-size: 18px; }
}
