/* Settings (Figma "settings" section, node 19491:456021). */

/* Sidebar footer "Log Out" is a <button> styled like a nav link. */
.groove-nav-button {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
}

.settings-page {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
}

.settings-back {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.settings-back-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 40px;
  background: var(--navy-card);
}

.settings-title-lg,
.settings-title {
  margin: 0;
  font-weight: 500;
  line-height: 1.2;
}

.settings-title-lg {
  font-size: 40px;
}

.settings-title {
  font-size: 32px;
}

.settings-muted {
  margin: 0;
  color: var(--light-gray);
}

/* --- Home menu --- */

.settings-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 700px;
  max-width: 100%;
  /* A <ul> (WCAG 1.3.1): no bullets or indent. */
  margin: 0;
  padding: 0;
  list-style: none;
}

.settings-menu > li {
  display: flex;
  flex-direction: column;
}

.settings-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 60px;
  padding: 12px 16px;
  border: 1px solid var(--navy-border);
  border-radius: 12px;
  background: var(--navy-card);
  color: var(--white);
  font: inherit;
  text-align: left;
}

.settings-menu-item:hover {
  background: var(--navy-card-secondary);
}

.settings-menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.settings-menu-label {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

/* --- Section cards --- */

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 700px;
  max-width: 100%;
}

.settings-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  width: 700px;
  max-width: 100%;
  padding: 24px;
  border-radius: 12px;
  background: var(--navy-card);
}

.settings-card-heading {
  margin: 0;
  color: var(--gold);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.settings-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.settings-row-label {
  margin: 0;
  color: var(--light-gray);
  font-size: 14px;
  font-weight: 600;
  line-height: 17px;
}

.settings-row-line {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.settings-row-value {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.settings-edit {
  display: flex;
  padding: 0;
  border: none;
  background: transparent;
  /* 24px hit area around the 16px icon, same footprint (WCAG 2.5.8). */
  min-width: 24px;
  min-height: 24px;
  margin: -4px;
  align-items: center;
  justify-content: center;
}

.settings-body-sm,
.settings-body-xs {
  margin: 0;
  line-height: 1.4;
}

.settings-body-sm {
  font-size: 14px;
}

.settings-body-xs {
  font-size: 12px;
}

.settings-body-xs.muted {
  color: var(--light-gray);
}

/* --- Toggle --- */

.settings-toggle-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.settings-toggle-label {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.settings-toggle-label-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* Info icon + hover/focus tooltip (e.g. the AI profile-info toggle). */
.settings-tip {
  display: inline-flex;
  flex-shrink: 0;
  cursor: help;
  border-radius: 50%;
  /* 24px hit area around the 18px icon, same footprint (WCAG 2.5.8). */
  padding: 3px;
  margin: -3px;
}

.settings-tip:focus-visible {
  outline: 2px solid var(--light-gray);
  outline-offset: 2px;
}

.settings-tip-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 10;
  width: max-content;
  max-width: min(320px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--navy-border);
  border-radius: 12px;
  background: var(--navy-card-secondary);
  color: var(--white);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s;
}

/* Shown by `SettingsTooltip` on hover/focus until Escape (WCAG 1.4.13); while
   open the bubble takes the pointer, and ::after bridges the 8px gap so it
   stays open while moving onto it. */
.settings-tip.open .settings-tip-bubble {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  cursor: auto;
}

.settings-tip-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 8px;
}

.settings-switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: var(--navy-border);
  transition: background 0.15s;
}

.settings-switch.on {
  background: var(--figma-green);
}

/* 36x20 switch: 24px-tall hit area without changing its look (WCAG 2.5.8). */
.settings-switch::before {
  content: '';
  position: absolute;
  inset: -2px 0;
}

.settings-switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1), 0 1px 2px rgba(16, 24, 40, 0.06);
  transition: left 0.15s;
}

.settings-switch.on .settings-switch-knob {
  left: 18px;
}

/* --- Buttons --- */

.settings-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 250px;
  height: 40px;
  padding: 8px 24px;
  border: 1px solid var(--white);
  border-radius: 40px;
  background: transparent;
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  line-height: 25px;
}

.settings-pill.filled {
  border-color: var(--navy-border);
  background: var(--white);
  color: var(--navy-mid);
  font-weight: 500;
}

.settings-pill.danger {
  border-color: #C96B67;
  background: #C96B67;
  color: var(--white);
  font-weight: 500;
}

.settings-pill.wide {
  width: 100%;
}

.settings-pill:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-text-link {
  align-self: center;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--gold);
  font-size: 16px;
  font-weight: 600;
}

.settings-text-link:disabled {
  color: var(--light-gray);
  cursor: not-allowed;
}

.settings-store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* --- Modal (Figma "edit" overlay, node 19502:457601) --- */

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(1.5px);
}

.settings-modal {
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 581px;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 24px 40px 40px;
  border: 2px solid var(--navy-border);
  border-radius: 24px;
  background: var(--navy-mid);
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}

.settings-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-modal-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.settings-modal-eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.settings-modal-title {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
}

.settings-modal-subtitle {
  margin: 0;
  color: var(--light-gray);
  font-size: 16px;
  line-height: 1.4;
}

.settings-modal-x {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 40px;
  background: transparent;
}

.settings-modal-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-modal-actions {
  display: flex;
  gap: 16px;
}

.settings-modal-actions .settings-pill {
  flex: 1;
  width: auto;
}

/* "add partner" modal (node 19502:457862): X row above the text. */
.settings-modal.partner-modal {
  width: 551px;
  border-radius: 12px;
}

