:root {
  --ink: var(--brand-ink);
  --ink-soft: var(--brand-muted);
  --navy: var(--brand-ink);
  --navy-deep: var(--brand-ink);
  --blue: var(--brand-accent);
  --blue-dark: var(--brand-accent-hover);
  --sky: var(--brand-soft);
  --mint: var(--brand-accent);
  --paper: var(--brand-surface);
  --canvas: var(--brand-paper);
  --line: var(--brand-line);
  --danger: var(--brand-danger);
  --success: var(--brand-success);
  --shadow: var(--brand-shadow);
  font-family: var(--brand-font);
  color: var(--ink);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--brand-paper);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #fff;
  background: var(--navy);
  font-size: var(--type-small);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(var(--brand-ink-rgb), 0.2);
  transform: translateY(calc(-100% - 20px));
  transition: transform 120ms ease;
}

.skip-link:focus {
  color: #fff;
  transform: translateY(0);
}

.registration-shell {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(560px, 1.1fr);
  min-height: 100vh;
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100vh;
  padding: 36px clamp(28px, 4.5vw, 72px) 30px;
  color: var(--brand-ink);
  background: radial-gradient(ellipse at 10% 30%, rgba(var(--brand-accent-rgb), .06), transparent 65%), var(--brand-paper);
  border-right: 1px solid var(--brand-line);
}

.brand-copy {
  z-index: 1;
  width: min(100%, 560px);
  margin: auto 0;
  padding: 56px 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: var(--type-caption);
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand-copy .eyebrow {
  color: var(--mint);
}

.brand-copy h1 {
  margin: 0;
  color: var(--brand-ink);
  font-size: clamp(2.35rem, 4.2vw, 4.7rem);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.brand-intro {
  max-width: 540px;
  margin: 28px 0 0;
  color: var(--brand-muted);
  font-size: clamp(1rem, 1.25vw, 1.18rem);
  line-height: 1.65;
}

.benefit-list {
  display: grid;
  gap: 20px;
  margin: 42px 0 0;
  padding: 0;
  list-style: none;
}

.benefit-list li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
  color: var(--brand-muted);
  font-size: 0.93rem;
  line-height: 1.45;
}

.benefit-list strong {
  display: block;
  margin-bottom: 2px;
  color: var(--brand-ink);
  font-size: 0.98rem;
}

.benefit-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(var(--brand-accent-rgb), 0.32);
  border-radius: 12px;
  color: var(--mint);
  background: rgba(var(--brand-accent-rgb), 0.07);
  font-size: var(--type-caption);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.brand-footnote {
  z-index: 1;
  margin: 0;
  color: var(--brand-muted);
  font-size: var(--type-small);
}

.form-panel {
  display: grid;
  min-height: 100vh;
  padding: 42px clamp(24px, 4vw, 64px);
  place-items: center;
}

.form-wrap {
  width: min(100%, 520px);
  padding: 36px;
  border: 1px solid var(--brand-line);
  border-radius: var(--brand-radius);
  background: var(--brand-surface);
  box-shadow: var(--brand-shadow);
}

.setup-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 48px;
  padding: 0;
  color: var(--brand-muted);
  font-size: var(--type-small);
  font-weight: 700;
  letter-spacing: 0.05em;
  list-style: none;
  text-transform: uppercase;
}

.setup-progress li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 2px solid var(--line);
}

.setup-progress li.is-current {
  color: var(--blue);
  border-color: var(--blue);
}

.setup-progress span {
  display: grid;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: var(--type-caption);
}

.form-wrap h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.form-intro {
  margin: 14px 0 30px;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.6;
}

.form-alert {
  margin-bottom: 22px;
  padding: 13px 15px;
  border: 1px solid #f4b9b3;
  border-radius: 12px;
  color: var(--danger);
  background: #fff5f4;
  font-size: 0.88rem;
  line-height: 1.45;
}

.field-group {
  margin-bottom: 20px;
}

.field-group label {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: var(--type-small);
  font-weight: 700;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.text-button {
  padding: 3px 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: var(--type-small);
  font-weight: 700;
  cursor: pointer;
}

.field-group input,
.field-group select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--brand-line);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field-group input::placeholder {
  color: var(--brand-muted);
}

