/* Estilos específicos de la página Ajustes */

#settingsStatus {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  min-height: 1.4rem;
  font-weight: 500;
}

.preferences-form {
  display: grid;
  gap: 1.1rem;
}

.preference-group {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.1rem 1.25rem;
  display: grid;
  gap: 1rem;
}

.preference-group h3 {
  margin: 0;
  font-size: 1.05rem;
}

.preference-group p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.preference-group__header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.preference-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .preference-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

.setting-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.03);
}

.setting-toggle input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--accent);
}

.setting-toggle__content span {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
}

.setting-toggle__content p {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tier-editor {
  display: grid;
  gap: 0.85rem;
}

.tier-row {
  display: grid;
  grid-template-columns: minmax(0, 110px) repeat(2, minmax(0, 1fr)) minmax(0, 92px);
  gap: 0.85rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.03);
  align-items: center;
}

.tier-row--unlimited {
  border-style: dashed;
  background: rgba(241, 196, 15, 0.08);
}

.tier-row__badge {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.tier-row__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tier-row__field--wide {
  grid-column: span 2;
}

.tier-row__label {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.tier-row__helper {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tier-row__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.tier-row__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(241, 196, 15, 0.18);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
}

.tier-editor__footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .tier-editor__footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  .tier-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .tier-row__actions {
    justify-content: flex-start;
  }
}

.icon-button {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: transparent;
  color: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, border 0.2s ease, color 0.2s ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(241, 196, 15, 0.14);
  border-color: rgba(241, 196, 15, 0.45);
  color: var(--accent);
  outline: none;
}

.preference-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.link-button {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.link-button:hover,
.link-button:focus-visible {
  color: var(--accent-strong);
  outline: none;
}

body[data-theme="light"] .setting-toggle,
html[data-theme="light"] body .setting-toggle {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .tier-row,
html[data-theme="light"] body .tier-row {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .tier-row--unlimited,
html[data-theme="light"] body .tier-row--unlimited {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.35);
}

body[data-theme="light"] .tier-row__badge,
html[data-theme="light"] body .tier-row__badge {
  color: #b45309;
}

body[data-theme="light"] .tier-row__tag,
html[data-theme="light"] body .tier-row__tag {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

body[data-theme="light"] .icon-button:hover,
body[data-theme="light"] .icon-button:focus-visible,
html[data-theme="light"] body .icon-button:hover,
html[data-theme="light"] body .icon-button:focus-visible {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.4);
  color: #b45309;
}

body.theme-high-contrast .setting-toggle,
html.theme-high-contrast body .setting-toggle {
  border-color: rgba(241, 196, 15, 0.45);
  background: rgba(10, 12, 18, 0.9);
}

body.theme-high-contrast .tier-row,
html.theme-high-contrast body .tier-row {
  border-color: rgba(241, 196, 15, 0.4);
  background: rgba(10, 12, 18, 0.88);
}

body.theme-high-contrast .tier-row--unlimited,
html.theme-high-contrast body .tier-row--unlimited {
  background: rgba(241, 196, 15, 0.22);
}
