@font-face {
  font-family: "CircularStd";
  font-style: normal;
  font-weight: 400;
  src: url("assets/fonts/CircularStd-Book.woff") format("woff");
}

@font-face {
  font-family: "CircularStd";
  font-style: normal;
  font-weight: 500;
  src: url("assets/fonts/CircularStd-Medium.woff") format("woff");
}

@font-face {
  font-family: "CircularStd";
  font-style: normal;
  font-weight: 700;
  src: url("assets/fonts/CircularStd-Bold.woff") format("woff");
}

@font-face {
  font-family: "CircularStd";
  font-style: normal;
  font-weight: 800;
  src: url("assets/fonts/CircularStd-Black.woff") format("woff");
}

:root {
  --auth-bg: #f3f8fe;
  --auth-surface: rgba(255, 255, 255, 0.98);
  --auth-surface-soft: rgba(246, 250, 255, 0.94);
  --auth-text: #152235;
  --auth-muted: #60718a;
  --auth-primary: #0f6fff;
  --auth-primary-strong: #0958d9;
  --auth-line: rgba(21, 34, 53, 0.1);
  --auth-glow: rgba(15, 111, 255, 0.14);
  --auth-shadow: 0 34px 80px rgba(18, 35, 58, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.auth-body {
  position: relative;
  margin: 0;
  overflow-x: hidden;
  color: var(--auth-text);
  font-family: var(--auth-body-font, "CircularStd", "Segoe UI", sans-serif);
  background:
    radial-gradient(circle at top left, rgba(15, 111, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, #eef5fd 100%);
}

body.auth-body::before,
body.auth-body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

body.auth-body::before {
  width: min(62vw, 760px);
  height: min(62vw, 760px);
  left: -18vw;
  bottom: -24vw;
  background: rgba(15, 111, 255, 0.07);
}

body.auth-body::after {
  width: min(40vw, 460px);
  height: min(40vw, 460px);
  right: -12vw;
  top: -14vw;
  background: rgba(104, 170, 255, 0.08);
}

.auth-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px);
  background-size: 38px 38px;
}

.auth-shell {
  position: relative;
  min-height: 100vh;
  padding: 32px 18px;
  display: grid;
  place-items: center;
}

.login-card,
.auth-message-card {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  padding: 42px 36px 34px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: linear-gradient(180deg, var(--auth-surface) 0%, var(--auth-surface-soft) 100%);
  box-shadow: var(--auth-shadow);
}

.login-card::before,
.auth-message-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 24px;
  border: 1px solid rgba(15, 111, 255, 0.06);
  pointer-events: none;
}

.auth-otp-card {
  width: min(100%, 640px);
  padding: 34px 34px 32px;
  text-align: center;
}

.auth-panel-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--auth-muted);
  text-decoration: none;
  background: rgba(21, 34, 53, 0.04);
}

.auth-panel-close:hover {
  color: var(--auth-primary);
  background: rgba(15, 111, 255, 0.08);
}

.auth-illustration {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(15, 111, 255, 0.18), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(235, 244, 255, 0.96));
  border: 1px solid rgba(15, 111, 255, 0.08);
  color: var(--auth-primary);
  font-size: 32px;
  box-shadow: 0 18px 34px rgba(15, 111, 255, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(15, 111, 255, 0.08);
  color: var(--auth-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(15, 111, 255, 0.12);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
  text-align: left;
}

.auth-brand-mark {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(15, 111, 255, 0.18), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(235, 244, 255, 0.98));
  border: 1px solid rgba(15, 111, 255, 0.1);
  color: var(--auth-primary);
  box-shadow: 0 16px 30px rgba(15, 111, 255, 0.12);
}

.auth-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-brand-mark i {
  font-size: 22px;
}

.auth-brand-copy {
  display: grid;
  gap: 4px;
}

