/**
 * ARSO Help Center 2.0 — first-party support surface
 * Apple Support–adjacent calm system UI. Not Master website themes.
 */

:root {
  color-scheme: light dark;

  --color-text-primary: #1d1d1f;
  --color-text-secondary: rgba(29, 29, 31, 0.64);
  --color-text-tertiary: rgba(29, 29, 31, 0.4);
  --color-background-app: #f5f3ef;
  --color-surface: #fffcf8;
  --color-separator: rgba(60, 60, 67, 0.16);
  --color-tint: #0b5fff;
  --color-tint-soft: rgba(11, 95, 255, 0.1);
  --color-focus: #0b5fff;
  --color-note-bg: rgba(11, 95, 255, 0.06);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.03);

  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-64: 64px;

  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, sans-serif;

  --content-max: 44rem;
  --shell-max: 46rem;
  --article-measure: 42rem;
  --topbar-h: 52px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  --motion: 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-text-primary: #f5f5f7;
    --color-text-secondary: rgba(245, 245, 247, 0.64);
    --color-text-tertiary: rgba(245, 245, 247, 0.38);
    --color-background-app: #161618;
    --color-surface: #222226;
    --color-separator: rgba(84, 84, 88, 0.55);
    --color-tint: #5b9dff;
    --color-tint-soft: rgba(91, 157, 255, 0.16);
    --color-focus: #5b9dff;
    --color-note-bg: rgba(91, 157, 255, 0.12);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion: 1ms linear;
  }

  .support-enter,
  .role-card,
  .link-list a,
  .support-cta {
    transition: none !important;
    transform: none !important;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.support-page {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--color-background-app);
  color: var(--color-text-primary);
  line-height: 1.55;
  overflow-x: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: var(--color-tint);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--safe-top);
  z-index: 100;
  padding: var(--space-12) var(--space-16);
  background: var(--color-surface);
  color: var(--color-text-primary);
}

.skip-link:focus {
  left: var(--space-16);
}

.support-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  min-height: calc(var(--topbar-h) + var(--safe-top));
  padding: var(--safe-top) max(var(--space-16), var(--safe-right)) 0
    max(var(--space-16), var(--safe-left));
  background: color-mix(in srgb, var(--color-background-app) 88%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 0.5px solid var(--color-separator);
}

.support-topbar__brand {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-8);
  min-height: 44px;
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 600;
}

.support-topbar__brand:hover {
  text-decoration: none;
}

.support-topbar__mark {
  letter-spacing: 0.05em;
}

.support-topbar__doc {
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
}

.support-topbar__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-4) var(--space-12);
  list-style: none;
  margin: 0;
  padding: 0;
}

.support-topbar__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.support-topbar__nav a[aria-current="page"],
.support-topbar__nav a:hover {
  color: var(--color-text-primary);
}

.support-shell {
  width: min(100%, var(--shell-max));
  margin: 0 auto;
  padding: var(--space-32) max(var(--space-20), var(--safe-left))
    calc(var(--space-64) + var(--safe-bottom)) max(var(--space-20), var(--safe-right));
}

.support-enter {
  animation: support-enter var(--motion) both;
}

@keyframes support-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.support-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  align-items: center;
  margin: 0 0 var(--space-20);
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.support-breadcrumb li:not(:last-child)::after {
  content: "›";
  margin-left: var(--space-8);
  color: var(--color-text-tertiary);
}

