:root {
  --ry-primary: #2d6a6a;
  --ry-primary-light: #4a9b8e;
  --ry-bg: #f8faf9;
  --ry-surface: #ffffff;
  --ry-text: #1a2e2e;
  --ry-text-muted: #4a5f5f;
  --ry-border: #c5d6d4;
  --ry-focus: #ffbf47;
  --ry-green: #2d7a4f;
  --ry-amber: #b8860b;
  --ry-red: #b83232;
  --ry-font-size: 1rem;
  --ry-line-height: 1.6;
  --ry-spacing: 1.25rem;
}

[data-theme="high-contrast"] {
  --ry-bg: #000;
  --ry-surface: #000;
  --ry-text: #fff;
  --ry-text-muted: #e0e0e0;
  --ry-border: #fff;
  --ry-primary: #ffff00;
  --ry-primary-light: #ffff00;
}

[data-font="dyslexic"] body {
  font-family: "OpenDyslexic", "Atkinson Hyperlegible", "Segoe UI", sans-serif;
}

html { font-size: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  font-size: var(--ry-font-size);
  line-height: var(--ry-line-height);
  color: var(--ry-text);
  background: var(--ry-bg);
  margin: 0;
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ry-focus);
  color: #000;
  padding: 0.75rem 1rem;
  z-index: 10000;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

.ry-header {
  background: var(--ry-surface);
  border-bottom: 2px solid var(--ry-border);
  padding: var(--ry-spacing) 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.ry-logo { height: 48px; width: auto; }

.ry-nav a {
  color: var(--ry-primary);
  text-decoration: none;
  margin-left: 1.25rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.ry-nav a:hover, .ry-nav a:focus { border-bottom-color: var(--ry-primary); outline: none; }

.ry-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.ry-card {
  background: var(--ry-surface);
  border: 1px solid var(--ry-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.ry-btn {
  display: inline-block;
  background: var(--ry-primary);
  color: #fff;
  border: 2px solid var(--ry-primary);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  line-height: 1.2;
}
.ry-btn:hover, .ry-btn:focus {
  background: var(--ry-primary-light);
  border-color: var(--ry-primary-light);
  outline: 3px solid var(--ry-focus);
  outline-offset: 2px;
}
.ry-btn-secondary {
  background: transparent;
  color: var(--ry-primary);
}

.ry-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
}
.ry-badge-green { background: #d4edda; color: var(--ry-green); }
.ry-badge-amber { background: #fff3cd; color: var(--ry-amber); }
.ry-badge-red { background: #f8d7da; color: var(--ry-red); }

.ry-form-group { margin-bottom: 1.5rem; }
.ry-form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.ry-form-group input[type="text"],
.ry-form-group input[type="email"],
.ry-form-group input[type="password"],
.ry-form-group input[type="date"],
.ry-form-group textarea,
.ry-form-group select {
  width: 100%;
  max-width: 600px;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid var(--ry-border);
  border-radius: 6px;
  background: var(--ry-surface);
  color: var(--ry-text);
}
.ry-form-group input:focus, .ry-form-group textarea:focus, .ry-form-group select:focus {
  outline: 3px solid var(--ry-focus);
  outline-offset: 0;
  border-color: var(--ry-primary);
}

.ry-checkbox-group label, .ry-radio-group label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-weight: 400;
  cursor: pointer;
  min-height: 44px;
}
.ry-checkbox-group input, .ry-radio-group input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.ry-visual-scale {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ry-visual-scale label {
  flex: 1;
  min-width: 80px;
  text-align: center;
  padding: 1rem 0.5rem;
  border: 2px solid var(--ry-border);
  border-radius: 8px;
  cursor: pointer;
}
.ry-visual-scale input { position: absolute; opacity: 0; }
.ry-visual-scale input:focus + span,
.ry-visual-scale label:has(input:checked) {
  border-color: var(--ry-primary);
  background: #e8f4f2;
}

.ry-alert {
  padding: 1rem 1.25rem;
  border-radius: 6px;
  border-left: 4px solid;
  margin-bottom: 1.5rem;
}
.ry-alert-warning { background: #fff8e6; border-color: var(--ry-amber); }
.ry-alert-danger { background: #fdeaea; border-color: var(--ry-red); }
.ry-alert-info { background: #e8f4f2; border-color: var(--ry-primary); }

.ry-footer {
  text-align: center;
  padding: 2rem;
  color: var(--ry-text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--ry-border);
  margin-top: 3rem;
}

.ry-access-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ry-access-toolbar button {
  background: var(--ry-surface);
  border: 1px solid var(--ry-border);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
}
.ry-access-toolbar button:focus { outline: 3px solid var(--ry-focus); }

.ry-table { width: 100%; border-collapse: collapse; }
.ry-table th, .ry-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--ry-border);
}
.ry-table th { font-weight: 600; background: #eef5f4; }

.ry-timeline { border-left: 3px solid var(--ry-border); padding-left: 1.5rem; }
.ry-timeline-item { margin-bottom: 1.25rem; position: relative; }
.ry-timeline-item::before {
  content: "";
  position: absolute;
  left: -1.65rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  background: var(--ry-primary);
  border-radius: 50%;
}

.ry-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f4f2 0%, #f8faf9 100%);
}
.ry-login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
}

.ry-progress {
  height: 6px;
  background: var(--ry-border);
  border-radius: 3px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.ry-progress-bar {
  height: 100%;
  background: var(--ry-primary);
  transition: width 0.3s ease;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
