:root {
  color: #172b4d;
  background: #fff;
  font: 16px Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #fff;
  overflow-y: auto;
  scrollbar-width: none;
}

html {
  min-width: 320px;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar { width: 0; height: 0; }

button, input, select { font: inherit; }

.topbar {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px max(24px, calc((100vw - 980px) / 2));
  color: #fff;
  background: #3b5998;
}

.brand {
  flex: 0 0 auto;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 25px;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1;
  text-decoration: none;
}

.login-form {
  display: grid;
  grid-template-columns: minmax(150px, 200px) minmax(145px, 180px) auto;
  align-items: center;
  gap: 8px;
}

.login-form label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.login-form input {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
  height: 28px;
  padding: 4px 7px;
  border: 1px solid #263d65;
  border-radius: 1px;
  color: #172b4d;
  background: #fff;
}

.login-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-code-step {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}

.password-recovery-step {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}

.password-recovery-step p {
  flex-basis: 100%;
  margin: 0;
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
}

.password-recovery-step label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.password-recovery-step input {
  width: 150px;
  height: 28px;
  padding: 4px 7px;
  border: 1px solid #263d65;
  border-radius: 1px;
}

.password-recovery-step > button:not(.recovery-link) {
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid #294776;
  border-radius: 2px;
  color: #fff;
  background: #5275b2;
  font-weight: 700;
  cursor: pointer;
}

.password-recovery-step > button:disabled {
  cursor: wait;
  opacity: .7;
}

.login-form.is-recovering {
  grid-template-columns: minmax(150px, 200px) auto;
}

.login-code-step > button[type="submit"],
.user-controls > button {
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid #294776;
  border-radius: 2px;
  color: #fff;
  background: #5275b2;
  font-weight: 700;
  cursor: pointer;
}

.user-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: #fff;
  font-size: 13px;
}

.user-identity {
  display: grid;
  gap: 3px;
}

.user-identity #user-label { font-weight: 700; }
.user-identity .user-email { color: #dbe5f5; font-size: 11px; }

.user-controls .login-message {
  flex-basis: 100%;
}

.login-actions button:first-child {
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid #294776;
  border-radius: 2px;
  color: #fff;
  background: #5275b2;
  font-weight: 700;
  cursor: pointer;
}

.recovery-link {
  padding: 0;
  border: 0;
  color: #dbe5f5;
  background: transparent;
  font-size: 11px;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}

.login-message {
  grid-column: 1 / -1;
  min-height: 0;
  margin: 0;
  color: #fff;
  font-size: 12px;
}

.main {
  width: min(calc(100% - 48px), 980px);
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: start;
  gap: 46px;
  margin: 0 auto;
  padding: 30px 0 48px;
}

.main.is-signed-in { grid-template-columns: minmax(0, 1fr); }

.intro { padding-top: 12px; }

.intro h1 {
  max-width: 510px;
  margin: 0 0 22px;
  color: #263b5e;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
}

.network-map {
  display: block;
  width: min(100%, 500px);
  height: auto;
  margin-top: 4px;
}

.signup h2 {
  margin: 0;
  color: #172b4d;
  font-size: 32px;
  line-height: 1.15;
}

.signup-subtitle {
  margin: 8px 0 17px;
  color: #33445f;
  font-size: 17px;
}

#signup-form {
  display: grid;
  gap: 10px;
}

#signup-details {
  display: grid;
  gap: 10px;
}

.names {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#signup-form label.field,
.names > label {
  display: grid;
  gap: 4px;
  color: #465875;
  font-size: 12px;
}

#signup-form input:not([type="radio"]) {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 8px 10px;
  border: 1px solid #aeb9c9;
  border-radius: 2px;
  color: #172b4d;
  background: #fff;
}

#signup-form input::placeholder { color: #68778e; }

#signup-form input:focus,
#signup-form select:focus,
.login-form input:focus {
  outline: 2px solid #587bb8;
  outline-offset: 1px;
}

