:root {
  --poks-purple: #000000;
  --poks-purple-dark: #1f1f1f;
  --poks-purple-soft: #ececec;

  --poks-bg: #ffffff;
  --poks-surface: #f4f5f7;
  --poks-surface-2: #e7e9ec;
  --poks-card: #ffffff;
  --poks-border: #d6d9de;

  --poks-text: #17202a;
  --poks-muted: #75808c;
  --poks-shadow: 0 24px 70px rgba(10, 20, 35, 0.14);
  --poks-transition: 1100ms cubic-bezier(0.65, 0, 0.25, 1);
}

body[data-auth-state="checking"],
body[data-auth-state="locked"],
body[data-auth-state="authenticated"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 1)),
    var(--poks-bg);
}

body[data-auth-state="checking"] .auth-shell {
  display: none;
}

body[data-auth-state="checking"] .app-shell,
body[data-auth-state="locked"] .app-shell {
  display: none;
}

body[data-auth-state="authenticated"] .auth-shell {
  display: none;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--poks-text);
  background: var(--poks-bg);
  font-family:
    "Geist",
    "Satoshi",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

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

.auth-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 40px);
  background:
    radial-gradient(circle at 14% 8%, rgba(0, 0, 0, 0.06), transparent 30rem),
    radial-gradient(circle at 86% 10%, rgba(95, 118, 146, 0.08), transparent 26rem),
    linear-gradient(135deg, #fbfcfd 0%, #f6f8fa 58%, #eef2f6 100%);
}

.auth-shell .wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.poks-auth-logo {
  display: block;
  width: min(190px, 42vw);
  height: auto;
  margin: 0 0 20px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(26, 35, 42, 0.12));
}

.poks-auth-frontend-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin: 0 0 12px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--poks-border);
  background: rgba(255, 255, 255, 0.78);
  color: var(--poks-purple-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(10, 20, 35, 0.08);
}

.poks-auth-shell {
  position: relative;
  width: fit-content;
  max-width: 100%;
  min-height: min(580px, calc(100dvh - 32px));
  box-sizing: border-box;
  padding: 48px 46px 42px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 30px;
  border: 1px solid var(--poks-border);
  background: linear-gradient(135deg, #0093de, #ffffff);
  box-shadow:
    0 24px 58px -44px rgba(26, 35, 42, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.poks-auth-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: none;
}

.poks-auth-shell::before {
  content: "";
  display: block;
  width: 370px;
  height: 0;
  visibility: hidden;
  pointer-events: none;
}

.poks-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  transition:
    clip-path var(--poks-transition),
    opacity var(--poks-transition),
    background var(--poks-transition);
}

.poks-bg-left {
  background:
    linear-gradient(
      135deg,
      rgba(0, 0, 0, 0.96) 0%,
      rgba(28, 28, 28, 0.88) 24%,
      rgba(86, 86, 86, 0.68) 56%,
      rgba(223, 223, 223, 0.16) 100%
    ),
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.16), transparent 36%);
  clip-path: polygon(0 0, 66% 0, 48% 100%, 0 100%);
}

.poks-bg-right {
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(248, 249, 250, 0.97) 28%,
      rgba(238, 240, 243, 0.95) 68%,
      rgba(227, 231, 236, 0.97) 100%
    ),
    radial-gradient(circle at 84% 20%, rgba(31, 37, 41, 0.018), transparent 30%);
  clip-path: polygon(58% 0, 100% 0, 100% 100%, 40% 100%);
}

.poks-bg-transition {
  z-index: 2;
  background:
    linear-gradient(
      135deg,
      rgba(0, 0, 0, 0.26) 0%,
      rgba(36, 36, 36, 0.18) 20%,
      rgba(156, 156, 156, 0.20) 46%,
      rgba(250, 251, 252, 0.96) 78%,
      rgba(255, 255, 255, 0.98) 100%
    ),
    radial-gradient(circle at 20% 18%, rgba(0, 0, 0, 0.06), transparent 42%);
  clip-path: polygon(18% 0, 68% 0, 50% 100%, 0 100%);
  box-shadow: -20px 0 40px rgba(20, 30, 45, 0.03);
}

.poks-form-panel {
  position: absolute;
  top: 96px;
  z-index: 10;
  width: 370px;
  padding: 30px 32px 28px;
  border-radius: 26px;
  border: 1px solid rgba(214, 217, 222, 0.9);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 50px rgba(10, 20, 35, 0.08);
  backdrop-filter: blur(14px);
  transition:
    opacity 420ms ease,
    transform 560ms ease,
    box-shadow 420ms ease;
}