.auth-brand-copy strong {
  display: block;
  color: var(--auth-text);
  font-size: 1rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.auth-brand-copy small {
  display: block;
  color: var(--auth-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.login-card h1,
.auth-message-card h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-family: var(--auth-heading-font, "CircularStd", "Segoe UI", sans-serif);
}

.auth-otp-card h1 {
  margin-bottom: 12px;
  text-align: center;
  font-size: clamp(2rem, 4vw, 2.4rem);
  font-family: var(--auth-heading-font, "CircularStd", "Segoe UI", sans-serif);
}

.login-card p,
.auth-message-card p {
  margin: 0 0 24px;
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.7;
}

.auth-otp-card > p {
  max-width: 470px;
  margin: 0 auto 24px;
  text-align: center;
}

.auth-otp-card .auth-brand {
  justify-content: center;
  margin: 0 0 22px;
}

.form-control,
.auth-input {
  width: 100%;
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 1px solid var(--auth-line);
  border-radius: 18px;
  background: #fff;
  color: var(--auth-text);
  font-size: 15px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.form-control:focus,
.auth-input:focus {
  outline: none;
  border-color: rgba(15, 111, 255, 0.34);
  box-shadow: 0 0 0 5px var(--auth-glow);
  transform: translateY(-1px);
}

.login-button,
.auth-button {
  border: 0;
  border-radius: 18px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--auth-primary) 0%, #2a87ff 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 16px 30px rgba(15, 111, 255, 0.22);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.login-button:hover,
.auth-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px rgba(15, 111, 255, 0.24);
}

.login-button.secondary,
.auth-button.secondary {
  background: rgba(21, 34, 53, 0.06);
  color: var(--auth-text);
  box-shadow: none;
}

.login-button:disabled,
.auth-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.login-card .login-button,
.login-card .auth-button {
  width: 100%;
}

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
  color: var(--auth-muted);
  font-size: 14px;
}

.form-footer a,
.auth-message-card a,
.auth-secondary-link {
  color: var(--auth-primary);
  font-weight: 600;
  text-decoration: none;
}

.form-footer a:hover,
.auth-message-card a:hover,
.auth-secondary-link:hover {
  color: var(--auth-primary-strong);
}

.auth-stack {
  display: grid;
  gap: 14px;
}

.auth-inline {
  display: flex;
  gap: 12px;
  align-items: center;
}

.auth-inline .form-control {
  margin-bottom: 0;
}

.auth-inline label {
  min-width: 124px;
  color: var(--auth-muted);
  font-size: 14px;
}

.auth-note {
  margin: 0;
  color: var(--auth-muted);
  font-size: 13px;
}

.auth-message-card {
  text-align: left;
}

.auth-message-card .auth-brand {
  justify-content: center;
  text-align: center;
}

.auth-message-card .status-icon {
  width: 62px;
  height: 62px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(15, 111, 255, 0.1);
  color: var(--auth-primary);
  font-size: 26px;
}

.auth-message-card.success .status-icon {
  background: rgba(12, 176, 104, 0.12);
  color: #0cb068;
}

.auth-message-card.error .status-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.auth-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.auth-actions a,
.auth-actions button {
  flex: 1 1 180px;
}

body.auth-body .auth-code-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  margin: 0 0 24px;
}

body.auth-body .auth-code-grid .otp-digit {
  flex: 0 1 clamp(44px, 8vw, 58px);
  width: clamp(44px, 8vw, 58px) !important;
  max-width: 58px;
  height: 68px;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: block;
  border: 0;
  border-bottom: 3px solid rgba(15, 111, 255, 0.24);
  border-radius: 0;
  background: transparent;
  text-align: center;
  color: var(--auth-text);
  font-size: 2rem;
  font-weight: 700;
  box-shadow: none;
}

body.auth-body .auth-code-grid .otp-digit:focus {
  border-color: var(--auth-primary);
  box-shadow: none;
  transform: none;
}

.auth-hidden-code {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.auth-otp-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
}

.auth-otp-footer .login-button {
  width: auto;
  min-width: 140px;
}

.auth-resend-row {
  display: grid;
  gap: 8px;
}

.auth-resend-row .login-button.secondary {
  width: auto;
  justify-self: start;
  padding: 13px 18px;
}

.toastr {
  box-shadow: 0 20px 50px rgba(7, 19, 36, 0.16) !important;
  border-radius: 16px !important;
}

@media (max-width: 680px) {
  .auth-shell {
    padding: 18px 12px;
  }

  .login-card,
  .auth-message-card,
  .auth-otp-card {
    padding: 28px 22px 24px;
    border-radius: 24px;
  }

  .auth-brand {
    gap: 12px;
    margin-bottom: 18px;
  }

  .auth-brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    flex-basis: 48px;
  }

  body.auth-body .auth-code-grid {
    gap: 8px;
  }

  body.auth-body .auth-code-grid .otp-digit {
    flex-basis: clamp(40px, 13vw, 50px);
    width: clamp(40px, 13vw, 50px) !important;
    height: 60px;
    font-size: 1.45rem;
  }

  .form-footer,
  .auth-otp-footer,
  .auth-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-inline label {
    min-width: 0;
  }

  .auth-otp-footer .login-button,
  .auth-resend-row .login-button.secondary {
    width: 100%;
  }
}
