/* ---- Fonts -------------------------------------------------------------- */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../assets/fonts/PlusJakartaSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../assets/fonts/PlusJakartaSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../assets/fonts/PlusJakartaSans-SemiBold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---- Design tokens -------------------------------------------------------- */
:root {
  --color-ink: #261e35;      /* brand dark / primary text */
  --color-white: #ffffff;
  --color-panel-muted: #efedf3; /* disabled surfaces */
  --color-text-muted: #b7b3be;  /* placeholders / disabled text */
  --color-accent: #f95a44;      /* brand red-orange */
  --color-focus: #45b7d9;

  --radius-input: 12px;
  --radius-pill: 56px;

  --font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---- Reset ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
div,
h1,
h2,
p,
a,
img,
form,
input,
button {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  vertical-align: baseline;
}

html {
  height: 100%;
}

body {
  height: 100%;
  font-family: var(--font-family);
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  color: var(--color-ink);
}

img {
  height: auto;
  max-width: 100%;
  display: block;
}

button,
input {
  font-family: inherit;
}

a {
  color: inherit;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--color-ink);
  border-radius: 8px;
}

::-webkit-scrollbar-track {
  box-shadow: inset 0 0 5px #e5e5e5;
  border-radius: 10px;
}

/* ---- Layout ---------------------------------------------------------------- */
html,
body {
  height: 100%;
}

.login {
  min-height: 100svh;
  height: 100svh;
  background-color: var(--color-ink);
  display: flex;
  flex-direction: column;
}

.login__split {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  justify-content: center;
}

.login__panel {
  width: 50%;
  display: flex;
  flex-direction: column;
}

/* ---- Left / dark brand panel ------------------------------------------- */
.login__panel--dark {
  padding: 100px 49px 0;
  position: relative;
  z-index: 2;
}

.login__brand {
  padding-left: 37px;
  margin-bottom: 57px;
}

.login__logo {
  width: 100%;
  max-width: 200px;
  color: var(--color-ink);
}

.login__logo--desktop {
  margin-bottom: 25px;
  color: var(--color-white);
}

.login__logo--mobile {
  display: none;
  width: 43px;
  max-width: 43px;
}

.login__headline {
  max-width: 403px;
  color: var(--color-white);
  font-weight: 700;
  font-size: 40px;
  line-height: 110%;
}

.login__hero {
  position: static;
  width: calc(100% + 125px);
}

.login__hero img {
  width: 100%;
}

/* ---- Right / light form panel ------------------------------------------ */
.login__panel--light {
  width: 50%;
  overflow: auto;
  background-color: var(--color-white);
  padding: 24px 16px;
  color: var(--color-ink);
  position: relative;
  z-index: 1;
  align-items: center;
  justify-content: center;
}

.login__form-wrap {
  width: 100%;
  max-width: 358px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login__content {
  width: 100%;
}

.login__slogan {
  display: none;
  text-align: center;
  font-weight: 700;
  font-size: 32px;
  line-height: 120%;
  margin-bottom: 32px;
}

.login__subtext {
  color: var(--color-ink);
  font-weight: 700;
  font-size: 32px;
  line-height: 130%;
  margin-bottom: 32px;
}

/* ---- Form ---------------------------------------------------------------- */
.login__field-row {
  width: 100%;
}

.login__field-row > * + * {
  margin-top: 0;
}

.login__field {
  margin-bottom: 16px;
}

.login__input {
  height: 64px;
  width: 100%;
  display: block;
  font-size: 16px;
  line-height: 140%;
  color: var(--color-ink);
  background-color: var(--color-white);
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-input);
  padding: 20px 16px;
  outline: 0;
  box-shadow: none;
  transition: box-shadow 0.15s ease;
}

.login__input::placeholder {
  color: var(--color-text-muted);
}

.login__input:focus {
  box-shadow: 0 0 0 1px var(--color-focus), 0 0 0 4px rgba(69, 176, 217, 0.6);
}

