/* ============================================================
   Senior-Friendly Focus Indicators
   ============================================================ */
*:focus-visible {
  outline: 0.1875rem solid var(--retire-focus);
  outline-offset: 0.125rem;
  border-radius: 0.25rem;
}

/* Extra-visible focus for interactive elements (pine glow — reads in both themes) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0.1875rem solid var(--retire-focus);
  outline-offset: 0.125rem;
  box-shadow: 0 0 0 0.25rem var(--retire-focus-glow);
}

/* ============================================================
   Senior-Friendly Button Utilities
   ============================================================ */
.btn-retire {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--touch-min);
  padding: 0.75rem 1.5rem;
  font-size: var(--font-label);
  font-weight: 600;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  line-height: 1.4;
}

/* Amber-forward primary: the brand accent leads primary actions fleet-wide
   (matches the landing's amber hero CTA). Dark ink — white on amber fails contrast. */
.btn-retire-primary {
  background: var(--retire-accent);
  color: var(--retire-on-accent);
}
.btn-retire-primary:hover {
  background: var(--retire-accent-dark);
  color: var(--retire-on-accent);
  transform: translateY(-0.0625rem);
  box-shadow: var(--retire-shadow-md);
}

/* Fixed pine bg (decoupled from --retire-secondary, whose dark value is a
   light foreground pine) so white text stays AA in both themes. */
.btn-retire-secondary {
  background: #2F5D50;
  color: #FFFFFF;
}
.btn-retire-secondary:hover {
  background: #244A40;
  transform: translateY(-0.0625rem);
  box-shadow: var(--retire-shadow-md);
}
[data-theme="dark"] .btn-retire-secondary {
  background: #367063;
  color: #FFFFFF;
}
[data-theme="dark"] .btn-retire-secondary:hover {
  background: #2F5D50;
}

.btn-retire-outline {
  background: transparent;
  color: var(--retire-primary);
  border: 0.125rem solid var(--retire-primary);
}
.btn-retire-outline:hover {
  background: var(--retire-primary);
  color: #FFFFFF;
}

/* ------------------------------------------------------------
   Dark-mode contrast fix (UI eval #4). --retire-primary (#1E40AF)
   used as a FOREGROUND / border color renders at ~1.42:1 on dark
   surfaces. Remap these outline / card-link treatments to
   --retire-primary-light (#3B82F6, ~3.6:1) in DARK mode only.
   Scoped overrides — the shared --retire-primary token is untouched,
   and light mode is unaffected. (.btn-learn-more lives in services.css,
   .blog-read-more in blog.css; both are pure text/border links.)
   ------------------------------------------------------------ */
[data-theme="dark"] .btn-retire-outline {
  color: var(--retire-primary-light);
  border-color: var(--retire-primary-light);
}
[data-theme="dark"] .service-card .btn-learn-more {
  color: var(--retire-primary-light);
  border-color: var(--retire-primary-light);
}
[data-theme="dark"] .blog-read-more {
  color: var(--retire-primary-light);
}

.btn-retire-ghost {
  background: transparent;
  color: var(--retire-text);
  border: 0.0625rem solid var(--retire-border);
}
.btn-retire-ghost:hover {
  background: var(--retire-card-hover-bg);
}

.btn-retire-danger {
  background: var(--retire-rose);
  color: #FFFFFF;
}
.btn-retire-danger:hover {
  opacity: 0.9;
  transform: translateY(-0.0625rem);
}

.btn-retire:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   Senior-Friendly Card
   ============================================================ */
.retire-card {
  background: var(--retire-surface-elevated);
  border: 0.0625rem solid var(--retire-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--retire-shadow);
  transition: all var(--transition-normal);
}
.retire-card:hover {
  box-shadow: var(--retire-shadow-md);
}

/* ============================================================
   Form Utilities
   ============================================================ */
