/* PAI Capture — Mobile-first styles */
/* Design: system fonts, 44px min tap targets, high contrast, PAI navy/blue palette */

:root {
  --navy: #1e3a5f;
  --blue: #3b82f6;
  --light-blue: #93c5fd;
  --pale-blue: #dbeafe;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --green: #10b981;
  --red: #ef4444;
  --orange: #f59e0b;

  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--gray-900);
  background: var(--gray-50);
  -webkit-text-size-adjust: 100%;
}

/* ── Screens ── */

.screen {
  display: none;
  min-height: 100%;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ── Login Screen ── */

.login-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, var(--navy) 0%, #2d5a8e 100%);
  color: var(--white);
}

.logo {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-mark {
  width: 64px;
  height: 64px;
  background: var(--blue);
  color: var(--white);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto 1rem;
  box-shadow: var(--shadow-lg);
}

.logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  color: var(--light-blue);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.onboarding-text {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
  margin-top: 1rem;
  max-width: 280px;
  line-height: 1.5;
}

.login-form {
  width: 100%;
  max-width: 320px;
}

.login-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--light-blue);
}

.login-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  margin-bottom: 1rem;
}

.login-form input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.login-form input:focus {
  outline: none;
  border-color: var(--light-blue);
  background: rgba(255, 255, 255, 0.15);
}

.status-message {
  margin-top: 1rem;
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.5em;
  color: var(--light-blue);
}

.status-message.error {
  color: #fca5a5;
}

/* ── Buttons ── */

.btn-primary {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  background: var(--blue);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-primary:active {
  background: #1d4ed8;
}

.btn-primary:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
}

.btn-secondary {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--light-blue);
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 0.75rem;
  transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn-secondary:hover {
  border-color: var(--light-blue);
}

.btn-icon {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
}

.btn-icon:active {
  background: rgba(255, 255, 255, 0.1);
}

.btn-submit {
  margin-top: 1rem;
}

/* ── App Header ── */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--navy);
  color: var(--white);
  min-height: 56px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header h1 {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ── Tab Bar ── */

.tab-bar {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 56px;
  z-index: 9;
}

.tab {
  flex: 1;
  min-height: 48px;
  padding: 0.75rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* ── Tab Content ── */

.tab-content {
  display: none;
  padding: 1rem;
  flex: 1;
}

.tab-content.active {
  display: block;
}

/* ── Forms ── */

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.35rem;
}

.form-group textarea,
.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-900);
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.form-group textarea:focus,
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--blue);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.form-group select {
  min-height: 48px;
  cursor: pointer;
  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 d='M3 5l3 3 3-3' fill='none' stroke='%236b7280' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.optional-fields {
  margin-bottom: 1rem;
}

.optional-fields summary {
  font-size: 0.85rem;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0.5rem 0;
  -webkit-tap-highlight-color: transparent;
}

.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.form-group.small label {
  font-size: 0.8rem;
}

.form-group.small input {
  padding: 0.5rem;
  font-size: 0.9rem;
}

/* ── History ── */

.history-list {
  padding: 1rem;
  flex: 1;
}

.empty-state {
  text-align: center;
  color: var(--gray-500);
  padding: 3rem 1rem;
  font-size: 0.95rem;
}

.capture-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--blue);
}

.capture-card.type-check-in {
  border-left-color: var(--green);
}

.capture-card.type-thought {
  border-left-color: var(--blue);
}

.capture-card.type-workout {
  border-left-color: var(--orange);
}

.capture-card.type-biometric {
  border-left-color: var(--red);
}

.capture-card.type-learning {
  border-left-color: #8b5cf6;
}

.capture-card.type-note {
  border-left-color: var(--gray-500);
}

.capture-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.capture-type-badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--pale-blue);
  color: var(--navy);
}

.capture-time {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.capture-body {
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.5;
}

.capture-body strong {
  color: var(--gray-900);
}

/* ── Chat UI (M04 — coaching conversation) ── */

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  -webkit-overflow-scrolling: touch;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--white);
  color: var(--gray-900);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow);
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--blue);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.chat-loading {
  align-self: flex-start;
  padding: 0.5rem 1rem;
}