.login__input:disabled {
  background-color: var(--color-white);
  color: #666666;
  cursor: not-allowed;
  box-shadow: none;
}

.login__submit {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 20px;
  cursor: not-allowed;
  background-color: var(--color-panel-muted);
  color: var(--color-text-muted) !important;
  box-shadow: none;
  transition: background-color 0.2s, opacity 0.2s;
}

.login__submit:enabled {
  cursor: pointer;
  background-color: var(--color-ink);
  color: var(--color-white) !important;
}

.login__submit:enabled:hover {
  opacity: 0.9;
}

.login__submit:enabled:active {
  transform: translateY(1px);
}

/* ---- Legal text ------------------------------------------------------- */
.login__legal {
  width: 100%;
  max-width: 403px;
  color: var(--color-ink);
  font-weight: 400;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  margin-top: 22px;
}

.login__legal a {
  text-decoration: underline;
}

/* ---- Force logout -------------------------------------------------------- */
.login__logout-wrap {
  display: flex;
  justify-content: center;
}

.login__logout {
  display: none;
  background-color: transparent;
  color: var(--color-accent);
  font-weight: 400;
  font-size: 14px;
  line-height: 18px;
  padding: 0;
  height: auto;
  text-decoration: underline;
  margin-top: 12px;
  cursor: pointer;
}

/* ---- Responsive ------------------------------------------------------- */
@media screen and (max-width: 991px) {
  .login__brand {
    padding-left: 0;
  }
}

@media screen and (max-width: 1100px) {
  .login__hero {
    width: calc(100% + 75px);
  }
}

@media screen and (min-width: 2500px) {
  .login__hero {
    margin-top: 60px;
  }
}

@media screen and (max-width: 869px) {
  html,
  body {
    background-color: var(--color-white);
  }

  .login__panel--dark {
    display: none;
  }

  .login__panel--light {
    width: 100%;
    max-width: unset;
    height: 100%;
    justify-content: space-between !important;
  }

  .login__form-wrap {
    max-width: 500px;
  }

  .login__logo--mobile {
    display: flex;
    justify-content: center;
    margin: 0 auto 32px;
  }

  .login__slogan {
    display: block;
    text-align: center;
    font-size: 48px;
    line-height: 120%;
  }

  .login__subtext {
    font-size: 16px;
    font-weight: 400;
    line-height: 150%;
    text-align: center;
  }

  .login__input {
    border-color: var(--color-text-muted) !important;
  }
}

@media screen and (max-width: 565px) {
  .login__split {
    position: static;
  }

  .login__logout {
    margin-bottom: 16px;
  }
}

@media screen and (max-width: 300px) {
  .login__subtext {
    font-size: 40px;
  }
}

/* ==========================================================================
   Step 2 — email code verification screen
   ========================================================================== */

.step-page {
  min-height: 100svh;
  background-color: var(--color-white);
  display: flex;
  flex-direction: column;
}

.step-page__header {
  border-bottom: 1px solid var(--color-panel-muted);
  width: 100%;
  padding: 32px 48px;
  margin-bottom: 48px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

.step-page__header-logo,
.step-page__header-spacer {
  width: 25%;
}

.step-page__header-progress {
  width: 50%;
}

.step-page__logo {
  width: 114px;
  max-width: 100%;
  color: var(--color-ink);
  display: block;
}

/* ---- Stepper ------------------------------------------------------------ */
.stepper__track {
  height: 3px;
  background-color: var(--color-text-muted);
  border-radius: 3px;
  width: calc(100% - 15px);
  margin: 0 auto;
  display: flex;
}

.stepper__segment {
  width: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.stepper__segment--done {
  background-color: var(--color-ink);
  border-radius: 3px;
}

.stepper__badge {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.stepper__badge--done {
  background-color: var(--color-ink);
}

.stepper__badge--done svg {
  fill: var(--color-white);
  width: 18px;
}

.stepper__badge--pending {
  background-color: var(--color-white);
  border: 2px solid var(--color-text-muted);
}

.stepper__badge--pending svg {
  fill: var(--color-text-muted);
  width: 15px;
}

.stepper__labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  width: calc(100% + 15px);
  margin-left: -13px;
}

.stepper__label {
  color: var(--color-ink);
  font-size: 14px;
  line-height: 150%;
  font-weight: 400;
}

.stepper__label--current {
  font-weight: 700;
}

@media screen and (max-width: 869px) {
  #screen-email .step-page__header-logo,
  #screen-email .step-page__header-spacer {
    display: none;
  }

  #screen-email .step-page__header-progress {
    width: 100%;
  }

  .stepper__labels {
    display: none;
  }
}