.field-group input:hover,
.field-group select:hover {
  border-color: var(--brand-muted);
}

.field-group input:focus,
.field-group select:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(var(--brand-accent-rgb), 0.12);
}

.field-group input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  min-height: 16px;
  margin: 5px 2px 0;
  color: var(--danger);
  font-size: var(--type-small);
  line-height: 1.35;
}

.password-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 14px;
  margin: 10px 2px 0;
  padding: 0;
  color: var(--brand-muted);
  font-size: var(--type-small);
  list-style: none;
}

.password-rules li::before {
  content: "○";
  margin-right: 6px;
}

.password-rules li.is-valid {
  color: var(--success);
}

.password-rules li.is-valid::before {
  content: "✓";
}

.primary-button,
.secondary-button {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 10px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button {
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
  box-shadow: none;
}

.primary-button:hover:not(:disabled) {
  background: var(--blue-dark);
  box-shadow: 0 5px 15px rgba(var(--brand-ink-rgb), .08);
  transform: none;
}

.primary-button:disabled {
  opacity: 0.62;
  cursor: wait;
}

.button-arrow {
  font-size: 1.15rem;
}

.security-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 17px 0 0;
  color: var(--brand-muted);
  font-size: var(--type-small);
  line-height: 1.5;
}

.security-note span {
  color: var(--success);
  font-size: 1rem;
  line-height: 1;
}

.legal-note {
  margin: 17px 0 0;
  color: var(--brand-muted);
  font-size: var(--type-small);
  line-height: 1.55;
  text-align: center;
}

.legal-note a {
  color: var(--blue-dark);
  font-weight: 700;
  text-underline-offset: 3px;
}

.legal-note span {
  margin: 0 5px;
}

.account-switch {
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: var(--type-small);
  text-align: center;
}

.account-switch a {
  color: var(--blue-dark);
  font-weight: 700;
  text-underline-offset: 3px;
}

.confirmation-view {
  padding: 44px 0;
  text-align: center;
}

.confirmation-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  place-items: center;
  border-radius: 22px;
  color: var(--success);
  background: #daf7ef;
  font-size: 1.7rem;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(8, 120, 95, 0.12);
}

.confirmation-view > p:not(.eyebrow) {
  max-width: 440px;
  margin: 18px auto 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.confirmation-view strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.confirmation-view .confirmation-help {
  font-size: var(--type-small);
}

.secondary-button {
  width: auto;
  min-width: 220px;
  margin: 30px auto 0;
  border: 1px solid var(--brand-line);
  color: var(--ink);
  background: #fff;
}

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

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--brand-accent-hover);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 940px) {
  .registration-shell {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: auto;
    padding: 28px clamp(24px, 7vw, 58px) 38px;
  }

  .brand-copy {
    padding: 68px 0 32px;
  }

  .brand-copy h1 {
    max-width: 680px;
  }

  .benefit-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .benefit-list li {
    grid-template-columns: 1fr;
  }

  .brand-footnote {
    display: none;
  }

  .form-panel {
    min-height: auto;
    padding-top: 56px;
    padding-bottom: 72px;
  }
}

