/* Sunrise AI — technical support form
   Tokens follow the Sunrise Business design system (warm neutrals, Sunrise
   red, Figtree, 12px cards, 25px pills). */

:root {
  --sr-red: #DA291C;
  --sr-red-hover: #E6003C;
  --sr-white: #FFFFFF;
  --sr-ink: #3D3935;
  --sr-ink-2: #575452;
  --sr-ink-3: #5F5955;
  --sr-ink-4: #86807C;
  --sr-divider: #B3AEAA;
  --sr-border: #E6E3DF;
  --sr-surface: #F7F6F5;

  --focus-ring: rgba(218, 41, 28, 0.35);
  --shadow-sm: 0 2px 4px 0 rgba(87, 84, 82, 0.20);
  --shadow-md: 0 4px 16px 0 rgba(0, 0, 0, 0.08);

  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 25px;

  --font-sans: "Figtree", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.sr {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  color: var(--sr-ink);
  background: var(--sr-surface);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--sr-red); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }

.small { font-size: 14px; line-height: 20px; }
.muted { color: var(--sr-ink-2); }
.lead { font-size: 18px; line-height: 26px; font-weight: 500; }

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--sr-white);
  box-shadow: var(--shadow-sm);
}
.topbar__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--sr-ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand__logo { display: block; width: auto; height: 46px; }
.brand__divider { width: 1px; height: 36px; background: var(--sr-border); }
.brand__name { font-size: 20px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em; }

.topbar__right { display: flex; align-items: center; gap: 20px; }

.swiss {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--sr-ink-2);
  white-space: nowrap;
}

.lang { display: inline-flex; border: 1px solid var(--sr-border); border-radius: var(--r-pill); padding: 2px; background: var(--sr-white); }
.lang__btn {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  color: var(--sr-ink-2);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.lang__btn[aria-pressed="true"] { background: var(--sr-ink); color: var(--sr-white); }
.lang__btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }

/* ------------------------------------------------------------------ page */

.page {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.intro { max-width: 720px; margin-bottom: 28px; }
.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 20px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--sr-red);
}
.intro__title { margin: 0 0 12px; font-size: 32px; line-height: 40px; font-weight: 700; }
.intro__lead { margin: 0; color: var(--sr-ink-2); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.card {
  background: var(--sr-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
}

/* ------------------------------------------------------------------ form */

.group { border: 0; margin: 0 0 8px; padding: 0; min-width: 0; }
.group + .group { margin-top: 20px; padding-top: 28px; border-top: 1px solid var(--sr-border); }
.group__title { padding: 0; margin: 0 0 16px; font-size: 20px; line-height: 28px; font-weight: 700; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.grid .field { margin-bottom: 0; }
.grid { margin-bottom: 16px; }

.label { font-size: 14px; line-height: 20px; font-weight: 700; color: var(--sr-ink); }
.req { color: var(--sr-red); }
.hint { margin: 0; font-size: 13px; line-height: 18px; color: var(--sr-ink-4); }
.error { margin: 0; font-size: 13px; line-height: 18px; color: var(--sr-red); font-weight: 500; }

.input {
  width: 100%;
  font: inherit;
  color: var(--sr-ink);
  background: var(--sr-white);
  border: 1px solid var(--sr-divider);
  border-radius: var(--r-md);
  padding: 11px 14px;
  line-height: 24px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--sr-ink-4); }
.input:hover { border-color: var(--sr-ink-4); }
.input:focus { outline: none; border-color: var(--sr-red); box-shadow: 0 0 0 3px var(--focus-ring); }
.input[aria-invalid="true"] { border-color: var(--sr-red); }
.textarea { resize: vertical; min-height: 96px; }

.select-wrap { position: relative; }
.select { appearance: none; padding-right: 40px; cursor: pointer; }
.select-wrap__chevron { position: absolute; right: 12px; top: 50%; width: 20px; height: 20px; margin-top: -10px; color: var(--sr-ink-2); pointer-events: none; }

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--sr-divider);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--sr-white);
}
.segmented__item { position: relative; }
.segmented__item + .segmented__item { border-left: 1px solid var(--sr-border); }
.segmented__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented__label {
  display: block;
  text-align: center;
  padding: 10px 8px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--sr-ink-2);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.segmented__label:hover { background: var(--sr-surface); }
