:root {
  --teal: #591c31;
  --teal-strong: #72122e;
  --text: #0d293d;
  --muted: #5f7385;
  --surface: #ffffff;
  --border: #dbe2ea;
  --shadow: 0 24px 60px rgba(13, 41, 61, 0.15);
}

* {
  box-sizing: border-box;
}

body.auth {
  margin: 0;
  min-height: 100vh;
  background: #f5f5f7;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.auth-hero {
  padding: clamp(64px, 14.7vw, 99px) 24px 80px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background-color: #fbf8f8;
  background-image: var(--auth-background);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.auth-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(89, 28, 49, 0.08);
  border-radius: 26px;
  padding: 42px 34px 44px;
  box-shadow: 0 22px 46px rgba(45, 35, 39, 0.13);
  display: grid;
  gap: 24px;
  backdrop-filter: blur(3px);
  width: 468px;
}

.auth-card--welcome {
  min-height: 565px;
  width: 438px;
}

.brand {
  text-align: center;
  display: flex;
  justify-content: center;
}

.logo-image {
  width: 15vh;
  height: auto;
  object-fit: contain;
  display: block;
}

.auth__content {
  display: grid;
  gap: 12px;
}

.auth__content h2:not(.auth__intro) {
  margin: 0;
  text-align: center;
  color: #161222;
  font-size: 63px;
  font-weight: 800;
  line-height: 1.1;
  font-family: "Ms Madi", cursive;
}

.auth__intro {
  margin: 0 0 8px;
  color: #655f63;
  text-align: center;
  font-size: 17px;
  line-height: 1.45;
}

.back-link {
  color: var(--teal);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.auth-mode-buttons {
  display: grid;
  gap: 12px;
}

.login-link-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  border-radius: 18px;
}

.login-link-panel img {
  width: 72px;
  height: 72px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: #eef3f6;
  padding: 6px;
  border-radius: 14px;
  gap: 6px;
  background-color: rgba(89, 27, 49, 0.4);
  color: #581d31;
}

.tab {
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  padding: 10px;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab.is-active {
  background: #fff;
  color: #591c31;
  box-shadow: 0 10px 24px rgba(13, 41, 61, 0.08);
}

.form {
  display: none;
  gap: 12px;
}

.form.is-active {
  display: grid;
  width: 53vh;
}

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.field:focus-within {
  border-color: var(--teal);
  box-shadow: 0 10px 30px rgba(89, 28, 49, 0.1);
}

.field__icon {
  font-size: 18px;
}

.field input {
  flex: 1;
  border: none;
  font-size: 15px;
  background: transparent;
  outline: none;
  color: var(--text);
}

.field input::placeholder {
  color: #c6c6c6;
}

/* Keep autofilled access and registration fields on a white surface. */
body.auth input:-webkit-autofill,
body.auth input:-webkit-autofill:hover,
body.auth input:-webkit-autofill:focus,
body.auth input:-webkit-autofill:active,
body.auth select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}

body.auth input:autofill,
body.auth select:autofill {
  box-shadow: 0 0 0 1000px #fff inset;
}

.field select {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  color: var(--text);
  outline: none;
  appearance: none;
}

#register .segmented-date__controls {
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 6px;
}

#register .segmented-date__part:last-child {
  grid-column: auto;
}

#register .segmented-date__part select {
  padding: 9px 20px 9px 7px;
  color: var(--text);
  font-size: 13px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%235f7385' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

.field--checkbox {
  align-items: flex-start;
  gap: 8px;
}

.field--checkbox input[type="checkbox"] {
  margin-top: 3px;
  flex: 0 0 auto;
}


.field__hint {
  margin: -4px 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.field__error {
  margin: -4px 0 4px;
  color: #c0392b;
  font-size: 12px;
  font-weight: 600;
}

.form__messages {
  display: grid;
  gap: 8px;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
  background: #eef3f6;
  color: var(--text);
  border: 1px solid var(--border);
}

.alert--success {
  background: #f0fbf7;
  border-color: #bfe6d8;
  color: #0f5a55;
}

.alert--error {
  background: #fff5f3;
  border-color: #f1c7bf;
  color: #a03a2d;
}

.form__footer {
  display: flex;
  justify-content: flex-end;
}

.link {
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.link:hover {
  text-decoration: underline;
}

.btn {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.btn--primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 16px 35px rgba(89, 28, 49, 0.22);
}

.btn--primary:hover {
  background: var(--teal-strong);
  transform: translateY(-1px);
}

.separator {
  display: grid;
  place-items: center;
  color: #9babb8;
  font-size: 18px;
}

.separator .dot {
  display: inline-block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eef3f6;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.btn--google {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  box-shadow: 0 14px 40px rgba(13, 41, 61, 0.08);
}

.btn--access-option {
  min-height: 69px;
  justify-content: flex-start;
  position: relative;
  padding: 9px 52px 9px 16px;
  border-color: #ead6dc;
  color: #591c31;
  text-align: left;
  box-shadow: 0 9px 20px rgba(89, 28, 49, 0.07);
}

.btn--access-option::after {
  content: "›";
  position: absolute;
  right: 20px;
  top: 50%;
  color: #72122e;
  font-size: 31px;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-53%);
}

.btn__icon-wrap {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;

}

.btn__icon,
.btn__icon-wrap svg {
  width: 27px;
  height: 27px;
}

.btn--google:hover {
  transform: translateY(-1px);
}

.google-icon {
  width: 22px;
  height: 22px;
}

@media (max-width: 480px) {
  .auth-hero {
    min-height: 680px;
    padding: 52px 14px 64px;
    background-position: center top;
  }

  .auth-card {
    padding: 30px 20px 34px;
    border-radius: 22px;
  }

  .auth-card--access {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .auth-card--access .auth__content,
  .auth-card--access .login-link-panel {
    width: 100%;
    min-width: 0;
  }

  /*
   * The desktop form uses a viewport-height based width. On short mobile
   * screens that value can be wider than the card's content box, so let the
   * card's grid define the available width instead.
   */
  .auth-card--access .form.is-active {
    width: auto;
    max-width: 100%;
    min-width: 0;
    align-self: stretch;
  }

  .auth-card--access .field,
  .auth-card--access .btn,
  .auth-card--access .tabs {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .auth-card--access .field input {
    min-width: 0;
  }

  .auth-card--access .login-link-panel p,
  .auth-card--access .form__footer .link {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .auth-card--welcome {
    min-height: 0;
  }

  .auth__content h2:not(.auth__intro) {
    font-size: 32px;
  }

  .auth__intro {
    font-size: 15px;
  }

  .btn--access-option {
    min-height: 62px;
    padding-left: 12px;
    font-size: 14px;
  }

  .btn__icon-wrap {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }

  .tab {
    font-size: 13px;
  }
}
