/* =====================================================================
   Settings Page (/settings)
   ===================================================================== */

.settings-page {
  min-height: 100dvh;
  background: var(--bg-app, #fcfcfb);
  color: var(--text-main, #16181b);
}

/* Sticky Header with Frosted Glass */
.settings-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-block-end: 1px solid var(--border-subtle, #edebe6);
}

@media (prefers-color-scheme: dark) {
  .settings-top {
    background: rgba(22, 24, 28, 0.92);
    border-block-end-color: #2a2e35;
  }
}

.settings-top h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.settings-main {
  width: min(640px, 100%);
  margin-inline: auto;
  padding: 8px 16px 48px;
}

/* Section Dividers */
.settings-section {
  padding-block: 24px;
  border-block-end: 1px solid var(--border-subtle, #edebe6);
}

.settings-section h2 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* Definition Facts Grid */
.settings-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 18px;
  margin: 0;
  font-size: 0.95rem;
}

.settings-facts dt {
  font-weight: 600;
  color: var(--text-main, #16181b);
}

.settings-facts dd {
  margin: 0;
  color: var(--text-muted, #656f77);
  overflow-wrap: anywhere;
}

.settings-note {
  margin: 12px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted, #656f77);
  line-height: 1.45;
}

/* Form Dropdowns */
.settings-page select {
  padding: 10px 14px;
  border: 1px solid var(--border-subtle, #edebe6);
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  background: #ffffff;
  color: inherit;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: all 0.15s ease;
}

.settings-page select:focus {
  border-color: var(--accent, #4f46e5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* Quiet Action Links */
.settings-link {
  justify-self: start;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent, #4f46e5);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.settings-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* Success Confirmation Badge */
.settings-saved {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.1);           /* Fresh emerald tint */
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #065f46;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Primary Action Buttons */
.settings-page .auth-form .btn-primary {
  justify-self: start;
  padding: 10px 24px;
  background-color: var(--accent, #4f46e5);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.25);
  transition: all 0.15s ease;
}

.settings-page .auth-form .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  filter: brightness(1.04);
}

.settings-page .auth-form .btn-primary:active {
  transform: translateY(0);
}

/* =====================================================================
   Time zone picker (ZonePicker.js)
   Wide screens: a dropdown under the field. Phones: the list sits in
   the page under the field, so the on-screen keyboard can't cover it.
   ===================================================================== */

zone-picker {
  display: block;
  position: relative;
}

zone-picker .zone-input {
  width: 100%;
  box-sizing: border-box;
  text-overflow: ellipsis;
}

.zone-list {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 4px);
  z-index: 3;
  max-height: 320px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  background: #ffffff;
  border: 1px solid var(--border-subtle, #edebe6);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.zone-option {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.zone-option.is-active {
  background: rgba(79, 70, 229, 0.08);
}

.zone-city {
  font-size: 0.95rem;
  font-weight: 600;
}

.zone-option[aria-selected="true"] .zone-city {
  color: var(--accent, #4f46e5);
}

.zone-detail {
  font-size: 0.82rem;
  color: var(--text-muted, #656f77);
}

.zone-empty {
  padding: 10px;
  font-size: 0.9rem;
  color: var(--text-muted, #656f77);
}

@media (max-width: 600px) {
  .zone-list {
    position: static;
    max-height: 45dvh;
    margin-top: 6px;
    box-shadow: none;
  }
}

@media (hover: hover) {
  .zone-option:hover {
    background: rgba(79, 70, 229, 0.05);
  }
}

@media (prefers-color-scheme: dark) {
  .zone-list {
    background: #1d2026;
    border-color: #2a2e35;
  }
}
