*, *::before, *::after { box-sizing: border-box; }

.auth-body {
  --win-bg: #ffffff;
  --win-surface: #ffffff;
  --win-surface-alt: #f8fafc;
  --win-stroke: #e2e8f0;
  --win-stroke-input: #c8d0dc;
  --win-text: #11182b;
  --win-text-secondary: #69758c;
  --win-navy: #10182f;
  --win-navy-soft: #182343;
  --win-navy-dark: #0c1224;
  --win-accent: #10182f;
  --win-accent-hover: #182343;
  --win-accent-pressed: #0c1224;
  --win-accent-light: #eef1f6;
  --win-violet: #6757e8;
  --win-danger: #c42b1c;
  --win-success: #0f7b0f;
  --win-radius: 6px;
  --auth-safe-top: env(safe-area-inset-top, 0px);
  --auth-safe-bottom: env(safe-area-inset-bottom, 0px);
  --auth-safe-left: env(safe-area-inset-left, 0px);
  --auth-safe-right: env(safe-area-inset-right, 0px);

  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--win-surface);
  font-family: "Segoe UI", "Segoe UI Variable Text", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--win-text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.auth-body button { font-family: inherit; font-size: 14px; }

.auth-body input,
.auth-body select,
.auth-body textarea {
  font-family: inherit;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(420px, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-showcase {
  position: relative;
  padding:
    calc(clamp(36px, 5vw, 56px) + var(--auth-safe-top))
    calc(clamp(36px, 5vw, 56px) + var(--auth-safe-right))
    clamp(36px, 5vw, 56px)
    calc(clamp(36px, 5vw, 56px) + var(--auth-safe-left));
  color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.06), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(0, 0, 0, 0.2), transparent 45%),
    var(--win-navy);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.auth-showcase::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -100px;
  top: -100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.auth-showcase-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  max-width: none;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.auth-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6757e8, #38b6c8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.auth-brand-name {
  font-size: 17px;
  font-weight: 600;
}

.auth-showcase-content h1 {
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 14px;
  letter-spacing: -0.3px;
}

.auth-showcase-content > p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 1.65;
}

.auth-perks {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.auth-perks li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.92);
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-perks li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  opacity: 0.85;
}

.auth-showcase-footer {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-main {
  padding:
    calc(clamp(28px, 4vw, 48px) + var(--auth-safe-top))
    calc(clamp(24px, 4vw, 48px) + var(--auth-safe-right))
    calc(clamp(28px, 4vw, 48px) + var(--auth-safe-bottom))
    calc(clamp(24px, 4vw, 48px) + var(--auth-safe-left));
  background: var(--win-surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
}

.auth-main-inner {
  width: 100%;
  max-width: 440px;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  gap: 12px;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--win-text-secondary);
  font-size: 14px;
  text-decoration: none;
  padding: 6px 10px;
  margin: -6px -10px;
  border-radius: var(--win-radius);
  transition: background 0.15s, color 0.15s;
}

.auth-back:hover {
  color: var(--win-navy);
  background: var(--win-accent-light);
}

.auth-heading { margin-bottom: 28px; }

.auth-heading h2 {
  margin: 0;
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 600;
  color: var(--win-text);
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.auth-heading p {
  margin: 6px 0 0;
  color: var(--win-text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.auth-message {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: var(--win-radius);
  font-size: 14px;
  line-height: 1.5;
  border-left: 4px solid;
}

.auth-message.error {
  color: #442726;
  background: #fde7e9;
  border-left-color: var(--win-danger);
}

.auth-message.success {
  color: #0e5814;
  background: #dff6dd;
  border-left-color: var(--win-success);
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}

.auth-field { margin-bottom: 16px; }
.auth-field.full { grid-column: 1 / -1; }

.auth-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--win-text);
}

.auth-field label .req {
  color: var(--win-danger);
  font-weight: 400;
}

.auth-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.auth-field-head label { margin-bottom: 0; }

.auth-forgot-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--win-violet);
  text-decoration: none;
  white-space: nowrap;
}

.auth-forgot-link:hover { text-decoration: underline; }

.auth-input-wrap { position: relative; }

.auth-input-wrap input,
.auth-input-wrap select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--win-stroke-input);
  border-radius: var(--win-radius);
  outline: none;
  color: var(--win-text);
  background: var(--win-surface-alt);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.auth-input-wrap input:hover,
.auth-input-wrap select:hover {
  border-color: #aab4c4;
  background: var(--win-surface);
}