.segmented__input:checked + .segmented__label { background: var(--sr-ink); color: var(--sr-white); }
.segmented__input[value="critical"]:checked + .segmented__label { background: var(--sr-red); }
.segmented__input:focus-visible + .segmented__label { box-shadow: inset 0 0 0 2px var(--focus-ring); }

.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--sr-border);
}
.form__footer .small { margin: 0; max-width: 420px; }

.alert {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: rgba(218, 41, 28, 0.06);
  border: 1px solid rgba(218, 41, 28, 0.35);
  color: var(--sr-ink);
  font-size: 14px;
  line-height: 20px;
}

/* --------------------------------------------------------------- buttons */

.sr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 14px 28px;
  border: 0;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.sr-btn:hover { text-decoration: none; }
.sr-btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.sr-btn--primary { background: var(--sr-red); color: var(--sr-white); }
.sr-btn--primary:hover { background: var(--sr-red-hover); }
.sr-btn--primary:active { transform: translateY(1px); }
.sr-btn--primary[disabled] { opacity: .7; cursor: progress; }
.sr-btn--ghost { background: transparent; color: var(--sr-red); box-shadow: inset 0 0 0 1px var(--sr-red); }
.sr-btn--ghost:hover { background: rgba(218, 41, 28, 0.06); }

.btn__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: var(--sr-white);
  animation: spin .8s linear infinite;
}
.is-busy .btn__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------- success */

.success { text-align: center; padding: 48px 32px; }
.success__icon { width: 64px; height: 64px; margin: 0 auto 16px; color: var(--sr-red); }
.success__icon svg { width: 100%; height: 100%; }
.success__title { margin: 0 0 8px; font-size: 28px; line-height: 36px; }
.success__text { margin: 0 auto 20px; max-width: 520px; color: var(--sr-ink-2); }
.reference {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  padding: 10px 16px;
  background: var(--sr-surface);
  border-radius: var(--r-md);
}
.reference__label { font-size: 14px; color: var(--sr-ink-2); }
.reference code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 16px; font-weight: 700; letter-spacing: .04em; }
.success__actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ side */

.side { display: flex; flex-direction: column; gap: 16px; }
.side__block { background: var(--sr-white); border: 1px solid var(--sr-border); border-radius: var(--r-lg); padding: 20px; }
.side__block--critical { background: transparent; border-color: var(--sr-divider); }
.side__title { margin: 0 0 10px; font-size: 16px; line-height: 24px; font-weight: 700; }
.side__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 20px; }
.side__list--checks li { position: relative; padding-left: 24px; color: var(--sr-ink-2); }
.side__list--checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sr-red);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1.2 14.4-4-4 1.7-1.7 2.3 2.3 5.3-5.3 1.7 1.7-7 7Z'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-1.2 14.4-4-4 1.7-1.7 2.3 2.3 5.3-5.3 1.7 1.7-7 7Z'/></svg>") center/contain no-repeat;
}
.side__block .small { margin: 0; color: var(--sr-ink-2); }

/* ---------------------------------------------------------------- footer */

.footer { background: var(--sr-ink); color: var(--sr-border); font-size: 14px; line-height: 20px; }
.footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer a { color: var(--sr-white); font-weight: 500; }
.footer__links { display: inline-flex; gap: 20px; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { order: 2; }
}

@media (max-width: 640px) {
  .topbar__inner { padding: 10px 16px; }
  .page { padding: 28px 16px 48px; }
  .intro__title { font-size: 28px; line-height: 36px; }
  .card { padding: 24px 20px; }
  .grid { grid-template-columns: 1fr; }
  .segmented { grid-template-columns: 1fr 1fr; }
  .segmented__item:nth-child(3) { border-left: 0; }
  .segmented__item:nth-child(n+3) { border-top: 1px solid var(--sr-border); }
  .form__footer { flex-direction: column; align-items: stretch; }
  .form__footer .sr-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
