/**
 * Site-wide UX polish — comfort, trust, accessibility
 */

/* ——— Skip link ——— */
.rs-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10001;
  padding: 12px 18px;
  background: #0f172a;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 0 0 10px 10px;
}

.rs-skip-link:focus {
  left: max(12px, env(safe-area-inset-left));
  top: max(8px, env(safe-area-inset-top));
  width: auto;
  height: auto;
  overflow: visible;
  outline: 3px solid #f97316;
  outline-offset: 2px;
}

/* ——— Announcement bar ——— */
.rs-announce {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  background: linear-gradient(90deg, #fff7ed 0%, #ffedd5 50%, #fff7ed 100%);
  border-bottom: 1px solid rgba(234, 88, 12, 0.2);
  color: #7c2d12;
}

.rs-announce[hidden] {
  display: none !important;
}

.rs-announce__inner {
  max-width: min(1120px, 100%);
  margin: 0 auto;
  padding: 10px clamp(14px, 4vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rs-announce__text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.rs-announce__ico {
  font-size: 1.15rem;
  flex-shrink: 0;
  color: #ea580c;
}

.rs-announce__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(234, 88, 12, 0.12);
  color: #9a3412;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}

.rs-announce__close:hover {
  background: rgba(234, 88, 12, 0.22);
}

.rs-announce__close:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: 2px;
}

body.rs-has-announce .rs-nav-premium {
  top: var(--rs-announce-h, 0);
}

body.rs-has-announce.rs-landing {
  padding-top: calc(var(--rs-nav-offset) + var(--rs-announce-h, 0) + env(safe-area-inset-top));
}

/* ——— Nav scroll state ——— */
.rs-nav-premium.rs-nav-scrolled {
  box-shadow:
    var(--rs-shadow-xs),
    0 16px 48px rgba(15, 23, 42, 0.08);
}

/* ——— Focus & selection (comfort) ——— */
:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: 2px;
}

::selection {
  background: rgba(251, 146, 60, 0.35);
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ——— Trust strip (home) ——— */
.rs-trust-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(12px, 2.5vw, 20px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.rs-trust-strip li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(234, 88, 12, 0.12);
  box-shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.1);
}

.rs-trust-strip .material-symbols-outlined {
  font-size: 1.5rem;
  color: #ea580c;
  flex-shrink: 0;
}

.rs-trust-strip strong {
  display: block;
  font-size: 0.95rem;
  color: #1c1917;
  margin-bottom: 2px;
}

.rs-trust-strip span {
  font-size: 0.85rem;
  color: #57534e;
  line-height: 1.4;
}

/* ——— FAQ ——— */
.rs-faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rs-faq details {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 16px -8px rgba(15, 23, 42, 0.08);
}

.rs-faq summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1c1917;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rs-faq summary::-webkit-details-marker {
  display: none;
}

.rs-faq summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  color: #ea580c;
  flex-shrink: 0;
}

.rs-faq details[open] summary::after {
  content: "−";
}

.rs-faq summary:focus-visible {
  outline-offset: -2px;
}

.rs-faq details p {
  margin: 0;
  padding: 0 18px 16px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #57534e;
}

.rs-faq details p a {
  color: #c2410c;
  font-weight: 600;
}

.rs-faq details p a:hover {
  text-decoration: underline;
}

/* ——— Auth reassurance ——— */
.auth-trust {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-trust li {
  position: relative;
  padding-left: 1.35rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #57534e;
}

.auth-trust li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 800;
  color: #0d9488;
}

.auth-page--learner .auth-trust li::before {
  color: #0d9488;
}

.auth-page--partner .auth-trust li::before {
  color: #c2410c;
}

/* ——— Back to top ——— */
.rs-back-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 900;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(165deg, #f97316, #ea580c);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 32px -8px rgba(234, 88, 12, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.rs-back-top[hidden] {
  display: none !important;
}

.rs-back-top:hover {
  transform: translateY(-2px);
}

.rs-back-top:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

body.rs-home:not(.rs-home--signed-in) .rs-back-top {
  bottom: calc(72px + env(safe-area-inset-bottom));
}

@media (min-width: 640px) {
  body.rs-home:not(.rs-home--signed-in) .rs-back-top {
    bottom: max(20px, env(safe-area-inset-bottom));
  }
}
