:root {
  --bg: #000000;
  --card: rgba(20, 21, 28, 0.78);
  --card-border: rgba(255, 255, 255, 0.09);
  --input-bg: rgba(6, 7, 10, 0.62);
  --input-border: rgba(255, 255, 255, 0.13);
  --input-border-focus: rgba(143, 127, 241, 0.55);
  --text: #ffffff;
  --muted: #a0a1a9;
  --muted-2: #80818a;
  --btn-top: #8e7ff1;
  --btn-mid: #6d58f1;
  --btn-bot: #5c4ada;
  --danger: #ff6b7a;
  --radius-card: 24px;
  --radius-field: 10px;
  --font: "SF Pro Text", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.page {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  position: relative;
  overflow: hidden;
  background: #000;
}

.ambient {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 50% 42%, rgba(88, 78, 160, 0.14), transparent 42%),
    radial-gradient(circle at 50% 45%, transparent 0 18%, rgba(255, 255, 255, 0.015) 18.5% 19%, transparent 19.5%),
    radial-gradient(circle at 50% 45%, transparent 0 28%, rgba(255, 255, 255, 0.012) 28.5% 29%, transparent 29.5%),
    radial-gradient(circle at 50% 45%, transparent 0 38%, rgba(255, 255, 255, 0.01) 38.5% 39%, transparent 39.5%),
    radial-gradient(circle at 50% 45%, transparent 0 48%, rgba(255, 255, 255, 0.008) 48.5% 49%, transparent 49.5%),
    #000;
  pointer-events: none;
}

.card {
  position: relative;
  width: min(100%, 368px);
  padding: 32px 32px 34px;
  border-radius: var(--radius-card);
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 24px 80px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(28px) saturate(120%);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  animation: card-in 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.btn-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(220, 222, 230, 0.72);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.btn-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.brand {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 108px;
  margin: 8px 0 22px;
}

.brand-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  filter: blur(0.2px);
}

.decor {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transform: scale(0.78);
}

.decor-search {
  left: -6px;
  top: 18px;
  width: 112px;
}

.decor-search-icon {
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
}

.decor-search-icon::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.35);
  right: -3px;
  bottom: -1px;
  transform: rotate(45deg);
  border-radius: 1px;
}

.decor-search-bar {
  height: 6px;
  flex: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.decor-profile {
  right: -4px;
  top: 28px;
  padding-right: 14px;
}

.decor-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #d7d7de, #7b7c88 55%, #4a4b55 100%);
  flex: 0 0 auto;
}

.decor-name {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.01em;
}

.logo {
  position: relative;
  z-index: 1;
  width: min(78%, 196px);
  height: auto;
  display: block;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.08));
  animation: logo-in 700ms 80ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes logo-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.heading {
  margin-bottom: 18px;
}

.heading h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.user-icon {
  color: #fff;
  flex: 0 0 auto;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 400;
}

.field {
  display: block;
  position: relative;
  margin-bottom: 12px;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: var(--radius-field);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.field input::placeholder {
  color: var(--muted-2);
}

.field input:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.field input:focus {
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px rgba(109, 88, 241, 0.16);
  background: rgba(8, 9, 12, 0.72);
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 4px;
  border-radius: 6px;
}

.toggle-password .icon-eye-on {
  display: none;
}

.toggle-password.is-visible .icon-eye-off {
  display: none;
}

.toggle-password.is-visible .icon-eye-on {
  display: block;
}

.toggle-password:hover {
  color: #c9cad1;
}

.forgot {
  display: inline-block;
  margin: 2px 0 18px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  transition: color 160ms ease;
}

.forgot:hover {
  color: #d5d6dd;
}

.error {
  margin: -6px 0 14px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.4;
  min-height: 1.2em;
}

.btn-primary {
  position: relative;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: var(--radius-field);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  background: linear-gradient(180deg, var(--btn-top) 0%, var(--btn-mid) 52%, var(--btn-bot) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 10px 24px rgba(92, 74, 218, 0.28);
  transition: filter 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
  filter: brightness(0.98);
}

.btn-primary:disabled {
  cursor: wait;
  opacity: 0.78;
}

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 700ms linear infinite;
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -8px 0 0 -8px;
}

.btn-primary.is-loading .btn-label {
  visibility: hidden;
}

.btn-primary.is-loading .btn-spinner {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.email-box {
  margin-top: -2px;
}

.email-box[hidden],
#otp-box[hidden],
#error[hidden],
#otp-error[hidden] {
  display: none !important;
}

@media (max-width: 420px) {
  .card {
    width: 100%;
    padding: 24px 20px 26px;
    border-radius: 24px;
  }

  .brand {
    min-height: 96px;
  }

  .decor-search,
  .decor-profile {
    display: none;
  }
}