.retire-input {
  width: 100%;
  min-height: var(--touch-min);
  padding: 0.625rem 0.875rem;
  font-size: var(--font-body);
  line-height: 1.5;
  color: var(--retire-text);
  background: var(--retire-surface);
  border: 0.0625rem solid var(--retire-border);
  border-radius: 0.5rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  font-family: inherit;
}
.retire-input:focus {
  border-color: var(--retire-focus);
  box-shadow: 0 0 0 0.1875rem var(--retire-focus-glow);
  outline: none;
}
.retire-input::placeholder {
  color: var(--retire-text-muted);
}
.retire-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.retire-select {
  width: 100%;
  min-height: var(--touch-min);
  padding: 0.625rem 0.875rem;
  font-size: var(--font-body);
  color: var(--retire-text);
  background: var(--retire-surface);
  border: 0.0625rem solid var(--retire-border);
  border-radius: 0.5rem;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236E5F4E' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
}
[data-theme="dark"] .retire-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23A2917A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}
.retire-select:focus {
  border-color: var(--retire-focus);
  box-shadow: 0 0 0 0.1875rem var(--retire-focus-glow);
  outline: none;
}

.retire-textarea {
  width: 100%;
  min-height: 6rem;
  padding: 0.75rem 0.875rem;
  font-size: var(--font-body);
  line-height: var(--line-height-body);
  color: var(--retire-text);
  background: var(--retire-surface);
  border: 0.0625rem solid var(--retire-border);
  border-radius: 0.5rem;
  font-family: inherit;
  resize: vertical;
}
.retire-textarea:focus {
  border-color: var(--retire-focus);
  box-shadow: 0 0 0 0.1875rem var(--retire-focus-glow);
  outline: none;
}

.retire-label {
  display: block;
  font-size: var(--font-label);
  font-weight: 600;
  color: var(--retire-text);
  margin-bottom: 0.375rem;
}

/* ============================================================
   Badge Utilities
   ============================================================ */
.retire-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 1rem;
  white-space: nowrap;
}
.retire-badge-blue {
  background: #D9E7E2;
  color: #24463C;
}
.retire-badge-green {
  background: #D1FAE5;
  color: #065F46;
}
.retire-badge-amber {
  background: #FEF3C7;
  color: #92400E;
}
.retire-badge-rose {
  background: #FFE4E6;
  color: #9F1239;
}
[data-theme="dark"] .retire-badge-blue {
  background: rgba(111, 183, 158, 0.2);
  color: #8AC9B3;
}
[data-theme="dark"] .retire-badge-green {
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
}
[data-theme="dark"] .retire-badge-amber {
  background: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
}
[data-theme="dark"] .retire-badge-rose {
  background: rgba(225, 29, 72, 0.2);
  color: #FDA4AF;
}

/* ============================================================
   Modal Utilities
   ============================================================ */
.retire-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--retire-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}
.retire-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.retire-modal {
  background: var(--retire-surface-elevated);
  border-radius: var(--card-radius);
  width: 90%;
  max-width: 32rem;
  max-height: 85vh;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--retire-shadow-lg);
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}
.retire-modal-overlay.active .retire-modal {
  transform: scale(1);
}

.retire-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 0.0625rem solid var(--retire-border);
  flex-shrink: 0;
}

.retire-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.retire-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 0.0625rem solid var(--retire-border);
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   confirmModal() (common.js) styles.
   Migrated out of a runtime <style> injection so style-src can
   stay 'self' (CSP-clean). Theme adapts via custom properties
   that switch under [data-theme="dark"].
   ------------------------------------------------------------ */