.partner-modal .settings-modal-top {
  flex-direction: column-reverse;
  align-items: stretch;
}

.partner-modal .settings-modal-x {
  align-self: flex-end;
}

.partner-modal .settings-modal-subtitle {
  margin-top: 8px;
  font-size: 18px;
}

.partner-modal .settings-input {
  border-radius: 4px;
}

/* --- Form fields --- */

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-field-label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 17px;
}

.settings-input {
  width: 100%;
  height: 40px;
  padding: 8px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  outline: none;
  background: var(--navy-card-secondary);
  color: var(--white);
  font-family: inherit;
  font-size: 16px;
  line-height: 25px;
}

.settings-input::placeholder {
  color: var(--light-gray);
}

.settings-input:focus {
  border-color: var(--light-gray);
}

.settings-select option {
  background: var(--navy-mid);
}

.settings-error {
  margin: 0;
  color: #FF6B6B;
  font-size: 14px;
  line-height: 1.4;
}

.settings-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 16px;
  line-height: 1.4;
  cursor: pointer;
}

.settings-checkbox input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--green);
}

.settings-race-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

/* --- Notification days --- */

.settings-days {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.settings-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid var(--navy-border);
  border-radius: 50%;
  background: var(--navy-card-secondary);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
}

.settings-day.selected {
  background: var(--green-strong);
}

/* --- Premium --- */

.premium-learn {
  width: 350px;
}

.premium-learn-page {
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-self: center;
  width: 700px;
  max-width: 100%;
  padding: 48px 24px 40px;
}

.premium-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.premium-gem {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: var(--gold);
}

.premium-title {
  margin: 0;
  color: var(--gold);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.2;
}

.premium-subtitle {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

/* Scan-to-open-the-app code, shared by every web "use your phone" hand-off. */
.premium-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.premium-qr img {
  width: 160px;
  height: 160px;
  border-radius: 8px;
}

.premium-qr-caption {
  margin: 0;
  max-width: 240px;
  font-size: 14px;
  line-height: 1.4;
}

.premium-link-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 480px;
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
}

.premium-benefits {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 40px;
  border-radius: 12px;
  background: var(--navy-card);
}

.premium-benefit {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  line-height: 1.4;
}

.premium-benefit img {
  flex-shrink: 0;
}

.premium-divider {
  display: block;
  width: 100%;
  height: 1px;
}

.premium-best-for {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.premium-best-label,
.premium-best-text {
  margin: 0;
}

.premium-best-label {
  color: var(--light-gray);
  font-weight: 500;
  line-height: 1.2;
}

.premium-best-text {
  color: var(--gold);
  line-height: 1.4;
}

.premium-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.premium-price {
  margin: 0;
  color: var(--link-green);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.premium-bottom .settings-pill {
  width: auto;
  padding: 8px 40px;
}

/* --- Partner --- */

.partner-card {
  align-items: center;
}

.partner-card .settings-card-heading {
  width: 100%;
}

.partner-logo {
  display: flex;
  padding: 4px;
  border-radius: 8px;
  background: var(--white);
}

.partner-logo img {
  display: block;
  height: 33px;
  width: auto;
}

.partner-add {
  display: flex;
  text-decoration: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 0 8px;
  border: none;
  background: transparent;
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  line-height: 25px;
}

/* --- Access code (styled after the "add partner" modal, 19502:457783) --- */

.access-code-card {
  gap: 40px;
  align-items: stretch;
}

.access-code-card .settings-modal-subtitle {
  font-size: 18px;
}

.access-code-card .settings-input {
  border-radius: 4px;
}

.access-code-card .settings-pill.wide {
  text-decoration: none;
}

.access-code-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.access-code-logo {
  display: flex;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--white);
}

.access-code-logo img {
  display: block;
  max-width: 300px;
  max-height: 120px;
  object-fit: contain;
}

.access-code-logo.large img {
  width: 176px;
  height: 76px;
}

.access-code-partner {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.access-code-pricing {
  margin: 0;
  color: var(--light-gray);
  font-size: 16px;
  line-height: 1.4;
}

.access-code-note {
  margin: 0;
  color: var(--gold);
  font-size: 14px;
  line-height: 1.4;
}

.access-code-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.access-code-link {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
}

.access-code-done {
  align-items: center;
  gap: 24px;
  text-align: center;
}

.access-code-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: var(--green);
}

.access-code-stores {
  width: 100%;
}

.access-code-stores .settings-pill {
  text-decoration: none;
}

/* "Add A Premium Code" / "Have a Premium Code?" links into /access-code. */
.access-code-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

.access-code-entry.gold {
  color: var(--gold);
  font-size: 14px;
}

/* --- Small screens (WCAG 1.4.10 reflow / 1.4.4 zoom / 1.4.12 spacing) ---
   Desktop (>= 1024px) is unchanged. */

.settings-pill,
.premium-learn {
  max-width: 100%;
}

@media (max-width: 767.98px) {
  .settings-modal {
    gap: 24px;
    padding: 16px 16px 24px;
  }

  .settings-overlay {
    padding: 16px;
  }

  .settings-card,
  .premium-benefits {
    padding: 24px 16px;
  }

  .premium-learn-page {
    padding: 24px 0;
  }

  .settings-days {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .settings-modal-actions,
  .settings-row-line,
  .settings-toggle-row {
    flex-wrap: wrap;
  }

  .access-code-logo img {
    max-width: 100%;
  }
}

@media (max-width: 479.98px) {
  .settings-race-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Loading skeleton: fill the column so its 700px card can shrink on phones. */
.settings-page > .groove-skeleton {
  align-self: stretch;
}