.poks-form-panel h1 {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 0.98;
  letter-spacing: -0.055em;
  max-width: 10ch;
  white-space: normal;
  text-wrap: balance;
}

.poks-login-panel {
  left: 50%;
  top: 50%;
  opacity: 1;
  transform: translate(calc(-50% + var(--poks-login-offset-x, 0px)), -50%);
  pointer-events: auto;
}

.poks-password-reset-panel {
  left: 50%;
  top: 50%;
  opacity: 0;
  transform: translate(calc(-50% + 64px), -50%);
  pointer-events: none;
}

.poks-reset-note {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(0, 147, 222, 0.14);
  background: rgba(0, 147, 222, 0.07);
  color: var(--poks-muted);
  font-size: 14px;
  line-height: 1.45;
}

.poks-reset-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.poks-reset-step {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(214, 217, 222, 0.9);
  background: rgba(255, 255, 255, 0.8);
  color: var(--poks-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.poks-auth-shell[data-password-reset-step="request"] .poks-reset-step[data-step="request"],
.poks-auth-shell[data-password-reset-step="confirm"] .poks-reset-step[data-step="confirm"] {
  border-color: rgba(0, 147, 222, 0.24);
  background: rgba(0, 147, 222, 0.1);
  color: var(--poks-purple-dark);
}

.poks-password-reset-request-form,
.poks-password-reset-confirm-form {
  display: block;
}

.poks-password-reset-confirm-form {
  display: none;
}

.poks-auth-shell[data-password-reset-step="confirm"] .poks-password-reset-request-form {
  display: none;
}

.poks-auth-shell[data-password-reset-step="confirm"] .poks-password-reset-confirm-form {
  display: block;
}

.poks-field {
  display: block;
  margin-bottom: 18px;
}

.poks-field span {
  display: block;
  margin: 0 0 7px;
  color: var(--poks-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.poks-field input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--poks-border);
  outline: none;
  background: rgba(255, 255, 255, 0.88);
  color: var(--poks-text);
  font-size: 15px;
  font-weight: 650;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.poks-field input::placeholder {
  color: rgba(117, 128, 140, 0.7);
}

.poks-field input:focus {
  border-color: var(--poks-purple);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.16);
  background: #ffffff;
}

.poks-button {
  width: 100%;
  height: 50px;
  margin-top: 8px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--poks-purple), var(--poks-purple-dark));
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.poks-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
  filter: brightness(1.02);
}

.poks-button:active {
  transform: translateY(1px) scale(0.99);
}