@media (max-width: 640px) {
  .brand-copy {
    padding-top: 52px;
  }

  .brand-copy h1 br {
    display: none;
  }

  .benefit-list {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .benefit-list li {
    grid-template-columns: 38px 1fr;
  }

  .form-panel {
    padding: 42px 20px 60px;
  }

  .setup-progress {
    margin-bottom: 38px;
  }

  .password-rules {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 940px) {
  .brand-panel { border-right: 0; border-bottom: 1px solid var(--brand-line); }
  .brand-copy { padding: 34px 0 0; }
  .brand-copy h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
  .brand-intro { margin-top: 18px; }
  .brand-panel .benefit-list, .brand-panel .login-trust, .brand-panel .verification-trust, .brand-panel .connection-trust, .brand-panel .finish-trust { display: none; }
  .form-panel { padding-top: 28px; }
}
@media (max-width: 520px) {
  .brand-panel { padding: 24px 20px; }
  .brand-copy h1 { font-size: 2rem; }
  .form-panel { padding: 24px 16px 40px; }
  .form-wrap { padding: 24px 20px; }
  .setup-progress { font-size: var(--type-small); gap: 8px; }
}
@media (max-width: 520px) {
  .setup-progress li { flex-direction: column; align-items: flex-start; gap: 6px; letter-spacing: 0; }
}

/* Account management shares the existing brand and remains usable on narrow screens. */
.account-page .form-wrap a,
.account-page .brand-panel > a:not(.brand) { color: var(--brand-accent); }
.account-page .form-wrap li { margin-block: 10px; overflow-wrap: anywhere; }
.account-page .form-wrap dt { margin-top: 12px; font-weight: 650; }
.account-page .form-wrap dd { margin: 4px 0 12px; color: var(--brand-muted); }
.account-page select { max-width: 100%; }
.account-page #mfa-codes { font-size: var(--type-small); }

/* Shared controls on authenticated account and support pages. */
.account-page button:not(.primary-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .7rem 1rem;
  margin: .25rem .15rem .25rem 0;
  border: 1px solid var(--line, #d8d5ce);
  border-radius: 12px;
  background: #fff;
  color: var(--accent, #a84f39);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.account-page button:not(.primary-button):hover { background: #f7f0eb; }
.account-page button:disabled { opacity: .6; cursor: wait; }
.account-page input[type="checkbox"] {
  display: inline-block;
  width: 1.1rem;
  min-height: 1.1rem;
  height: 1.1rem;
  margin-right: .45rem;
  accent-color: #a84f39;
  vertical-align: middle;
}
.account-page fieldset {
  min-width: 0;
  padding: 1rem;
  margin: 1rem 0;
  border: 1px solid #ded9d1;
  border-radius: 12px;
}
.account-page fieldset label { line-height: 1.65; overflow-wrap: anywhere; }
.account-page article { margin: 1rem 0; padding: 1rem 0; border-top: 1px solid #e4dfd8; }
.account-page article h4 { margin-top: 0; overflow-wrap: anywhere; }
.account-page h3 { margin-top: 1.8rem; }

.account-page textarea, .slack-connection textarea {
  display: block; width: 100%; min-height: 7rem; padding: .85rem 1rem;
  font: inherit; line-height: 1.5; color: var(--ink, #203540); background: #fff;
  border: 1px solid #d7d8d3; border-radius: 14px; resize: vertical;
}
.account-page textarea:focus-visible, .slack-connection textarea:focus-visible { outline: 3px solid #ac503b; outline-offset: 2px; }

:is(.slack-connection, .whatsapp-connection) { min-width: 0; margin-block: 1.25rem; padding: 1.5rem; border: 1px solid var(--border, #dedbd5); border-radius: 1.25rem; background: #fff; }
:is(.slack-connection, .whatsapp-connection) p { overflow-wrap: anywhere; }
:is(.slack-connection, .whatsapp-connection) input { box-sizing: border-box; width: 100%; min-width: 0; }
:is(.slack-actions, .connection-actions) { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: flex-start; gap: .75rem; margin-block: 1rem; }
/* Keep connection controls together; generic secondary buttons use auto margins. */
:is(.slack-connection, .whatsapp-connection) :is(button, a.action-control) { width: auto; min-width: 0; max-width: 100%; min-height: 44px; margin: 0; white-space: normal; }
:is(.slack-actions, .connection-actions) > :is(button, a.action-control) { display: inline-flex; align-items: center; justify-content: center; padding: 12px 18px; line-height: 1.4; }
:is(.slack-actions, .connection-actions) > .text-button { border: 1px solid var(--brand-line); border-radius: 10px; color: var(--brand-accent); background: var(--brand-surface); font-size: 1rem; }
:is(.slack-actions, .connection-actions) > .text-button:hover { border-color: var(--brand-accent); background: var(--brand-paper); }
:is(.slack-connection, .whatsapp-connection) button:disabled { opacity: .6; cursor: wait; }
:is(.slack-connection, .whatsapp-connection) [hidden] { display: none !important; }
@media (max-width: 560px) {
  :is(.slack-actions, .connection-actions) > :is(button, a.action-control) { flex: 1 1 100%; width: 100%; }
}

.whatsapp-connection a { color: var(--brand-accent); text-underline-offset: 3px; }
