/* ==========================================================================
   Hotel San Luis Copiapó — Dark Mode Architectural Palette (#0d1124 / #151b35)
   ========================================================================== */

.theme-toggle {
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(217, 211, 204, 0.5);
}

.theme-sun { display: none; }
html[data-theme="dark"] .theme-moon { display: none; }
html[data-theme="dark"] .theme-sun { display: block; }

html[data-theme="dark"] {
  --paper: #0d1124;
  --surface-card: #151b35;
  --surface-subtle: #10152c;
  --surface-tint: #1d2546;
  --ink: #f3f6fd;
  --muted: #b3bdd9;
  --line: rgba(217, 211, 204, 0.14);
  --line-strong: rgba(217, 211, 204, 0.28);
  --gold-sand: #D9D3CC;
  --dark-panel: #151b35;
  --dark-raised: #1d2547;
  color-scheme: dark;
}

html[data-theme="dark"] body,
html[data-theme="dark"] body.circuit-bg {
  background: var(--paper);
  color: var(--ink);
}

html[data-theme="dark"] body nav.fixed {
  background: rgba(11, 15, 34, 0.9);
  border-bottom-color: rgba(217, 211, 204, 0.22);
}

html[data-theme="dark"] body .glass-panel,
html[data-theme="dark"] body .glass-panel-navy,
html[data-theme="dark"] body #cotizador,
html[data-theme="dark"] body .modal-overlay .glass-panel {
  background: var(--surface-card);
  border-color: var(--line);
}

html[data-theme="dark"] body #node-details {
  background: var(--surface-card);
  border-color: var(--line);
}

html[data-theme="dark"] body main > section:nth-child(2) > .grid > div {
  background: var(--surface-card);
  border-color: var(--line);
}

html[data-theme="dark"] body #impacto {
  background: linear-gradient(135deg, #102026 0%, #142632 100%);
  border-color: rgba(86, 178, 118, 0.26);
}

html[data-theme="dark"] body #impacto [class*="bg-surface-container-lowest/"] {
  background: rgba(13, 17, 36, 0.65);
  border-color: rgba(86, 178, 118, 0.2);
}

html[data-theme="dark"] body #cotizador > .absolute {
  background: rgba(217, 211, 204, 0.12);
  border-color: rgba(217, 211, 204, 0.35);
  color: var(--brand-gold);
}

html[data-theme="dark"] body #cotizador label:has(input[type="checkbox"]) {
  background: var(--surface-subtle);
  border-color: var(--line);
}

html[data-theme="dark"] body #cotizador label:has(input[type="checkbox"]):hover {
  background: var(--dark-raised);
  border-color: rgba(217, 211, 204, 0.45);
}

html[data-theme="dark"] body #cotizador label:has(input[type="checkbox"]:checked) {
  background: rgba(217, 211, 204, 0.1);
  border-color: var(--brand-gold);
}

html[data-theme="dark"] body .text-secondary,
html[data-theme="dark"] body .text-secondary.text-xs,
html[data-theme="dark"] body .text-secondary.text-\[10px\],
html[data-theme="dark"] body .text-secondary.text-\[11px\] {
  color: var(--brand-gold);
}