.typing-dots span {
  font-size: 1.5rem;
  color: var(--gray-500);
  animation: blink 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 60%, 100% { opacity: 0.2; }
  30% { opacity: 1; }
}

.chat-input-area {
  padding: 0.75rem 1rem;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: none; /* shown after conversation starts */
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.chat-input-row textarea {
  flex: 1;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--gray-200);
  border-radius: 20px;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.4;
}

.chat-input-row textarea:focus {
  outline: none;
  border-color: var(--blue);
}

.btn-send {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.btn-send:active {
  background: #1d4ed8;
}

.btn-send:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
}

.btn-done {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  background: transparent;
  border: 2px solid var(--green);
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: none; /* shown after at least 2 exchanges */
}

.btn-done:hover {
  background: rgba(16, 185, 129, 0.05);
}

.chat-start {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.chat-start p {
  color: var(--gray-500);
  margin-bottom: 1rem;
  font-size: 1rem;
}

/* Make check-in tab use flex layout for chat */
#tab-checkin.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px - 48px); /* viewport minus header and tabs */
}

/* ── Classify Confirm (M05) ── */

.classify-result {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--blue);
}

.classify-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.classify-label {
  font-size: 0.85rem;
  color: var(--gray-500);
}

.classify-preview {
  font-size: 0.95rem;
  color: var(--gray-700);
  line-height: 1.6;
}

.classify-preview strong {
  color: var(--gray-900);
}

.confirm-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.confirm-buttons .btn-primary {
  flex: 2;
}

.btn-secondary-inline {
  flex: 1;
  min-height: 48px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-500);
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-secondary-inline:active {
  background: var(--gray-50);
}

/* ── Toast ── */

.toast {
  position: fixed;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: bottom 0.3s ease;
  z-index: 100;
  white-space: nowrap;
}

.toast.show {
  bottom: 2rem;
}

/* ── Screen Transitions (M10) ── */

.screen {
  transition: opacity 0.15s ease;
}

/* ── History Filters (M10) ── */

.history-filters {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}

.history-filters select {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-700);
  min-height: 40px;
  -webkit-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 d='M3 5l3 3 3-3' fill='none' stroke='%236b7280' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 2rem;
}

/* ── Loading Skeleton (M10) ── */

.skeleton-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--gray-200);
}

.skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 90%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Sync Status Badge (M10) ── */

.sync-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.5rem;
}

.sync-badge.synced {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
}

.sync-badge.pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--orange);
}

/* ── Type Badge Colors (M10) ── */