/* ---- Body ----------------------------------------------------------------- */
.step-page__body {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 16px 24px;
  box-sizing: border-box;
}

.step-page__content {
  width: 100%;
  max-width: 564px;
  padding: 24px;
  box-sizing: border-box;
  margin-top: -100px;
  text-align: left;
}

@media screen and (max-width: 869px) {
  .step-page__content {
    margin-top: 0;
    padding: 0;
    max-width: 500px;
  }
}

.step-page__title {
  font-size: 24px;
  margin: 52px 0 32px;
  text-align: center;
  font-weight: 700;
  line-height: 120%;
}

@media screen and (max-width: 869px) {
  .step-page__title {
    text-align: left;
  }
}

.step-page__subtitle {
  color: var(--color-ink);
  font-weight: 400;
  margin-bottom: 40px;
  font-size: 16px;
  line-height: 140%;
  text-align: center;
}

@media screen and (max-width: 869px) {
  .step-page__subtitle {
    text-align: left;
  }
}

/* ---- OTP field ------------------------------------------------------------ */
.otp-field {
  width: 100%;
}

.otp-field__label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.otp-field__label {
  color: var(--color-ink);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.otp-field__input {
  height: 64px;
  width: 100%;
  display: block;
  border: 1px solid var(--color-text-muted);
  border-radius: var(--radius-input);
  background-color: var(--color-white);
  font-weight: 700;
  font-size: 2rem;
  padding: 10px;
  text-align: center;
  color: var(--color-text-muted);
  letter-spacing: 0.2em;
  outline: 0;
  box-shadow: none;
  transition: box-shadow 0.15s ease, color 0.15s ease;
}

.otp-field__input::placeholder {
  color: var(--color-text-muted);
}

.otp-field__input:focus {
  box-shadow: 0 0 0 1px var(--color-focus), 0 0 0 4px rgba(69, 176, 217, 0.6);
}

.otp-field__input.has-value {
  color: var(--color-ink);
}

/* ---- Helper links ---------------------------------------------------------- */
.step-page__helpers {
  margin-top: 16px;
  text-align: center;
}

.step-page__helper-link {
  display: none;
  color: var(--color-ink);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.5;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.step-page__helper-link.is-visible {
  display: inline-block;
}

.step-page__helper-link + .step-page__helper-link {
  margin-left: 16px;
}

.step-page__status {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted);
  min-height: 21px;
}

/* ==========================================================================
   Loading overlay — two-circle interference animation
   ========================================================================== */

.loading-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 9999;
}

.loading-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.loader {
  position: relative;
  width: 108px;
  height: 108px;
  isolation: isolate;
}

.loader__circle {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  border-radius: 50%;
}

.loader__circle--a {
  left: 0;
  background-color: var(--color-ink);
  animation: loader-cross-a 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.loader__circle--b {
  right: 0;
  background-color: var(--color-white);
  border: 2px solid var(--color-ink);
  box-sizing: border-box;
  mix-blend-mode: difference;
  animation: loader-cross-b 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

/* Circles start apart, cross through each other (full overlap at the
   midpoint), swap sides, then cross back — a continuous "interference"
   pass rather than a small wobble. */
@keyframes loader-cross-a {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(58px);
  }
}

@keyframes loader-cross-b {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-58px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader__circle--a,
  .loader__circle--b {
    animation-duration: 3.6s;
  }
}
