* {
  box-sizing: border-box;
}

:root {
  --auth-ink: #0b1020;
  --auth-muted: #667085;
  --auth-soft: #f6f8fc;
  --auth-line: rgba(15, 23, 42, 0.09);
  --auth-blue: #2563eb;
  --auth-indigo: #6e7af0;
  --auth-purple: #8b5cf6;
  --auth-green: #0f9f6e;
  --auth-red: #be123c;
  --auth-shadow: 0 34px 100px rgba(15, 23, 42, 0.16);
}

html {
  min-height: 100%;
}

body.picart-auth-page {
  align-items: center;
  background:
    radial-gradient(circle at 13% 8%, rgba(110, 122, 240, 0.22), transparent 30%),
    radial-gradient(circle at 84% 10%, rgba(37, 99, 235, 0.18), transparent 27%),
    radial-gradient(circle at 50% 100%, rgba(139, 92, 246, 0.10), transparent 34%),
    linear-gradient(180deg, #fbfcff 0%, #edf1f8 100%);
  color: var(--auth-ink);
  display: flex;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  justify-content: center;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  padding: 26px;
  position: relative;
}

body.picart-auth-page::before {
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  content: "";
  inset: 0;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

.auth-shell,
.login-shell,
.verify-shell {
  animation: authRise 0.62s ease both;
  position: relative;
  z-index: 1;
}

.auth-shell,
.login-shell {
  backdrop-filter: blur(24px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86)),
    rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 34px;
  box-shadow: var(--auth-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: grid;
  overflow: hidden;
  width: 100%;
}

.auth-shell {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.35fr);
  max-width: 1180px;
}

.login-shell {
  grid-template-columns: minmax(0, 1fr) 440px;
  max-width: 980px;
}

.auth-recovery-shell {
  grid-template-columns: minmax(300px, 0.88fr) minmax(430px, 0.95fr);
  max-width: 940px;
}

.auth-brand,
.login-brand {
  background:
    radial-gradient(circle at 84% 18%, rgba(255, 255, 255, 0.17), transparent 28%),
    radial-gradient(circle at 14% 92%, rgba(139, 92, 246, 0.32), transparent 34%),
    linear-gradient(145deg, #070a13 0%, #111735 46%, #1d4ed8 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 640px;
  overflow: hidden;
  padding: 48px;
  position: relative;
}

.login-brand {
  min-height: 580px;
}

.auth-recovery-brand {
  min-height: 540px;
  padding: 42px;
}

.auth-brand::after,
.login-brand::after {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.10), transparent 55%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 28px;
  bottom: -74px;
  content: "";
  height: 220px;
  position: absolute;
  right: -72px;
  transform: rotate(-10deg);
  width: 280px;
}

.brand-pill,
.selected-plan-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.01em;
  min-height: 34px;
  padding: 0 13px;
  width: fit-content;
}

.brand-pill {
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #eef2ff;
  gap: 8px;
}

.auth-logo-mini {
  background: #fff;
  border-radius: 8px;
  display: block;
  height: 22px;
  object-fit: contain;
  padding: 3px;
  width: 22px;
}

.selected-plan-pill {
  background: #eef0ff;
  border: 1px solid rgba(110, 122, 240, 0.20);
  color: #28317c;
  margin-bottom: 12px;
}

.auth-brand h1,
.login-brand h1 {
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.96;
  margin: 28px 0 16px;
  max-width: 430px;
}

.auth-recovery-brand h1 {
  font-size: clamp(38px, 4.4vw, 56px);
  max-width: 390px;
}

.auth-brand p,
.login-brand p {
  color: rgba(238, 242, 255, 0.78);
  font-size: 15.5px;
  line-height: 1.72;
  margin: 0;
  max-width: 430px;
}

.brand-list {
  display: grid;
  gap: 12px;
  margin-top: 32px;
  max-width: 390px;
}

.brand-list div {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.085);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: #f6f8ff;
  font-size: 14px;
  font-weight: 760;
  padding: 14px 16px;
}

.auth-compact-list {
  gap: 10px;
  margin-top: 26px;
}

.auth-compact-list div {
  border-radius: 16px;
  font-size: 13.5px;
  padding: 12px 14px;
}

.auth-brand small,
.login-brand small {
  color: rgba(238, 242, 255, 0.58);
  font-weight: 750;
  position: relative;
  z-index: 1;
}

