@font-face {
  font-family: "Roboto Flex";
  src: url("assets/fonts/RobotoFlex.ttf") format("truetype");
  font-weight: 100 1000;
  font-stretch: 25% 151%;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Montserrat";
  src: url("assets/fonts/Montserrat-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Montserrat";
  src: url("assets/fonts/Montserrat-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Montserrat";
  src: url("assets/fonts/Montserrat-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Montserrat";
  src: url("assets/fonts/Montserrat-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: block;
}

:root {
  --bg-canvas: #120e1e;
  --bg-surface: #1b152d;
  --input-border: #292236;
  --input-placeholder: #bdb5d5;
  --input-text: #ffffff;
  --text-primary: #ffffff;
  --text-secondary: #c5c0d0;
  --button-switcher-bg: #362b5a;
  --button-switcher-text: #ffffff;
  --button-primary-bg: #e09da3;
  --button-primary-text: #09070f;
  --button-secondary-text: #e09da3;
  --text-error: #e45050;
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg-canvas);
}

body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: "Montserrat", sans-serif;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

.phone {
  /* Centred in the window, whatever its height. */
  position: fixed;
  left: 50%;
  top: 50%;
  width: 440px;
  height: 956px;
  margin: -478px 0 0 -220px;
  background: var(--bg-canvas);
  border-radius: 32px;
  overflow: hidden;
  /* app.js (fitPhone) sets --phone-scale and --phone-height for the current window. */
  transform: scale(var(--phone-scale, 1));
  transform-origin: center center;
}

/* Phones: the 440px-wide frame is scaled to the screen width and stretched to its height. */
html.is-handset body {
  display: block;
}

html.is-handset .phone {
  left: 0;
  top: 0;
  height: var(--phone-height, 956px);
  margin: 0;
  border-radius: 0;
  transform-origin: 0 0;
}

/* Phones on the sign-in screens: no scaling, the layout itself adapts to the screen. */
html.is-fluid .phone {
  inset: 0;
  width: auto;
  height: auto;
  transform: none;
}

.screen {
  position: absolute;
  inset: 0;
}

.screen:not(.is-active) {
  visibility: hidden;
  pointer-events: none;
}

/* Sign-in screens are dark only, whatever theme the rest of the app uses. */
.screen--splash,
.screen--auth {
  --bg-canvas: #120e1e;
  --bg-surface: #1b152d;
  --input-border: #292236;
  --input-border-focus: #7b6cab;
  --input-placeholder: #bdb5d5;
  --input-text: #ffffff;
  --input-disabled-bg: #211b2c;
  --text-primary: #ffffff;
  --text-secondary: #c5c0d0;
  --button-switcher-bg: #362b5a;
  --button-switcher-text: #ffffff;
  --button-primary-bg: #e09da3;
  --button-primary-text: #09070f;
  --button-secondary-text: #e09da3;
  --button-disabled-text: #776e8c;
  --text-error: #e45050;
  background: var(--bg-canvas);
  color-scheme: dark;
  overflow: hidden;
}

.glow {
  position: absolute;
  left: 50%;
  width: 676px;
  height: 266px;
  margin-left: -338px;
  border-radius: 126px;
  transform: rotate(180deg);
  filter: blur(123.25px);
  pointer-events: none;
}

.glow--splash {
  top: -43px;
}

.glow--auth {
  top: -73px;
}

.glow img {
  display: block;
  width: 676px;
  height: 266px;
  max-width: none;
  object-fit: cover;
  border-radius: 126px;
  pointer-events: none;
}

.screen--splash {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand--splash {
  position: relative;
  width: 263px;
  height: 149.001831px;
  flex-shrink: 0;
  animation: logo-dissolve 0.5s ease-out both;
}

.brand--auth {
  position: relative;
  width: 263px;
  height: 149.001831px;
  flex-shrink: 0;
}

@keyframes logo-dissolve {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.mark {
  position: absolute;
  display: block;
  max-width: none;
}

.mark-sp {
  left: 0.002563px;
  top: 22.912659px;
}

.mark-oo {
  left: 135.009033px;
  top: 22.912964px;
}

.mark-l {
  left: 230.76001px;
  top: 0;
}

.tag {
  position: absolute;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  font-family: "Roboto Flex", sans-serif;
  font-weight: 300;
  font-style: normal;
  font-size: 18px;
  line-height: 20px;
  letter-spacing: 2px;
  text-align: center;
  white-space: nowrap;
  font-variation-settings:
    "GRAD" 0,
    "XOPQ" 96,
    "XTRA" 468,
    "YOPQ" 79,
    "YTAS" 750,
    "YTDE" -203,
    "YTFI" 738,
    "YTLC" 514,
    "YTUC" 712,
    "wdth" 100;
}

.tag-strands {
  left: 0;
  top: 128.601837px;
  width: 153px;
  color: #ecc4c8;
}

.tag-dot {
  left: 154px;
  top: 125.001831px;
  width: 22px;
  color: #ffffff;
}

.tag-knot {
  left: 177px;
  top: 129.001831px;
  width: 86px;
  color: #9c91c0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-scroll {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.auth-scroll::-webkit-scrollbar {
  display: none;
}

/* A column of: space, logo, space, form, space. At 440×956 the spaces are 295 / 80 / 32px.
   On shorter screens the bottom space gives way first, then the top and middle ones. */
.auth-content {
  width: min(360px, calc(100% - 48px));
  /* A fixed height, so the spaces can shrink; if the form still doesn't fit (a phone
     keyboard is open, say) it overflows and .auth-scroll scrolls. */
  height: 100%;
  margin: 0 auto;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-space {
  width: 100%;
}

.auth-space--top {
  flex: 0 1 295px;
  min-height: 16px;
}

.auth-space--gap {
  flex: 0 3 80px;
  min-height: 40px;
}

.auth-space--bottom {
  flex: 1 1000 32px;
  min-height: 16px;
}

/* Every form keeps the same height, so the logo sits in one place on all screens and
   there is always room for the message under the actions. */
.auth-form {
  width: 100%;
  min-height: 400px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.auth-form--reset {
  gap: 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 179px 180px;
  width: 359px;
  height: 56px;
}

.auth-tab {
  margin: 0;
  padding: 0;
  height: 56px;
  border: none;
  background: transparent;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
}

.auth-tab--left {
  border: 1.5px solid var(--input-border);
  border-right: none;
  border-radius: 16px 0 0 16px;
  color: var(--input-placeholder);
}

.auth-tab--right {
  border: 1.5px solid var(--input-border);
  border-left: none;
  border-radius: 0 16px 16px 0;
  color: var(--input-placeholder);
}

.auth-tab--left.is-active {
  border: none;
  background: var(--button-switcher-bg);
  color: var(--button-switcher-text);
}

.auth-tab--right.is-active {
  border: none;
  background: var(--button-switcher-bg);
  color: var(--button-switcher-text);
}

/* Sign-In / Sign-Up switcher (Figma Switcher Left + Right): 179 + 1 + 180, and the
   unselected half is outlined on all four sides. */
.auth-tabs[role="tablist"] {
  grid-template-columns: 179fr 180fr;
  gap: 1px;
  width: 100%;
}

.auth-tabs[role="tablist"] .auth-tab:not(.is-active) {
  border: 1.5px solid var(--input-border);
}

.auth-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.auth-title {
  margin: 0;
  min-height: 31px;
  display: flex;
  align-items: center;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 20px;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.auth-subtitle {
  margin: 0;
  min-height: 24px;
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

.auth-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.field {
  position: relative;
  display: block;
  width: 100%;
  height: 56px;
}

.field input {
  width: 100%;
  height: 56px;
  margin: 0;
  padding: 0 22.5px;
  border: 1.5px solid transparent;
  border-radius: 16px;
  background: var(--bg-surface);
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 20px;
  color: var(--input-text);
  caret-color: var(--input-text);
  outline: none;
  transition: border-color 0.15s ease;
}

.field input::placeholder {
  color: var(--input-placeholder);
  opacity: 1;
}

/* Figma Text Box, focused variants */
.field input:focus {
  border-color: var(--input-border-focus);
}

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

/* Keep the field's own colours when the browser or a password manager fills it in. */
.field input:-webkit-autofill,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--input-text);
  box-shadow: 0 0 0 1000px var(--bg-surface) inset;
  caret-color: var(--input-text);
}

.field--password input {
  padding-right: 76px;
}

/* A placeholder drawn over the input, for the italic hint in the Figma text. */
.field--composite .field-placeholder {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  overflow: hidden;
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 20px;
  color: var(--input-placeholder);
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* Narrow phones: keep the whole hint readable instead of cutting it off. */
@media (max-width: 380px) {
  .field--composite .field-placeholder {
    font-size: 15px;
  }
}

@media (max-width: 340px) {
  .field--composite .field-placeholder {
    font-size: 13px;
  }
}

.field--composite .field-placeholder em {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-style: italic;
}

.field--composite input:not(:placeholder-shown) ~ .field-placeholder {
  opacity: 0;
}

/* Show / Hide appears once there is something to show. */
.field-toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  height: 44px;
  min-width: 60px;
  margin: 0;
  padding: 0 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--input-placeholder);
  cursor: pointer;
}

.field--password input:placeholder-shown ~ .field-toggle {
  display: none;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.btn-primary {
  width: 100%;
  height: 56px;
  margin: 0;
  padding: 14px 16px;
  border: none;
  border-radius: 94px;
  background: var(--button-primary-bg);
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: 0.1px;
  color: var(--button-primary-text);
  text-align: center;
  cursor: pointer;
}

.screen--auth .btn-primary {
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

/* Figma Primary Button, Disabled variant */
.screen--auth .btn-primary:disabled {
  background: var(--input-disabled-bg);
  color: var(--button-disabled-text);
  cursor: default;
}

/* While a request is running the button stays pink and dims. */
.screen--auth .btn-primary[aria-busy="true"] {
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  opacity: 0.7;
  cursor: progress;
}

.btn-primary[aria-busy="true"] {
  opacity: 0.7;
  cursor: progress;
}

/* Text links under the button: "Forgot Password" and "Back". */
.auth-link,
.auth-back,
.auth-message__action {
  position: relative;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  color: var(--button-secondary-text);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

/* A larger area to tap than the text itself. */
.auth-link::after,
.auth-back::after,
.auth-message__action::after {
  content: "";
  position: absolute;
  inset: -10px -24px;
}

.auth-link {
  font-size: 16px;
  line-height: 20px;
}

.auth-back {
  font-size: 16px;
  line-height: 1.5;
}

/* Reserved space under the actions. Messages appear here and nothing else moves. */
.auth-message {
  width: 100%;
  min-height: 40px;
  margin-top: -8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.auth-message__text {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
  text-align: center;
  overflow-wrap: anywhere;
}

.auth-message__text strong {
  font-weight: 600;
  color: var(--text-primary);
}

.auth-message__text--error {
  color: var(--text-error);
}

.auth-message__action {
  font-size: 14px;
  line-height: 20px;
}

.auth-tab:focus-visible,
.field-toggle:focus-visible,
.screen--auth .btn-primary:focus-visible,
.auth-link:focus-visible,
.auth-back:focus-visible,
.auth-message__action:focus-visible {
  outline: 2px solid var(--input-border-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .brand--splash {
    animation: none;
  }

  .field input,
  .screen--auth .btn-primary {
    transition: none;
  }
}