.capture-type-badge.type-check-in { background: rgba(16, 185, 129, 0.15); color: #065f46; }
.capture-type-badge.type-thought { background: rgba(59, 130, 246, 0.15); color: #1e40af; }
.capture-type-badge.type-quote { background: rgba(139, 92, 246, 0.15); color: #5b21b6; }
.capture-type-badge.type-connection { background: rgba(236, 72, 153, 0.15); color: #9d174d; }
.capture-type-badge.type-workout { background: rgba(245, 158, 11, 0.15); color: #92400e; }
.capture-type-badge.type-biometric { background: rgba(239, 68, 68, 0.15); color: #991b1b; }
.capture-type-badge.type-learning { background: rgba(139, 92, 246, 0.15); color: #5b21b6; }
.capture-type-badge.type-note { background: rgba(107, 114, 128, 0.15); color: #374151; }

/* ── Button Spinner (M10) ── */

.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Offline Indicators (M06) ── */

.pending-badge {
  background: var(--orange);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.chat-offline {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.chat-offline p:first-child {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.offline-detail {
  font-size: 0.9rem;
  color: var(--gray-500);
  max-width: 280px;
  line-height: 1.5;
}

/* ── Settings (M11) ── */

.settings-list {
  padding: 1rem;
}

.settings-section h3 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.setting-label span {
  display: block;
  font-size: 0.95rem;
  color: var(--gray-900);
}

.setting-desc {
  font-size: 0.8rem !important;
  color: var(--gray-500) !important;
  margin-top: 0.15rem;
}

.setting-row select {
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  min-height: 40px;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--gray-300);
  border-radius: 28px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: var(--blue);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* ── Modal (M10) ── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-radius: 16px 16px 0 0;
  padding: 1.25rem;
  max-height: 70vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.modal-close {
  margin-left: auto;
  color: var(--gray-500);
}

.modal-body {
  font-size: 0.95rem;
  color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.modal-body strong {
  color: var(--gray-900);
}

.modal-edit-textarea {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  resize: vertical;
  min-height: 80px;
  margin-bottom: 0.75rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-200);
}

.modal-action-btn {
  flex: 1;
}

.btn-danger {
  flex: 1;
  min-height: 44px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--red);
  background: transparent;
  border: 2px solid var(--red);
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-danger:active {
  background: rgba(239, 68, 68, 0.05);
}

/* ── History Date Groups (M10) ── */

.history-date-group {
  margin-bottom: 0.5rem;
}

.history-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0 0.25rem;
}

/* ── Responsive: ensure no horizontal scroll ── */

@media (max-width: 360px) {
  .inline-fields {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 480px) {
  .tab-content {
    max-width: 480px;
    margin: 0 auto;
  }

  .history-list {
    max-width: 480px;
    margin: 0 auto;
  }
}

/* ── 988 Crisis Banner ── */

.crisis-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #fef3c7;
  border-top: 1px solid #fcd34d;
  font-size: 0.8rem;
  color: #92400e;
  text-align: center;
  position: sticky;
  bottom: 0;
  z-index: 10;
  flex-shrink: 0;
}

.crisis-banner a {
  color: #92400e;
  font-weight: 600;
  text-decoration: underline;
}

.crisis-banner a:hover {
  color: #78350f;
}

.crisis-banner .crisis-phone {
  font-weight: 700;
}

/* ── Legal Pages ── */

.legal-page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--gray-50);
}

.legal-header {
  padding: 0.75rem 1rem;
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 10;
}

.legal-back {
  color: var(--light-blue);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.legal-back:hover {
  color: var(--white);
}

.legal-content {
  flex: 1;
  padding: 1.5rem 1rem 2rem;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.legal-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.legal-updated {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

.legal-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.legal-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-top: 1.25rem;
  margin-bottom: 0.35rem;
}

.legal-content p {
  margin-bottom: 0.75rem;
  color: var(--gray-700);
  line-height: 1.7;
}

.legal-content ul {
  margin-bottom: 0.75rem;
  padding-left: 1.25rem;
}

.legal-content li {
  margin-bottom: 0.35rem;
  color: var(--gray-700);
  line-height: 1.6;
}

.legal-content a {
  color: var(--blue);
  text-decoration: underline;
}

.legal-content section {
  margin-bottom: 0.5rem;
}

/* Disclaimer page callout boxes */
.disclaimer-box {
  background: var(--pale-blue);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.disclaimer-box h2 {
  margin-top: 0;
  color: var(--navy);
}

.disclaimer-box p,
.disclaimer-box li {
  color: var(--navy);
}

.crisis-box {
  background: #fef2f2;
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}

.crisis-box p,
.crisis-box li {
  color: #991b1b;
}

.crisis-box a {
  color: #991b1b;
  font-weight: 600;
}

/* Legal page footer with links */
.legal-footer {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem;
  border-top: 1px solid var(--gray-200);
  background: var(--white);
  font-size: 0.85rem;
}

.legal-footer a {
  color: var(--gray-500);
  text-decoration: none;
}

.legal-footer a:hover {
  color: var(--blue);
}

/* Login screen legal links */
.login-legal-links {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  font-size: 0.8rem;
}

.login-legal-links a {
  color: var(--light-blue);
  text-decoration: none;
  opacity: 0.7;
}

.login-legal-links a:hover {
  opacity: 1;
}