.birth-date, .gender {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.birth-date legend, .gender legend {
  margin-bottom: 6px;
  color: #465875;
  font-size: 13px;
}

.date-selects {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 7px;
}

.date-selects select {
  min-width: 0;
  height: 34px;
  padding: 4px 6px;
  border: 1px solid #aeb9c9;
  border-radius: 2px;
  color: #263b5e;
  background: #fff;
  font-size: 13px;
}

.gender-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: #263b5e;
  font-size: 13px;
}

.gender-options label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
}

.gender-options input { margin: 0; }

.consent {
  max-width: 375px;
  margin: 1px 0 0;
  color: #68778e;
  font-size: 11px;
  line-height: 1.4;
}

.signup-button {
  width: fit-content;
  min-width: 190px;
  margin-top: 2px;
  padding: 9px 20px;
  border: 1px solid #3b7f3e;
  border-radius: 3px;
  color: #fff;
  background: #4b984c;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.signup-button:hover { background: #418542; }

.signup-submit-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.signup-code-step {
  display: grid;
  gap: 10px;
}

.signup-code-step p { margin: 0; }

.text-button {
  width: fit-content;
  padding: 0;
  border: 0;
  color: #315c9b;
  background: transparent;
  text-decoration: underline;
  cursor: pointer;
}

.login-form button:disabled,
.signup-button:disabled,
.text-button:disabled,
.user-controls button:disabled {
  opacity: 0.65;
  cursor: wait;
}

#clerk-captcha { margin: 2px 0; }

.message {
  min-height: 18px;
  margin: 10px 0 0;
  color: #34445a;
  font-size: 13px;
}

.clerk-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  color: #687080;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
}

.clerk-badge-icon {
  width: 17px;
  height: 17px;
  margin-left: 2px;
  object-fit: contain;
}

.clerk-wordmark {
  color: #6d7280;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.7px;
}

.clerk-badge:hover .clerk-wordmark { color: #4b5160; }

.clerk-badge:focus-visible {
  outline: 2px solid #587bb8;
  outline-offset: 3px;
}

.login-hint {
  margin: 8px 0 0;
  color: #58677a;
  font-size: 13px;
}

a { color: #315c9b; }

.topbar a { color: #fff; }

.topbar button:focus-visible,
a:focus-visible,
.signup-button:focus-visible {
  outline: 2px solid #172c4e;
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding: 10px 24px;
  }

  .brand { font-size: 25px; }

  .login-form {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 8px;
  }

  .login-form label {
    display: grid;
    align-items: initial;
    gap: 0;
    font-size: 0;
    line-height: 1;
  }

  .login-form input {
    width: 100%;
    height: 27px;
    flex: initial;
    font-size: 12px;
  }

  .login-actions {
    align-self: end;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
  }
  .user-controls { width: 100%; }

  .main {
    width: min(calc(100% - 40px), 540px);
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 28px 0 44px;
  }

  .intro { padding-top: 0; }
  .intro h1 { max-width: 520px; font-size: 24px; }
  .network-map { width: min(100%, 420px); margin: 0 auto; }
  .signup { width: 100%; }
}

@media (max-width: 460px) {
  .topbar { padding: 10px 16px; }

  .login-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 6px;
  }

  .login-actions {
    grid-column: auto;
    gap: 4px;
  }

  .login-actions button:first-child {
    min-height: 27px;
    padding: 4px 7px;
    font-size: 11px;
  }

  .login-actions .recovery-link {
    max-width: none;
    overflow: visible;
    font-size: 9px;
    text-overflow: clip;
    white-space: nowrap;
  }

  .login-code-step { align-items: start; }
  .login-code-step label { flex: 1 1 160px; }

  .main { width: min(calc(100% - 32px), 540px); }
  .intro h1 { font-size: 22px; }
  .signup h2 { font-size: 29px; }
  .names { grid-template-columns: 1fr; }
  .gender-options { gap: 6px 10px; }
  .gender-options label:last-child { width: 100%; }
}

@media (max-width: 350px) {
  .login-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .login-actions { grid-column: 1 / -1; }
  .login-actions .recovery-link {
    font-size: 10px;
    white-space: normal;
  }
}

@media (min-width: 761px) and (min-height: 680px) {
  .main { min-height: calc(100vh - 44px); }
}
