* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #111936;
  background:
    radial-gradient(circle at 12% 10%, rgba(10, 156, 166, .14), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(98, 67, 230, .12), transparent 30%),
    #ffffff;
  font-family: Inter, Arial, sans-serif;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px 18px;
}

.register-card {
  width: min(680px, 100%);
  padding: 42px;
  border: 1px solid #e3e7f2;
  border-radius: 26px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 24px 70px rgba(27, 37, 80, .12);
}

.brand {
  display: block;
  width: fit-content;
  margin: 0 auto 22px;
}

.brand img {
  width: 280px;
  max-width: 80vw;
  display: block;
}

.intro {
  text-align: center;
  margin-bottom: 30px;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 6vw, 50px);
  line-height: 1.05;
}

.intro p {
  margin: 14px auto 0;
  max-width: 470px;
  color: #4d5875;
  font-size: 17px;
  line-height: 1.5;
}

form {
  display: grid;
  gap: 18px;
}

label,
legend {
  color: #18213d;
  font-weight: 800;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 8px;
  padding: 0 14px;
  border: 1px solid #d9dfed;
  border-radius: 12px;
  color: #111936;
  background: #eef4ff;
  font-size: 16px;
}

input:focus {
  outline: 3px solid rgba(87, 57, 232, .18);
  border-color: #5739e8;
}

fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 18px;
  border: 1px solid #dfe5f3;
  border-radius: 16px;
  background: #f8faff;
}

legend {
  padding: 0 6px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #303b5d;
}

.choice input {
  width: 18px;
  height: 18px;
}

button {
  height: 52px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #0d58bd, #5739e8);
  box-shadow: 0 14px 30px rgba(87, 57, 232, .24);
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

button:disabled {
  opacity: .6;
  cursor: wait;
}

.status {
  min-height: 24px;
  margin: 0;
  text-align: center;
  color: #5739e8;
  font-weight: 800;
}

.status.error {
  color: #b42318;
}

.small {
  margin: 26px 0 0;
  color: #68738e;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 620px) {
  .register-card {
    padding: 28px 20px;
  }

  .brand img {
    width: 220px;
  }
}

form label {
  display: block;
}

form label input {
  margin-bottom: 2px;
}

/* Compact register layout */

.page {
  padding: 18px;
  align-items: start;
}

.register-card {
  width: min(560px, 100%);
  padding: 24px 30px;
  border-radius: 20px;
}

.brand {
  margin-bottom: 10px;
}

.brand img {
  width: 200px;
}

.intro {
  margin-bottom: 18px;
}

h1 {
  font-size: clamp(30px, 4vw, 40px);
}

form {
  gap: 12px;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  height: 42px;
  margin-top: 5px;
  border-radius: 10px;
  font-size: 15px;
}

fieldset {
  gap: 7px;
  padding: 12px 14px;
  border-radius: 12px;
}

.choice input {
  width: 16px;
  height: 16px;
}

button {
  height: 46px;
  font-size: 16px;
}

.small {
  margin-top: 14px;
  font-size: 12px;
}

/* Extra compact height */

.page {
  padding: 10px 18px;
}

.register-card {
  padding: 18px 28px;
}

.brand img {
  width: 170px;
}

.intro {
  margin-bottom: 12px;
}

h1 {
  font-size: 32px;
}

form {
  gap: 9px;
}

label,
legend {
  font-size: 14px;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  height: 38px;
  margin-top: 4px;
  font-size: 14px;
}

fieldset {
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 12px;
  padding: 10px 12px;
}

fieldset legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

.choice {
  gap: 7px;
  font-size: 13px;
}

.choice input {
  width: 14px;
  height: 14px;
}

button {
  height: 42px;
  margin-top: 2px;
}

.status {
  min-height: 18px;
  font-size: 13px;
}

.small {
  display: none;
}

/* No-scroll desktop register */

@media (min-width: 760px) {
  .page {
    min-height: 100vh;
    padding: 6px 18px;
    place-items: start center;
  }

  .register-card {
    width: min(700px, 100%);
    padding: 12px 34px 14px;
    border-radius: 18px;
  }

  .brand {
    margin-bottom: 4px;
  }

  .brand img {
    width: 145px;
  }

  .intro {
    margin-bottom: 8px;
  }

  h1 {
    font-size: 34px;
    line-height: 1;
  }

  form {
    gap: 6px;
  }

  label,
  legend {
    font-size: 13px;
    line-height: 1.15;
  }

  input[type="email"],
  input[type="password"],
  input[type="text"] {
    height: 34px;
    margin-top: 3px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 14px;
  }

  fieldset {
    display: grid;
    grid-template-columns: repeat(4, auto);
    align-items: center;
    gap: 7px 16px;
    padding: 8px 12px;
    border-radius: 11px;
  }

  fieldset legend {
    grid-column: 1 / -1;
    margin-bottom: 2px;
    font-size: 13px;
  }

  .choice {
    gap: 6px;
    font-size: 12px;
    white-space: nowrap;
  }

  .choice input {
    width: 13px;
    height: 13px;
  }

  button {
    height: 38px;
    margin-top: 2px;
    font-size: 14px;
  }

  .status {
    min-height: 14px;
    font-size: 12px;
  }
}

/* Header logo + title in one row */

@media (min-width: 760px) {
  .register-card {
    padding-top: 20px;
  }

  .brand {
    position: absolute;
    margin: 0;
    transform: translate(-86px, 1px);
  }

  .brand img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    object-position: left center;
    border-radius: 50%;
  }

  .intro {
    position: relative;
    width: fit-content;
    margin: 0 auto 12px;
  }

  .intro h1 {
    font-size: 40px;
    line-height: 1.05;
  }
}

/* Fix register header layout */

@media (min-width: 760px) {
  .register-card {
    position: relative;
  }

  .brand {
    position: static;
    display: inline-flex;
    vertical-align: middle;
    margin: 0 18px 0 0;
    transform: none;
  }

  .brand img {
    width: 74px;
    height: 74px;
    object-fit: cover;
    object-position: left center;
    border-radius: 50%;
  }

  .intro {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 auto 12px;
  }

  .intro h1 {
    display: inline-flex;
    align-items: center;
    margin: 0;
    font-size: 40px;
  }

  .register-card > .brand {
    display: none;
  }

  .intro::before {
    content: "";
    width: 74px;
    height: 74px;
    margin-right: 18px;
    border-radius: 50%;
    background-image: url("/logo.png");
    background-size: 180px auto;
    background-position: left center;
    background-repeat: no-repeat;
    flex: 0 0 74px;
  }
}

/* Hide logo wordmark crop */

@media (min-width: 760px) {
  .intro::before {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    background-size: 150px auto;
    background-position: left center;
    overflow: hidden;
  }
}

/* Use clean logo icon */

@media (min-width: 760px) {
  .intro::before {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    margin-right: 18px;
    background-image: url("/logo-icon.png");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0;
  }
}