html[data-theme="dark"] body .text-glow-cyan { color: #82c8ff; }
html[data-theme="dark"] body .text-tertiary { color: #7ee3a2; }

html[data-theme="dark"] body input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] body select,
html[data-theme="dark"] body textarea {
  background-color: #0e1329 !important;
  border-color: rgba(217, 211, 204, 0.26);
  color: var(--ink);
}

html[data-theme="dark"] body input:not([type="checkbox"]):not([type="radio"]):focus,
html[data-theme="dark"] body select:focus,
html[data-theme="dark"] body textarea:focus {
  border-color: var(--brand-gold) !important;
  box-shadow: 0 0 0 4px rgba(217, 211, 204, 0.16);
}

html[data-theme="dark"] body input::placeholder,
html[data-theme="dark"] body textarea::placeholder {
  color: #8f9abc;
}

html[data-theme="dark"] body a[class*="bg-gradient-to-r"],
html[data-theme="dark"] body button[class*="bg-gradient-to-r"],
html[data-theme="dark"] body .bg-secondary {
  background: linear-gradient(135deg, #D9D3CC 0%, #D9D3CC 100%);
  border-color: rgba(255, 234, 184, 0.65);
  color: var(--brand-navy-deep);
}

html[data-theme="dark"] body a[class*="bg-gradient-to-r"] .text-slate-950,
html[data-theme="dark"] body button[class*="bg-gradient-to-r"] .text-slate-950,
html[data-theme="dark"] body a[class*="bg-gradient-to-r"] .material-symbols-outlined,
html[data-theme="dark"] body button[class*="bg-gradient-to-r"] .material-symbols-outlined {
  color: var(--brand-navy-deep);
}

html[data-theme="dark"] body a[class*="bg-gradient-to-r"] img,
html[data-theme="dark"] body button[class*="bg-gradient-to-r"] img {
  filter: brightness(0);
}

html[data-theme="dark"] body a[class*="bg-gradient-to-r"]:hover,
html[data-theme="dark"] body button[class*="bg-gradient-to-r"]:hover,
html[data-theme="dark"] body .bg-secondary:hover {
  background: linear-gradient(135deg, #D9D3CC 0%, #D9D3CC 100%);
}

html[data-theme="dark"] body select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23e6bd6e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

html[data-theme="dark"] body .filter.invert {
  filter: brightness(0) invert(1);
}

html[data-theme="dark"] body .modal-overlay {
  background: rgba(6, 9, 20, 0.82);
}

/* Dark Mode Survey Overrides */
html[data-theme="dark"] .survey-section-legend {
  color: var(--brand-gold);
}

html[data-theme="dark"] .survey-circle-option span {
  background: #0f152e;
  border-color: rgba(217, 211, 204, 0.3);
  color: var(--ink);
}

html[data-theme="dark"] .survey-circle-option input[type="radio"]:checked + span {
  background: var(--brand-gold);
  border-color: var(--brand-gold);
  color: var(--brand-navy-deep);
}

html[data-theme="dark"] .survey-circle-option input[value="0"]:checked + span,
html[data-theme="dark"] .survey-circle-option input[value="1"]:checked + span {
  background: #e0524f;
  border-color: #e0524f;
  color: #ffffff;
}

html[data-theme="dark"] .survey-circle-option input[value="6"]:checked + span,
html[data-theme="dark"] .survey-circle-option input[value="7"]:checked + span {
  background: #3aa568;
  border-color: #3aa568;
  color: #ffffff;
}

html[data-theme="dark"] .survey-failure-panel {
  background: rgba(200, 62, 59, 0.14);
  border-color: rgba(224, 82, 79, 0.45);
}

html[data-theme="dark"] .survey-failure-head {
  color: #ffb8b5;
}

html[data-theme="dark"] .survey-source-dot {
  border-color: rgba(217, 211, 204, 0.45);
}

html[data-theme="dark"] .survey-source-card:has(input:checked) {
  border-color: var(--brand-gold);
  background: rgba(217, 211, 204, 0.12);
}

html[data-theme="dark"] .survey-source-card:has(input:checked) .survey-source-dot {
  border-color: var(--brand-gold);
  background: var(--brand-gold);
  box-shadow: inset 0 0 0 3.5px #151b35;
}

html[data-theme="dark"] .survey-btn-primary {
  background: linear-gradient(135deg, #D9D3CC 0%, #D9D3CC 100%);
  border-color: rgba(255, 234, 184, 0.65);
  color: var(--brand-navy-deep);
}

html[data-theme="dark"] .survey-delivery-status.is-sent {
  color: #8ee6ae;
}

html[data-theme="dark"] .survey-error-banner {
  background: rgba(200, 62, 59, 0.18);
  color: #ffc2c0;
}

html[data-theme="dark"] body .chat-button-label,
html[data-theme="dark"] body .skip-link {
  background: var(--brand-gold);
  color: var(--brand-navy-deep);
}

@media (max-width: 1439px) {
  .theme-toggle-label { display: none; }
  .theme-toggle { padding: 0; width: 40px; }
  body nav #btn-open-cms {
    font-size: 0;
    gap: 0;
    width: 40px;
    padding-inline: 0;
    justify-content: center;
  }
}
