/* a11y-modal.css — Styles for the accessibility modal + FAB */

/* ── FAB ───────────────────────────────────────────────────────────────── */
.axm-fab {
  position: absolute;
  z-index: 1000;
  display: inline-flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 18px 0 14px;
  border-radius: 999px;
  background: #2C2C2C; color: #F5F5F5;
  border: 1px solid #2C2C2C;
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22), 0 1px 3px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.axm-fab:hover { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(0,0,0,0.28), 0 1px 3px rgba(0,0,0,0.1); }
.axm-fab.is-open { background: #fff; color: #1E1E1E; border-color: #D9D9D9; }
.axm-fab-label { font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600; }

/* ── Modal container ───────────────────────────────────────────────────── */
.axm-backdrop {
  position: absolute; inset: 0; z-index: 1001;
  background: rgba(0,0,0,0.32);
}

.axm-modal {
  position: absolute; z-index: 1002;
  display: flex; flex-direction: column;
  width: 420px;
  max-height: calc(100% - 32px);
  background: #FAFAFA;
  border: 1px solid #D9D9D9;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.08);
  font-family: 'Inter', sans-serif;
  color: #1E1E1E;
  overflow: hidden;
  opacity: 1;
}

/* Position variants */
.axm-pos-bottom-right { right: 24px; bottom: 96px; }
.axm-pos-bottom-left  { left: 24px;  bottom: 96px; }
.axm-pos-top-right    { right: 24px; top: 24px; }
/* Centered "dialog" style ignores anchor position */
.axm-style-dialog { left: 50%; top: 50%; right: auto; bottom: auto;
  transform: translate(-50%, -50%); width: 480px; max-height: 88%; }
/* Drawer hugs the right edge full-height */
.axm-style-drawer { right: 0; bottom: 0; top: 0; left: auto;
  border-radius: 16px 0 0 16px; max-height: 100%; }

/* ── Header ───────────────────────────────────────────────────────────── */
.axm-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 16px 16px 20px;
  border-bottom: 1px solid #D9D9D9;
  background: #fff;
}
.axm-header-l { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.axm-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: #2C2C2C; color: #F5F5F5;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.axm-header-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.axm-title { margin: 0; font-family: 'Inter', sans-serif;
  font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: #1E1E1E; }
.axm-subtitle { margin: 0; font-size: 12px; color: #757575; }
.axm-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: transparent; border: 1px solid transparent;
  color: #303030; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.axm-close:hover { background: #F5F5F5; border-color: #D9D9D9; }

/* ── Body ─────────────────────────────────────────────────────────────── */
.axm-body {
  flex: 1; overflow-y: auto;
  padding: 16px; display: flex; flex-direction: column; gap: 20px;
  scrollbar-width: thin;
}
.axm-body::-webkit-scrollbar { width: 8px; }
.axm-body::-webkit-scrollbar-thumb { background: #D9D9D9; border-radius: 999px; }

/* ── Section ──────────────────────────────────────────────────────────── */
.axm-section {
  background: #fff;
  border: 1px solid #D9D9D9;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.axm-section-h {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #D9D9D9;
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #757575;
}
.axm-section-body { display: flex; flex-direction: column; }

/* ── Row ──────────────────────────────────────────────────────────────── */
.axm-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 16px;
  border-bottom: 1px solid #F0F0F0;
}
.axm-row:last-child { border-bottom: none; }
.axm-row-stacked { flex-direction: column; align-items: stretch; gap: 10px; }
.axm-row-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.axm-row-r { flex-shrink: 0; }
.axm-row-stacked .axm-row-r { width: 100%; }
.axm-label { font-size: 14px; font-weight: 500; color: #1E1E1E; }
.axm-hint  { font-size: 12px; color: #757575; line-height: 1.4; }

/* ── Profile cards ────────────────────────────────────────────────────── */
.axm-profiles { display: flex; flex-direction: column; padding: 4px; gap: 2px; }
.axm-profile {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: transparent;
  border: 1px solid transparent; border-radius: 8px;
  cursor: pointer; text-align: left;
  transition: background .12s, border-color .12s;
}
.axm-profile:hover { background: #F5F5F5; }
.axm-profile.is-active { background: #F0F4FF; border-color: #C7D5F4; }
.axm-profile-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: #F5F5F5; color: #2C2C2C;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid #D9D9D9;
}
.axm-profile.is-active .axm-profile-icon {
  background: #2C2C2C; color: #F5F5F5; border-color: #2C2C2C;
}
.axm-profile-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.axm-profile-name { font-size: 14px; font-weight: 600; color: #1E1E1E; }
.axm-profile-desc { font-size: 12px; color: #757575; line-height: 1.4; }
.axm-profile-check {
  width: 24px; height: 24px; border-radius: 999px;
  background: #2C2C2C; color: #F5F5F5;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Stepper ──────────────────────────────────────────────────────────── */
.axm-stepper {
  display: inline-flex; align-items: center; gap: 4px;
  background: #F5F5F5; border: 1px solid #D9D9D9; border-radius: 999px;
  padding: 4px;
}
.axm-step-btn {
  width: 28px; height: 28px; border-radius: 999px;
  background: #fff; border: 1px solid #D9D9D9;
  color: #303030; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.axm-step-btn:hover:not(:disabled) { background: #fff; border-color: #BFBFBF; }
.axm-step-btn:disabled { opacity: .4; cursor: not-allowed; }
.axm-step-val {
  min-width: 56px; text-align: center;
  font-family: 'Inter', sans-serif; font-size: 14px;
  font-weight: 600; font-variant-numeric: tabular-nums;
  color: #1E1E1E;
}

/* ── Segmented ────────────────────────────────────────────────────────── */
.axm-seg {
  display: grid; gap: 4px;
  padding: 4px;
  background: #F5F5F5; border: 1px solid #D9D9D9; border-radius: 10px;
  width: 100%;
  grid-template-columns: repeat(2, 1fr);
}
.axm-seg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 8px;
  background: transparent; border: 1px solid transparent; border-radius: 7px;
  color: #303030; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.axm-seg-btn:hover { background: rgba(255,255,255,0.5); }
.axm-seg-btn.is-active {
  background: #fff; color: #1E1E1E;
  border-color: #D9D9D9;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.axm-seg-swatch {
  width: 22px; height: 22px; border-radius: 4px;
  background: #fff; border: 1px solid #D9D9D9;
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Inter', sans-serif;
}
.axm-seg-btn:nth-of-type(2) .axm-seg-swatch { font-family: 'Lexend', 'Inter', sans-serif; letter-spacing: 0.02em; }
.axm-seg-btn:nth-of-type(3) .axm-seg-swatch { font-family: Georgia, serif; }
.axm-seg-btn:nth-of-type(4) .axm-seg-swatch { font-family: 'JetBrains Mono', monospace; font-size: 10px; }

/* ── Toggle switch ────────────────────────────────────────────────────── */
.axm-toggle {
  width: 44px; height: 24px; border-radius: 999px;
  background: #D9D9D9; border: none; padding: 2px;
  display: inline-flex; align-items: center;
  cursor: pointer; transition: background .15s;
  justify-content: flex-start;
}
.axm-toggle.is-on { background: #2C2C2C; justify-content: flex-end; }
.axm-toggle-thumb {
  width: 20px; height: 20px; border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ── Slider ───────────────────────────────────────────────────────────── */
.axm-slider-wrap { display: inline-flex; align-items: center; gap: 12px; min-width: 180px; }
.axm-slider {
  -webkit-appearance: none; appearance: none;
  width: 130px; height: 4px; border-radius: 999px;
  background: #D9D9D9; outline: none;
}
.axm-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 999px;
  background: #fff; border: 1px solid #2C2C2C;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  cursor: pointer;
}
.axm-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 999px;
  background: #fff; border: 1px solid #2C2C2C;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  cursor: pointer;
}
.axm-slider-val {
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: #1E1E1E;
  min-width: 40px; text-align: right;
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.axm-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  background: #fff; border-top: 1px solid #D9D9D9;
}
.axm-reset {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: none; padding: 8px 10px;
  color: #303030; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500;
  border-radius: 8px;
}
.axm-reset:hover { background: #F5F5F5; }
.axm-done {
  height: 40px; padding: 0 24px; border-radius: 8px;
  background: #2C2C2C; color: #F5F5F5;
  border: 1px solid #2C2C2C;
  cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
}
.axm-done:hover { background: #1E1E1E; }

/* ── Reading mask overlay ─────────────────────────────────────────────── */
.axm-reading-mask {
  position: absolute; inset: 0; pointer-events: none; z-index: 100;
  display: flex; flex-direction: column;
}
.axm-mask-band { background: rgba(0,0,0,0.55); flex-shrink: 0; }
.axm-mask-grow { flex: 1; background: rgba(0,0,0,0.55); }
.axm-mask-clear { flex-shrink: 0; }


/* ── Dark variant ───────────────────────────────────────────────────────
   Applied to .axm-modal and .axm-fab via the `dark` prop. The FAB stays
   dark by default already, so dark-mode only restyles the modal surfaces
   plus the FAB's "open" state so it doesn't clash with the dark modal. */
.axm-modal.axm-dark {
  background: #1C1C1F;
  border-color: #3A3A3F;
  color: #E4E4E6;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55), 0 2px 6px rgba(0,0,0,0.35);
}
.axm-modal.axm-dark .axm-header {
  background: #26262A;
  border-bottom-color: #3A3A3F;
}
.axm-modal.axm-dark .axm-logo {
  background: #E4E4E6; color: #1C1C1F;
}
.axm-modal.axm-dark .axm-title { color: #E4E4E6; }
.axm-modal.axm-dark .axm-subtitle { color: #A8A8AC; }
.axm-modal.axm-dark .axm-close { color: #C9C9CD; }
.axm-modal.axm-dark .axm-close:hover { background: #2A2A2E; border-color: #3F3F44; }
.axm-modal.axm-dark .axm-body::-webkit-scrollbar-thumb { background: #3F3F44; }

.axm-modal.axm-dark .axm-section {
  background: #26262A; border-color: #3A3A3F;
}
.axm-modal.axm-dark .axm-section-h {
  background: #212126; border-bottom-color: #3A3A3F; color: #A8A8AC;
}
.axm-modal.axm-dark .axm-row { border-bottom-color: #2E2E33; }
.axm-modal.axm-dark .axm-label { color: #E4E4E6; }
.axm-modal.axm-dark .axm-hint  { color: #A8A8AC; }

.axm-modal.axm-dark .axm-profile:hover { background: #2E2E33; }
.axm-modal.axm-dark .axm-profile.is-active {
  background: #233148; border-color: #3A5687;
}
.axm-modal.axm-dark .axm-profile-icon {
  background: #2E2E33; color: #E4E4E6; border-color: #3F3F44;
}
.axm-modal.axm-dark .axm-profile.is-active .axm-profile-icon {
  background: #E4E4E6; color: #1C1C1F; border-color: #E4E4E6;
}
.axm-modal.axm-dark .axm-profile-name { color: #E4E4E6; }
.axm-modal.axm-dark .axm-profile-desc { color: #A8A8AC; }
.axm-modal.axm-dark .axm-profile-check { background: #E4E4E6; color: #1C1C1F; }

.axm-modal.axm-dark .axm-stepper {
  background: #1C1C1F; border-color: #3A3A3F;
}
.axm-modal.axm-dark .axm-step-btn {
  background: #2E2E33; border-color: #3F3F44; color: #E4E4E6;
}
.axm-modal.axm-dark .axm-step-btn:hover:not(:disabled) { border-color: #5F5F66; }
.axm-modal.axm-dark .axm-step-val { color: #E4E4E6; }

.axm-modal.axm-dark .axm-seg {
  background: #1C1C1F; border-color: #3A3A3F;
}
.axm-modal.axm-dark .axm-seg-btn { color: #C9C9CD; }
.axm-modal.axm-dark .axm-seg-btn:hover { background: rgba(255,255,255,0.05); }
.axm-modal.axm-dark .axm-seg-btn.is-active {
  background: #2E2E33; color: #E4E4E6; border-color: #3F3F44;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.axm-modal.axm-dark .axm-seg-swatch {
  background: #2E2E33; color: #E4E4E6; border-color: #3F3F44;
}

.axm-modal.axm-dark .axm-toggle { background: #3F3F44; }
.axm-modal.axm-dark .axm-toggle.is-on { background: #E4E4E6; }
.axm-modal.axm-dark .axm-toggle.is-on .axm-toggle-thumb { background: #1C1C1F; box-shadow: none; }

.axm-modal.axm-dark .axm-slider { background: #3F3F44; }
.axm-modal.axm-dark .axm-slider::-webkit-slider-thumb {
  background: #1C1C1F; border-color: #E4E4E6;
}
.axm-modal.axm-dark .axm-slider::-moz-range-thumb {
  background: #1C1C1F; border-color: #E4E4E6;
}
.axm-modal.axm-dark .axm-slider-val { color: #E4E4E6; }

.axm-modal.axm-dark .axm-footer {
  background: #26262A; border-top-color: #3A3A3F;
}
.axm-modal.axm-dark .axm-reset { color: #C9C9CD; }
.axm-modal.axm-dark .axm-reset:hover { background: #2E2E33; }
.axm-modal.axm-dark .axm-done {
  background: #E4E4E6; color: #1C1C1F; border-color: #E4E4E6;
}
.axm-modal.axm-dark .axm-done:hover { background: #F1F1F2; }

/* FAB in dark mode: invert the open-state so it doesn't clash with the dark modal */
.axm-fab.axm-dark.is-open { background: #2E2E33; color: #E4E4E6; border-color: #3F3F44; }