.support-breadcrumb a {
  color: var(--color-text-secondary);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.support-breadcrumb [aria-current="page"] {
  color: var(--color-text-primary);
  font-weight: 500;
}

.support-eyebrow {
  margin: 0 0 var(--space-8);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.support-title {
  margin: 0 0 var(--space-12);
  max-width: var(--article-measure);
  font-size: clamp(1.875rem, 1.5rem + 1.6vw, 2.375rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.support-lede {
  margin: 0 0 var(--space-32);
  max-width: 34rem;
  font-size: 1.125rem;
  line-height: 1.45;
  color: var(--color-text-secondary);
}

.support-section {
  margin: 0 0 var(--space-40);
}

.support-section__title {
  margin: 0 0 var(--space-16);
  font-size: 1.125rem;
  font-weight: 600;
}

.article-section h2 {
  margin: 0 0 var(--space-16);
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  scroll-margin-top: calc(var(--topbar-h) + var(--safe-top) + 16px);
}

.article-body {
  max-width: var(--article-measure);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
}

.article-body p {
  margin: 0 0 var(--space-16);
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

.article-toc {
  margin: 0 0 var(--space-32);
  padding: var(--space-16) var(--space-20);
  max-width: var(--article-measure);
  background: var(--color-surface);
  border: 0.5px solid var(--color-separator);
  border-radius: var(--radius-lg);
}

.article-toc__title {
  margin: 0 0 var(--space-8);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.article-toc ol {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--color-text-secondary);
}

.article-toc a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  color: var(--color-text-secondary);
}

.support-list {
  margin: 0 0 var(--space-16);
  padding-left: 1.2rem;
}

.support-list li {
  margin: 0 0 var(--space-8);
}

.support-list li::marker {
  color: var(--color-text-tertiary);
}

.support-note {
  margin: 0 0 var(--space-16);
  padding: var(--space-16) var(--space-20);
  background: var(--color-note-bg);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
}

.support-note p {
  margin: 0;
}

.role-grid {
  display: grid;
  gap: var(--space-12);
}

@media (min-width: 640px) {
  .role-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.role-card {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  min-height: 96px;
  padding: var(--space-20);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 0.5px solid var(--color-separator);
  box-shadow: var(--shadow-card);
  color: inherit;
  text-decoration: none;
  transition: transform var(--motion), border-color var(--motion),
    box-shadow var(--motion);
}

.role-card:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--color-tint) 30%, var(--color-separator));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.role-card:active {
  transform: scale(0.985);
}

.role-card__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--color-tint-soft);
  color: var(--color-tint);
  font-size: 1.125rem;
  line-height: 1;
}

.role-card__body {
  flex: 1 1 auto;
  min-width: 0;
}

.role-card__title {
  margin: 0 0 var(--space-4);
  font-size: 1.0625rem;
  font-weight: 650;
  color: var(--color-text-primary);
}

.role-card__subtitle {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.role-card__chevron {
  flex: 0 0 auto;
  color: var(--color-text-tertiary);
  font-size: 1.35rem;
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--color-separator);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.link-list li + li {
  border-top: 0.5px solid var(--color-separator);
}

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  min-height: 52px;
  padding: var(--space-14, 14px) var(--space-16);
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: background var(--motion);
}

.link-list a:hover {
  background: color-mix(in srgb, var(--color-tint) 6%, transparent);
  text-decoration: none;
}

.link-list a:active {
  transform: scale(0.995);
}

.link-list__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.link-list__title {
  font-weight: 600;
}

.link-list__desc {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  line-height: 1.35;
}

.link-list .meta {
  flex: 0 0 auto;
  color: var(--color-text-tertiary);
  font-weight: 400;
  font-size: 0.875rem;
}

.category-grid {
  display: grid;
  gap: 0;
}

@media (min-width: 720px) {
  .category-grid {
    grid-template-columns: 1fr 1fr;
  }

  .category-grid li:nth-child(2n) {
    border-left: 0.5px solid var(--color-separator);
  }

  .category-grid li:nth-child(-n + 2) {
    border-top: 0;
  }

  .category-grid li {
    border-top: 0.5px solid var(--color-separator);
  }

  .category-grid li:nth-child(1),
  .category-grid li:nth-child(2) {
    border-top: 0;
  }
}

.support-panel {
  background: var(--color-surface);
  border: 0.5px solid var(--color-separator);
  border-radius: var(--radius-xl);
  padding: var(--space-24);
  box-shadow: var(--shadow-card);
  max-width: var(--article-measure);
}

.support-panel p {
  margin: 0 0 var(--space-16);
  color: var(--color-text-secondary);
}

.contact-panel {
  margin-bottom: var(--space-40);
}

.contact-email {
  margin-top: var(--space-8) !important;
  font-size: 1rem;
}

.support-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--space-20);
  border-radius: 999px;
  background: var(--color-text-primary);
  color: var(--color-background-app);
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--motion), transform var(--motion);
}

.support-cta:hover {
  text-decoration: none;
  opacity: 0.92;
}

.support-cta:active {
  transform: scale(0.985);
}

@media (prefers-color-scheme: dark) {
  .support-cta {
    background: #f5f5f7;
    color: #161618;
  }
}

.support-text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-left: var(--space-16);
  color: var(--color-text-secondary);
  font-weight: 500;
}

.support-actions {
  margin: var(--space-24) 0 var(--space-40);
}

.support-footer {
  margin-top: var(--space-48);
  padding-top: var(--space-24);
  border-top: 0.5px solid var(--color-separator);
}

.support-footer__brand {
  margin: 0 0 var(--space-12);
  font-weight: 650;
  letter-spacing: 0.04em;
}

.support-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-16);
  list-style: none;
  margin: 0 0 var(--space-16);
  padding: 0;
}

.support-footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.support-footer__copy {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
}

/* Legacy FAQ details (if any remain) */
.faq {
  display: grid;
  gap: var(--space-12);
}

.faq details {
  background: var(--color-surface);
  border: 0.5px solid var(--color-separator);
  border-radius: var(--radius-lg);
  padding: 0 var(--space-16);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  min-height: 52px;
  display: flex;
  align-items: center;
  font-weight: 600;
  padding: var(--space-12) 0;
}

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

.faq .answer {
  margin: 0 0 var(--space-16);
  color: var(--color-text-secondary);
}