.rpp-confirm-backdrop {
  position: fixed;
  inset: 0;
  background: var(--retire-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}
.rpp-confirm-dialog {
  background: var(--retire-surface-elevated);
  color: var(--retire-text);
  border: 0.0625rem solid var(--retire-border);
  border-radius: 0.75rem;
  box-shadow: var(--retire-shadow-lg);
  max-width: 28rem;
  width: 100%;
  padding: 1.5rem;
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
}
.rpp-confirm-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
}
.rpp-confirm-body {
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0 0 1.25rem 0;
  white-space: pre-line;
}
.rpp-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.rpp-confirm-btn {
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  border: 0.0625rem solid transparent;
  transition: opacity 0.15s;
}
.rpp-confirm-btn:focus {
  outline: 0.125rem solid var(--retire-accent);
  outline-offset: 0.125rem;
}
.rpp-confirm-btn-cancel {
  background: transparent;
  border-color: var(--retire-border);
  color: inherit;
}
.rpp-confirm-btn-cancel:hover {
  background: var(--retire-card-hover-bg);
}
.rpp-confirm-btn-danger {
  background: #DC2626;
  color: #FFFFFF;
}
.rpp-confirm-btn-danger:hover {
  background: #B91C1C;
}
.rpp-confirm-btn-primary {
  background: var(--retire-accent);
  color: #1F2937;
}
.rpp-confirm-btn-primary:hover {
  background: #D97706;
}

/* ============================================================
   Progress / Readiness Indicators
   ============================================================ */
.retire-progress-bar {
  width: 100%;
  height: 0.625rem;
  background: var(--retire-border);
  border-radius: 1rem;
  overflow: hidden;
}
.retire-progress-fill {
  height: 100%;
  border-radius: 1rem;
  transition: width var(--transition-slow);
  background: var(--retire-primary);
}
.retire-progress-fill.green { background: var(--retire-secondary); }
.retire-progress-fill.amber { background: var(--retire-accent); }
.retire-progress-fill.rose { background: var(--retire-rose); }

/* ============================================================
   Circular Progress (Readiness Score)
   ============================================================ */
.retire-circle-progress {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.retire-circle-progress svg {
  transform: rotate(-90deg);
}
.retire-circle-progress .circle-bg {
  fill: none;
  stroke: var(--retire-border);
}
.retire-circle-progress .circle-fill {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}
.retire-circle-progress .circle-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   Toast / Notification
   ============================================================ */
.retire-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #2F5D50;
  color: #FFFFFF;
  padding: 0.875rem 1.5rem;
  border-radius: 0.5rem;
  font-size: var(--font-body);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--retire-shadow-lg);
  transform: translateY(0.5rem);
  opacity: 0;
  transition: all var(--transition-normal);
  z-index: 1100;
  pointer-events: none;
}
.retire-toast.visible {
  transform: translateY(0);
  opacity: 1;
}
.retire-toast.error {
  background: var(--retire-rose);
}

/* ============================================================
   Table Utilities
   ============================================================ */
.retire-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-body);
}
.retire-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: var(--font-label);
  font-weight: 600;
  color: var(--retire-text);
  background: var(--retire-surface);
  border-bottom: 0.125rem solid var(--retire-border);
}
.retire-table td {
  padding: 0.75rem 1rem;
  border-bottom: 0.0625rem solid var(--retire-border);
  color: var(--retire-text-secondary);
}
.retire-table tr:hover td {
  background: var(--retire-card-hover-bg);
}

/* ============================================================
   Utility: sr-only
   ============================================================ */
.sr-only {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  padding: 0;
  margin: -0.0625rem;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================
   Empty / Loading States
   ============================================================ */
.retire-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--retire-text-muted);
}
.retire-empty i {
  font-size: 2.5rem;
  opacity: 0.5;
}

.retire-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}
.retire-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 0.1875rem solid var(--retire-border);
  border-top-color: var(--retire-primary);
  border-radius: 50%;
  animation: retire-spin 0.8s linear infinite;
}
@keyframes retire-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Iframe Page Base (for dashboard sub-pages)
   ============================================================ */
.iframe-page-body {
  background: var(--retire-bg);
  color: var(--retire-text);
  font-family: var(--font-sans);
  margin: 0;
  padding: 1.5rem;
  font-size: var(--font-body);
  line-height: var(--line-height-body);
}
.iframe-page-container {
  max-width: 56rem;
  margin: 0 auto;
}
.iframe-page-title {
  font-size: var(--font-heading-lg);
  font-weight: 700;
  color: var(--retire-text);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.iframe-page-title i {
  color: var(--retire-primary);
}

@media (max-width: 40rem) {
  .iframe-page-body { padding: 1rem; }
}