.auth-input-wrap:has(.auth-toggle-pass) input { padding-right: 72px; }

.auth-input-wrap input:focus,
.auth-input-wrap select:focus {
  border-color: var(--win-violet);
  background: var(--win-surface);
  box-shadow: 0 0 0 3px rgba(103, 87, 232, 0.14);
}

.auth-input-wrap input.is-error {
  border-color: var(--win-danger);
}

.auth-toggle-pass {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  height: 30px;
  padding: 0 10px;
  border: none;
  background: transparent;
  color: var(--win-violet);
  cursor: pointer;
  border-radius: var(--win-radius);
  font-size: 12px;
  font-weight: 600;
}

.auth-toggle-pass:hover { background: var(--win-accent-light); }

.auth-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--win-text-secondary);
}

.auth-hint.error { color: #b91c1c; }

.auth-preview {
  margin-top: 4px;
  padding: 12px 14px;
  background: var(--win-surface-alt);
  border: 1px dashed var(--win-stroke);
  border-radius: var(--win-radius);
  font-size: 13px;
  color: var(--win-text-secondary);
  line-height: 1.5;
  word-break: break-all;
}

.auth-preview strong {
  display: block;
  margin-top: 4px;
  color: var(--win-navy);
  font-weight: 600;
}

.auth-input-wrap select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2369758c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.auth-actions.single {
  display: flex;
  margin-top: 28px;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 108px;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--win-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s, opacity 0.15s;
}

.auth-btn:active { transform: scale(0.98); }
.auth-btn:disabled { opacity: 0.65; cursor: not-allowed; }

.auth-actions.single .auth-btn-primary {
  flex: 1;
  width: 100%;
  min-height: 50px;
  height: auto;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--win-navy);
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(16, 24, 47, 0.16);
}

.auth-actions.single .auth-btn-primary:hover {
  background: var(--win-navy-soft);
}

.auth-footer-text {
  margin-top: 28px;
  text-align: center;
  font-size: 14px;
  color: var(--win-text-secondary);
}

.auth-footer-text a {
  color: var(--win-navy);
  font-weight: 700;
  text-decoration: none;
}

.auth-footer-text a:hover { text-decoration: underline; }

.auth-legal {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: #a19f9d;
  line-height: 1.6;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.6s linear infinite;
  display: none;
}

.auth-wizard-head {
  margin-bottom: 24px;
  padding: 14px 16px;
  background: var(--win-surface-alt);
  border: 1px solid var(--win-stroke);
  border-radius: var(--win-radius);
}

.auth-progress-track {
  height: 6px;
  background: #e8edf5;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.auth-progress-fill {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, var(--win-navy), var(--win-navy-soft));
  border-radius: 3px;
  transition: width 0.25s ease;
}

.auth-progress-label {
  margin: 0;
  font-size: 13px;
  color: var(--win-text-secondary);
}

.auth-progress-label strong {
  color: var(--win-text);
  font-weight: 600;
}

.auth-form-step { display: none; }
.auth-form-step.is-active { display: block; }

.auth-actions.split {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}

.auth-actions.split .auth-btn-light {
  flex: 0 0 auto;
  min-width: 110px;
  min-height: 50px;
  color: var(--win-text);
  background: var(--win-surface);
  border: 1px solid var(--win-stroke-input);
}

.auth-actions.split .auth-btn-light:hover {
  background: var(--win-surface-alt);
}

.auth-actions.split .auth-btn-primary {
  flex: 1;
  min-height: 50px;
  height: auto;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 16px;
  color: #fff;
  background: var(--win-navy);
  border: 1px solid transparent;
}

@media (max-width: 960px) {
  .auth-page {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-showcase {
    padding:
      calc(24px + var(--auth-safe-top))
      calc(20px + var(--auth-safe-right))
      24px
      calc(20px + var(--auth-safe-left));
  }

  .auth-showcase-inner {
    gap: 16px;
    max-width: none;
  }

  .auth-showcase-content > p,
  .auth-perks,
  .auth-showcase-footer {
    display: none;
  }

  .auth-showcase-content h1 {
    font-size: 20px;
    margin-bottom: 0;
  }

  .auth-main {
    padding:
      28px
      calc(20px + var(--auth-safe-right))
      calc(36px + var(--auth-safe-bottom))
      calc(20px + var(--auth-safe-left));
    justify-content: flex-start;
    min-height: calc(100dvh - 88px);
  }

  .auth-grid { grid-template-columns: 1fr; }
}