.auth-form,
.login-card {
  align-self: center;
  padding: 48px;
  width: 100%;
}

.auth-recovery-card {
  align-self: center;
  padding: 42px;
}

.auth-step-copy {
  margin-bottom: 8px;
}

.auth-step-copy .selected-plan-pill {
  margin-bottom: 14px;
}

.auth-form h2,
.login-card h2,
.verify-shell h1 {
  color: var(--auth-ink);
  font-weight: 900;
  letter-spacing: -0.05em;
  margin: 0 0 8px;
}

.auth-form h2,
.login-card h2 {
  font-size: clamp(30px, 3vw, 38px);
}

.muted {
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.64;
  margin: 0 0 24px;
}

.alert {
  border: 1px solid transparent;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.45;
  margin-bottom: 16px;
  padding: 14px 16px;
}

.alert.error {
  background: #fff1f3;
  border-color: rgba(190, 18, 60, 0.12);
  color: var(--auth-red);
}

.alert.success {
  background: #ecfdf5;
  border-color: rgba(15, 159, 110, 0.14);
  color: #047857;
}

.alert.info,
.alert.dev {
  background: #eef4ff;
  border-color: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
}

.auth-steps {
  background: #f2f5fb;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 19px;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, 1fr);
  margin: 4px 0 24px;
  padding: 6px;
}

.auth-step-indicator {
  align-items: center;
  border-radius: 14px;
  color: #667085;
  display: flex;
  font-size: 13px;
  font-weight: 850;
  justify-content: center;
  min-height: 40px;
  transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.auth-step-indicator.is-active {
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.09);
  color: #101828;
}

.auth-step-panel {
  animation: authFade 0.26s ease both;
}

.auth-step-panel[hidden] {
  display: none !important;
}

.auth-recovery-panel {
  min-height: 182px;
}

.auth-fade-panel {
  animation: authFade 0.28s ease both;
}

.auth-reset-grid {
  gap: 12px;
}