.poks-switch-text {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(214, 217, 222, 0.72);
  color: var(--poks-muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.poks-switch-text a {
  color: var(--poks-purple);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.poks-banner {
  min-height: 1.4rem;
  margin-top: 12px;
  color: var(--poks-muted);
  font-size: 0.88rem;
}

.poks-banner[data-state="error"] {
  color: #9a3a3a;
}

.poks-banner[data-state="success"] {
  color: #2f6f54;
}

.poks-auth-shell.hide-login .poks-login-panel {
  opacity: 0;
  --poks-login-offset-x: -64px;
  pointer-events: none;
}

.poks-auth-shell.password-reset-mode .poks-bg-left {
  clip-path: polygon(0 0, 42% 0, 22% 100%, 0 100%);
}

.poks-auth-shell.password-reset-mode .poks-bg-right {
  clip-path: polygon(38% 0, 100% 0, 100% 100%, 20% 100%);
}

.poks-auth-shell.password-reset-mode .poks-bg-transition {
  background:
    linear-gradient(
      135deg,
      rgba(0, 0, 0, 0.98) 0%,
      rgba(30, 30, 30, 0.92) 22%,
      rgba(102, 102, 102, 0.64) 42%,
      rgba(235, 235, 235, 0.30) 70%,
      rgba(255, 255, 255, 0.98) 100%
    ),
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.12), transparent 42%);
  clip-path: polygon(0 0, 56% 0, 36% 100%, 0 100%);
}

.poks-auth-shell.show-password-reset .poks-password-reset-panel {
  opacity: 1;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.poks-auth-shell.returning .poks-password-reset-panel {
  opacity: 0;
  transform: translate(calc(-50% + 64px), -50%);
  pointer-events: none;
}

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

  .poks-auth-frontend-badge {
    min-height: 26px;
    margin-bottom: 10px;
    padding: 0 10px;
    font-size: 9px;
  }

  .poks-auth-shell {
    width: 100%;
    min-height: 700px;
    border-radius: 22px;
  }

  .poks-bg {
    display: none;
  }

  .poks-form-panel {
    position: absolute;
    top: 86px;
    left: 24px !important;
    right: 24px !important;
    width: auto;
    padding: 28px 24px 24px;
    border-radius: 22px;
    background: #ffffff;
  }

  .poks-login-panel {
    opacity: 1;
    transform: none;
  }

  .poks-password-reset-panel {
    opacity: 0;
    transform: none;
  }

  .poks-form-panel h1 {
    font-size: 30px;
    max-width: 11ch;
  }

  .poks-reset-note {
    margin-bottom: 10px;
  }

  .poks-reset-steps {
    margin-bottom: 14px;
  }

  .poks-auth-shell.hide-login .poks-login-panel {
    opacity: 0;
    transform: none;
  }

  .poks-auth-shell.show-password-reset .poks-password-reset-panel {
    opacity: 1;
    transform: none;
  }

  .poks-auth-shell[data-password-reset-step="confirm"] .poks-password-reset-request-form {
    display: none;
  }

  .poks-auth-shell[data-password-reset-step="confirm"] .poks-password-reset-confirm-form {
    display: block;
  }
}

body[data-ui-surface="mobile"] .auth-shell {
  padding: 18px;
}

body[data-ui-surface="mobile"] .poks-auth-frontend-badge {
  min-height: 26px;
  margin-bottom: 10px;
  padding: 0 10px;
  font-size: 9px;
}

body[data-ui-surface="mobile"] .poks-auth-shell {
  width: 100%;
  min-height: min(640px, calc(100dvh - 32px));
  border-radius: 22px;
  box-sizing: border-box;
}

body[data-ui-surface="mobile"] .poks-auth-shell {
  display: grid;
  place-items: center;
  padding: 18px;
}

body[data-ui-surface="mobile"] .poks-bg {
  display: none;
}

body[data-ui-surface="mobile"] .poks-form-panel {
  position: absolute;
  top: 50%;
  left: 50% !important;
  right: auto !important;
  width: min(390px, calc(100vw - 48px));
  padding: 28px 24px 24px;
  border-radius: 22px;
  background: #ffffff;
}

body[data-ui-surface="mobile"] .poks-login-panel {
  opacity: 1;
  transform: translate(-50%, -50%);
}

body[data-ui-surface="mobile"] .poks-password-reset-panel {
  opacity: 0;
  transform: translate(-50%, -50%);
}

body[data-ui-surface="mobile"] .poks-form-panel h1 {
  font-size: 30px;
  max-width: 11ch;
}

body[data-ui-surface="mobile"] .poks-reset-note {
  margin-bottom: 10px;
}

body[data-ui-surface="mobile"] .poks-reset-steps {
  margin-bottom: 14px;
}

body[data-ui-surface="mobile"] .poks-auth-shell.hide-login .poks-login-panel {
  opacity: 0;
}

body[data-ui-surface="mobile"] .poks-auth-shell.show-password-reset .poks-password-reset-panel {
  opacity: 1;
}

body[data-ui-surface="mobile"] .poks-auth-shell[data-password-reset-step="confirm"] .poks-password-reset-request-form {
  display: none;
}

body[data-ui-surface="mobile"] .poks-auth-shell[data-password-reset-step="confirm"] .poks-password-reset-confirm-form {
  display: block;
}

body[data-ui-surface="desktop"] .auth-shell {
  padding: clamp(16px, 3vw, 40px);
}

body[data-ui-surface="desktop"] .poks-auth-frontend-badge {
  min-height: 28px;
  margin-bottom: 12px;
  padding: 0 12px;
  font-size: 10px;
}

body[data-ui-surface="desktop"] .poks-auth-shell {
  width: fit-content;
  min-height: min(580px, calc(100dvh - 32px));
  border-radius: 30px;
}

body[data-ui-surface="desktop"] .poks-bg {
  display: none;
}

body[data-ui-surface="desktop"] .poks-form-panel {
  position: absolute;
  width: 370px;
  padding: 30px 32px 28px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.88);
}
