/* ============================================================================
   J.A.R.V.I.S. · Definições e avisos
   ----------------------------------------------------------------------------
   A folha de vidro das Definições (cada secção é um cartão) e o toast.
   ========================================================================== */

/* ===== Definições ===== */
.settings {
  position: fixed;
  inset: 0;
  background: rgba(6, 3, 20, 0.42);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  z-index: 50;
  display: flex;
  justify-content: flex-end;
}
.settings-sheet {
  width: min(440px, 100%);
  height: 100%;
  background: var(--glass);
  background-size: 160px 160px, cover;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-left: 1px solid var(--edge);
  box-shadow: -24px 0 70px rgba(4, 2, 16, 0.5), inset 1px 0 0 rgba(255, 255, 255, 0.3);
  overflow-y: auto;
  padding: calc(16px + var(--safe-top)) 18px calc(30px + var(--safe-bottom));
  animation: slideIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes slideIn {
  from { transform: translateX(48px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding: 0 4px;
}
.settings h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}
.settings h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--violet-hi);
  text-transform: uppercase;
  margin-bottom: 14px;
  border-bottom: none;
  padding-bottom: 2px;
  opacity: 0.9;
}
/* Cada secção é um cartão de vidro — hierarquia clara, à 2026. */
.settings section {
  margin-bottom: 14px;
  padding: 16px 16px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.settings label {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.settings input[type="text"],
.settings input[type="password"],
.settings select {
  display: block;
  width: 100%;
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-user-select: text;
  user-select: text;
}
.settings input:focus,
.settings select:focus { border-color: rgba(180, 124, 255, 0.7); box-shadow: 0 0 0 4px rgba(160, 107, 255, 0.16); }
.settings select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%233fdcff' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
/* Slider refinado */
.settings input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  margin-top: 10px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(63, 220, 255, 0.5), rgba(63, 220, 255, 0.15));
  outline: none;
}
.settings input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #dff8ff;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 12px rgba(63, 220, 255, 0.45);
  cursor: pointer;
}
.toggle-row {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
/* Interruptor a sério (não um checkbox nu) — user friendly, estado óbvio. */
.toggle-row input {
  -webkit-appearance: none;
  appearance: none;
  width: 46px; height: 27px;
  border-radius: 999px;
  background: rgba(127, 168, 191, 0.22);
  border: 1px solid rgba(127, 168, 191, 0.35);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.toggle-row input::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: #9fb9c9;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.3), background 0.2s;
}
.toggle-row input:checked {
  background: rgba(63, 220, 255, 0.30);
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(63, 220, 255, 0.25);
}
.toggle-row input:checked::before {
  transform: translateX(19px);
  background: #eafcff;
  box-shadow: 0 0 10px var(--cyan-glow);
}
.ghost-btn {
  width: 100%;
  padding: 12px;
  background: rgba(63, 220, 255, 0.05);
  border: 1px solid var(--edge);
  border-radius: 12px;
  color: var(--cyan);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  margin-top: 4px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.ghost-btn:hover { border-color: var(--edge-strong); box-shadow: 0 0 14px rgba(63, 220, 255, 0.15); }
.ghost-btn:active { transform: scale(0.985); }
.ghost-btn.danger { border-color: rgba(255, 107, 107, 0.4); color: var(--danger); background: rgba(255, 107, 107, 0.05); }
.ghost-btn.danger:hover { border-color: rgba(255, 107, 107, 0.7); box-shadow: 0 0 14px rgba(255, 107, 107, 0.15); }
.note { font-size: 11px; color: var(--text-dim); line-height: 1.55; margin-top: 10px; }
.note a { color: var(--cyan); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: calc(112px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: 88vw;
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(201, 167, 255, 0.55);
  color: var(--gold);
  font-size: 12.5px;
  padding: 11px 18px;
  border-radius: 12px;
  z-index: 60;
  animation: msgIn 0.22s ease-out;
  text-align: center;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
}