.form-grid {
  display: grid;
  gap: 14px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-group {
  margin-bottom: 12px;
}

.form-group.full {
  grid-column: 1 / -1;
}

label {
  color: #344054;
  display: block;
  font-size: 13px;
  font-weight: 850;
  margin-bottom: 8px;
}

.auth-label-row {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.auth-label-row label {
  margin-bottom: 0;
}

.auth-label-row a {
  color: var(--auth-blue);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

input,
select,
textarea {
  appearance: none;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.11);
  border-radius: 15px;
  color: #101828;
  font: inherit;
  font-size: 15px;
  min-height: 52px;
  outline: none;
  padding: 0 15px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
  width: 100%;
}

select {
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position: calc(100% - 18px) 22px, calc(100% - 12px) 22px;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
  padding-right: 38px;
}

textarea {
  line-height: 1.55;
  min-height: 96px;
  padding: 14px 15px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #98a2b3;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(37, 99, 235, 0.26);
}

input:focus,
select:focus,
textarea:focus {
  background: #fff;
  border-color: rgba(37, 99, 235, 0.54);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10), 0 10px 24px rgba(15, 23, 42, 0.06);
}

input[type="file"] {
  background:
    linear-gradient(180deg, rgba(110, 122, 240, 0.05), rgba(37, 99, 235, 0.03)),
    #fff;
  border-style: dashed;
  cursor: pointer;
  min-height: 56px;
  padding: 14px;
}

input[type="file"]::file-selector-button {
  background: #101828;
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  margin-right: 12px;
  padding: 8px 13px;
}

.auth-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.btn,
.auth-secondary {
  align-items: center;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 850;
  justify-content: center;
  min-height: 52px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn {
  background: linear-gradient(135deg, #3343ff, #1d4ed8 52%, #0f172a);
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.28);
  color: #fff;
  flex: 1;
  font-size: 15px;
}

.btn:hover,
.auth-secondary:hover {
  transform: translateY(-1px);
}

.btn:focus-visible,
.auth-secondary:focus-visible,
.auth-link a:focus-visible,
.platform-link a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 3px;
}

.auth-secondary {
  background: #f2f5fb;
  color: #344054;
  padding: 0 18px;
}

.auth-link,
.platform-link {
  color: var(--auth-muted);
  text-align: center;
}

.auth-link {
  font-size: 14px;
  margin-top: 22px;
}

.platform-link {
  font-size: 12px;
  margin-top: 14px;
}

.auth-link a {
  color: var(--auth-blue);
  font-weight: 850;
  text-decoration: none;
}

.platform-link a {
  color: #98a2b3;
  text-decoration: none;
}

.verify-shell {
  backdrop-filter: blur(24px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9)),
    #fff;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 32px;
  box-shadow: var(--auth-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  max-width: 590px;
  padding: 46px;
  width: 100%;
}

.brand-row {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  align-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), transparent 28%),
    linear-gradient(135deg, #111735, #3343ff);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.26);
  color: #fff;
  display: inline-flex;
  font-weight: 900;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.brand-mark img {
  background: #fff;
  border-radius: 13px;
  display: block;
  height: 100%;
  object-fit: contain;
  padding: 5px;
  width: 100%;
}

.auth-card-brand {
  margin-bottom: 18px;
}

.brand-row strong {
  display: block;
  font-size: 15px;
}

.brand-row small {
  color: var(--auth-muted);
  font-weight: 760;
}

.verify-shell h1 {
  font-size: clamp(34px, 6vw, 46px);
  line-height: 1;
}

.verify-code-input {
  background:
    linear-gradient(180deg, rgba(110, 122, 240, 0.055), rgba(255, 255, 255, 0.96)),
    #fff;
  font-size: 30px;
  font-weight: 900;
  height: 68px;
  letter-spacing: 0.28em;
  text-align: center;
}

.resend {
  background: transparent;
  box-shadow: none;
  color: var(--auth-blue);
  height: auto;
  margin-top: 16px;
  min-height: auto;
  padding: 0;
  width: 100%;
}

.auth-resend-form {
  margin-top: 14px;
}

.auth-back-link {
  margin-top: 18px;
}

button[disabled],
.btn[disabled] {
  cursor: wait;
  opacity: 0.72;
  transform: none !important;
}

@keyframes authRise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes authFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 980px) {
  body.picart-auth-page {
    align-items: flex-start;
    padding: 14px;
  }

  .auth-shell,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .auth-recovery-shell {
    max-width: 680px;
  }

  .auth-brand,
  .login-brand {
    min-height: auto;
    padding: 30px;
  }

  .auth-recovery-brand {
    padding: 28px;
  }

  .auth-brand h1,
  .login-brand h1 {
    font-size: clamp(36px, 8vw, 50px);
    max-width: 620px;
  }

  .brand-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: none;
  }

  .auth-form,
  .login-card {
    padding: 32px;
  }

  .auth-recovery-card {
    padding: 30px;
  }
}

@media (max-width: 620px) {
  body.picart-auth-page {
    padding: 10px;
  }

  .auth-shell,
  .login-shell,
  .verify-shell {
    border-radius: 24px;
  }

  .auth-brand,
  .login-brand,
  .auth-form,
  .login-card,
  .verify-shell {
    padding: 22px;
  }

  .auth-recovery-brand,
  .auth-recovery-card {
    padding: 22px;
  }

  .auth-brand h1,
  .login-brand h1 {
    font-size: 34px;
    letter-spacing: -0.052em;
    margin: 18px 0 10px;
  }

  .auth-brand p,
  .login-brand p,
  .muted {
    font-size: 14px;
    line-height: 1.58;
  }

  .brand-list {
    gap: 8px;
    grid-template-columns: 1fr;
    margin-top: 18px;
  }

  .brand-list div {
    border-radius: 14px;
    font-size: 13px;
    padding: 11px 12px;
  }

  .auth-form h2,
  .login-card h2 {
    font-size: 28px;
  }

  .form-grid,
  .auth-steps {
    grid-template-columns: 1fr;
  }

  .auth-reset-grid {
    gap: 0;
  }

  .form-grid {
    gap: 10px;
  }

  .form-group {
    margin-bottom: 10px;
  }

  input,
  select,
  textarea {
    border-radius: 14px;
    font-size: 16px;
    min-height: 52px;
  }

  .auth-actions {
    flex-direction: column-reverse;
  }

  .btn,
  .auth-secondary {
    width: 100%;
  }

  .verify-shell h1 {
    font-size: 34px;
  }

  .verify-code-input {
    font-size: 24px;
    height: 62px;
    letter-spacing: 0.18em;
    padding-left: 18px;
    padding-right: 10px;
  }

  .platform-link {
    font-size: 11px;
  }
}
