* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--ptx-paper);
  color: var(--ptx-text);
  font-family: var(--ptx-font-body);
  -webkit-font-smoothing: antialiased;
}

body.auth-page {
  background:
    radial-gradient(circle at top left, rgba(255, 87, 34, 0.08), transparent 34%),
    linear-gradient(180deg, #fffaf6 0%, var(--ptx-paper) 100%);
}

body.auth-page h1,
body.auth-page h2,
body.auth-page h3,
body.auth-page h4,
body.auth-page p {
  margin-top: 0;
}

body.auth-page :focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ptx-brand-ring);
}

body.auth-page button,
body.auth-page input,
body.auth-page select {
  font: inherit;
}

.page-wrapper {
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(0, 0.92fr);
  min-height: 100vh;
}

.brand-side,
.visual-panel {
  position: sticky;
  top: 0;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 56px;
  color: #fff;
  background-color: var(--ptx-dark);
  background-size: cover;
  background-position: center;
}

.brand-side::before,
.visual-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(150deg, rgba(23, 19, 15, 0.92) 0%, rgba(23, 19, 15, 0.76) 48%, rgba(255, 87, 34, 0.62) 100%);
}

.brand-side > *,
.visual-panel > * {
  position: relative;
  z-index: 1;
}

.brand-side {
  background-image: url("https://images.unsplash.com/photo-1492684223066-81342ee5ff30?auto=format&fit=crop&q=80&w=1800");
}

.auth-signup .brand-side {
  background-image: url("https://images.unsplash.com/photo-1540039155733-5bb30b53aa14?auto=format&fit=crop&q=80&w=1974");
}

.auth-signup .brand-side {
  position: relative;
  height: auto;
  min-height: 100%;
  align-self: stretch;
}

.auth-recovery .brand-side {
  background-image: url("https://images.unsplash.com/photo-1557597774-9d273605dfa9?auto=format&fit=crop&q=80&w=1800");
}

.visual-panel {
  background-image: url("https://images.unsplash.com/photo-1633156199268-dc7f53f9323a?auto=format&fit=crop&q=80&w=1800");
}

.brand-mark {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--ptx-radius-pill);
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffd7c7;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-side-content,
.visual-content {
  max-width: 510px;
}

.brand-side-content h2,
.visual-content h2 {
  margin-bottom: 18px;
  color: #fff;
  font-family: var(--ptx-font-display);
  font-size: clamp(36px, 4.4vw, 58px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: 0;
}

.brand-side-content p,
.visual-content p {
  max-width: 440px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.7;
}

.brand-feature-list {
  display: grid;
  gap: 14px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.brand-feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 800;
}

.brand-feature-list i {
  width: 32px;
  height: 32px;
  display: grid;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid rgba(255, 87, 34, 0.36);
  border-radius: var(--ptx-radius-sm);
  background: rgba(255, 87, 34, 0.2);
  color: #ffb08f;
}

.brand-side-footer,
.auth-brand-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding-top: 20px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 700;
}

.encrypted-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.86);
}

.encrypted-chip i {
  color: var(--ptx-success);
  font-size: 10px;
}

.form-side {
  min-width: 0;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 56px;
  background: rgba(255, 255, 255, 0.9);
}

.auth-login .form-side,
.auth-recovery .form-side,
.auth-reset .form-side {
  align-items: center;
}

.auth-signup .form-side {
  align-items: flex-start;
}

.form-side-inner,
.form-content-wrapper,
.auth-signup .form-side > form,
.auth-signup .stepper-nav,
.auth-signup .form-header,
.auth-signup .brand-logo-top {
  width: 100%;
}

.form-side-inner,
.form-content-wrapper {
  max-width: 440px;
}

.auth-signup .form-side-inner {
  width: 100%;
  max-width: 560px;
}

.auth-signup .form-side {
  overflow-y: auto;
}

.auth-signup .brand-logo-top,
.auth-signup .stepper-nav,
.auth-signup .form-header,
.auth-signup form {
  max-width: 560px;
  margin-inline: auto;
}

.brand-logo-top img {
  width: auto;
  max-width: 180px;
  height: 42px;
  object-fit: contain;
  margin-bottom: 42px;
  border-radius: var(--ptx-radius-sm);
}

.form-header {
  margin-bottom: 30px;
}

.form-header h1 {
  margin-bottom: 8px;
  color: var(--ptx-ink);
  font-family: var(--ptx-font-display);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 900;
  line-height: 1.1;
}

.form-header p {
  margin-bottom: 0;
  color: var(--ptx-muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
}

.form-group {
  position: relative;
  display: grid;
  gap: 9px;
  margin-bottom: 20px;
}

.form-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

label {
  display: block;
  color: var(--ptx-ink-2);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.auth-recovery label,
.auth-reset label {
  color: var(--ptx-muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.input-icon-wrap,
.auth-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrap > i.field-icon {
  position: absolute;
  left: 16px;
  color: var(--ptx-faint);
  pointer-events: none;
}

.input-icon-wrap:focus-within > i.field-icon {
  color: var(--ptx-brand);
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  border: 1px solid var(--ptx-line-strong);
  border-radius: var(--ptx-radius-md);
  background: var(--ptx-surface);
  color: var(--ptx-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  padding: 13px 15px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.input-icon-wrap input {
  padding-left: 44px;
}

#password-input,
#password,
#confirm-password {
  padding-right: 48px;
}

input::placeholder {
  color: var(--ptx-faint);
  font-weight: 600;
}

input:hover,
select:hover {
  border-color: var(--ptx-line);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--ptx-brand);
  background: #fff;
  box-shadow: 0 0 0 3px var(--ptx-brand-ring);
}

.password-toggle,
.auth-password-toggle {
  position: absolute;
  right: 13px;
  top: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: var(--ptx-radius-sm);
  background: transparent;
  color: var(--ptx-muted);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.password-toggle:hover,
.auth-password-toggle:hover {
  background: var(--ptx-brand-soft);
  color: var(--ptx-brand-pressed);
}

.auth-reset .password-toggle {
  top: 43px;
  transform: none;
}

.forgot-link,
.footer-links a,
.back-link a,
.auth-link-button {
  color: var(--ptx-brand-pressed);
  font-weight: 900;
  text-decoration: none;
}

.forgot-link:hover,
.footer-links a:hover,
.back-link a:hover,
.auth-link-button:hover {
  color: var(--ptx-brand-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.auth-login .actions,
.auth-recovery .actions,
.auth-reset .actions {
  flex-direction: column;
}

.auth-signup .actions {
  border-top: 1px solid var(--ptx-line);
  padding-top: 26px;
}

.btn,
.btn-primary,
.btn-outline,
.btn-back,
.btn-continue {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: var(--ptx-radius-md);
  padding: 0 20px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.btn,
.btn-primary,
.btn-outline,
.btn-back,
.btn-continue,
.auth-full-button {
  width: 100%;
}

.btn-primary,
.btn-continue {
  background: var(--ptx-brand);
  color: #fff;
  box-shadow: var(--ptx-shadow-button);
}

.btn-primary:hover:not(:disabled),
.btn-continue:hover:not(:disabled) {
  background: var(--ptx-brand-hover);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled),
.btn-continue:active:not(:disabled) {
  background: var(--ptx-brand-pressed);
  transform: translateY(0);
}

.btn-outline,
.btn-back {
  background: var(--ptx-surface);
  border-color: var(--ptx-line-strong);
  color: var(--ptx-ink);
  box-shadow: none;
}

.btn-outline:hover,
.btn-back:hover {
  background: var(--ptx-brand-soft);
  border-color: rgba(255, 87, 34, 0.28);
  color: var(--ptx-brand-pressed);
}

.btn:disabled,
.btn-primary:disabled,
.btn-continue:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

.footer-links,
.back-link,
.auth-helper {
  margin-top: 24px;
  color: var(--ptx-muted);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.stepper-nav {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--ptx-line);
  padding-bottom: 14px;
  scrollbar-width: none;
}

.stepper-nav::-webkit-scrollbar {
  display: none;
}

.step-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  color: var(--ptx-muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.step-item.active {
  color: var(--ptx-brand-pressed);
}

.step-item.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -15px;
  left: 0;
  height: 2px;
  border-radius: var(--ptx-radius-pill);
  background: var(--ptx-brand);
}

.step-num {
  width: 26px;
  height: 26px;
  display: grid;
  flex: 0 0 26px;
  place-items: center;
  border-radius: var(--ptx-radius-sm);
  background: var(--ptx-paper-2);
  color: var(--ptx-muted);
  font-size: 12px;
}

.active .step-num {
  background: var(--ptx-brand);
  color: #fff;
}

.step-content {
  display: none;
}

.step-content.active {
  display: block;
  animation: auth-slide-in 220ms ease-out;
}

@keyframes auth-slide-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.type-card {
  min-width: 0;
  border: 1px solid var(--ptx-line);
  border-radius: var(--ptx-radius-lg);
  padding: 22px;
  background: var(--ptx-surface);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.type-card:hover {
  border-color: rgba(255, 87, 34, 0.34);
  transform: translateY(-2px);
}

.type-card.active {
  border-color: var(--ptx-brand);
  background: #fff8f4;
  box-shadow: var(--ptx-shadow-card);
}

.type-card i {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: var(--ptx-radius-md);
  background: var(--ptx-brand-soft);
  color: var(--ptx-brand-pressed);
  font-size: 17px;
}

.auth-card-title {
  margin-bottom: 8px;
  color: var(--ptx-ink);
  font-size: 16px;
  font-weight: 900;
}

.auth-card-copy {
  margin-bottom: 0;
  color: var(--ptx-muted);
  font-size: 13px;
  line-height: 1.55;
}

.auth-name-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.strength-meter {
  height: 5px;
  overflow: hidden;
  border-radius: var(--ptx-radius-pill);
  background: var(--ptx-line);
}

.strength-bar {
  width: 0;
  height: 100%;
  transition: width 220ms ease, background-color 220ms ease;
}

.rules-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rule {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ptx-muted);
  font-size: 12px;
  font-weight: 700;
}

.pin-container {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 48px));
  justify-content: center;
  gap: 10px;
  margin: 24px 0;
}

.pin-input {
  width: 100%;
  height: 56px;
  padding: 0;
  text-align: center;
  font-size: 24px;
  font-weight: 900;
}

.resend-panel {
  margin-top: 24px;
  color: var(--ptx-muted);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.resend-panel p {
  margin-bottom: 6px;
}

.auth-link-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}

#resend-timer {
  display: none;
  color: var(--ptx-muted);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(23, 19, 15, 0.58);
  backdrop-filter: blur(8px);
}

.modal-backdrop.active {
  display: flex;
}

.auth-signup .modal-backdrop {
  opacity: 0;
  transition: opacity 180ms ease;
}

.auth-signup .modal-backdrop.active {
  opacity: 1;
}

.modal-box {
  width: min(100%, 430px);
  border: 1px solid var(--ptx-line);
  border-radius: var(--ptx-radius-xl);
  background: var(--ptx-surface);
  padding: 34px;
  text-align: center;
  box-shadow: var(--ptx-shadow-modal);
}

.modal-icon-circle,
.auth-modal-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--ptx-brand-soft);
  color: var(--ptx-brand-pressed);
  font-size: 28px;
}

.auth-modal-icon {
  font-size: 30px;
}

.modal-box h2 {
  margin-bottom: 10px;
  color: var(--ptx-ink);
  font-family: var(--ptx-font-display);
  font-size: 24px;
  font-weight: 900;
}

.modal-box p {
  margin-bottom: 20px;
  color: var(--ptx-muted);
  line-height: 1.6;
}

.icon-success,
.auth-icon-success {
  background: var(--ptx-success-soft);
  color: var(--ptx-success);
}

.icon-error,
.auth-icon-error {
  background: var(--ptx-danger-soft);
  color: var(--ptx-danger);
}

.icon-warn {
  background: var(--ptx-brand-soft);
  color: var(--ptx-brand-pressed);
}

.auth-modal-note {
  border-radius: var(--ptx-radius-md);
  background: var(--ptx-paper-2);
  padding: 14px;
  color: var(--ptx-muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-emphasis {
  color: var(--ptx-brand-pressed);
  font-weight: 900;
  word-break: break-word;
}

.auth-full-button {
  margin-top: 22px;
}

.auth-modal-note i {
  margin-right: 5px;
}

.pulse-animation {
  animation: icon-pulse 1.8s infinite ease-in-out;
}

@keyframes icon-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.04);
  }
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: var(--ptx-radius-md);
  padding: 15px 16px;
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.alert-success {
  border-left: 3px solid var(--ptx-success);
  background: var(--ptx-success-soft);
  color: #166534;
}

.alert-error {
  border-left: 3px solid var(--ptx-danger);
  background: var(--ptx-danger-soft);
  color: #991b1b;
}

#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(23, 19, 15, 0.86);
  color: #fff;
  text-align: center;
  backdrop-filter: blur(8px);
}

.loader-content {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 24px;
}

.spinner {
  width: 54px;
  height: 54px;
  border: 4px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--ptx-brand);
  border-radius: 50%;
  animation: auth-spin 800ms linear infinite;
}

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

.pulse-text {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.loader-copy {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.auth-brand-footnote {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 700;
}

.auth-invalid-state {
  text-align: center;
}

.auth-invalid-icon {
  margin-bottom: 18px;
  color: var(--ptx-danger);
  font-size: 52px;
}

.auth-invalid-state .btn-primary {
  margin-top: 20px;
}

.auth-success-mark {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--ptx-success-soft);
  color: var(--ptx-success);
}

.auth-success-mark i {
  font-size: 34px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1024px) {
  .page-wrapper {
    grid-template-columns: 1fr;
  }

  .brand-side,
  .visual-panel {
    display: none;
  }

  .form-side {
    min-height: 100vh;
    align-items: center;
    padding: 40px 24px;
  }

  .form-side-inner,
  .form-content-wrapper,
  .auth-signup .brand-logo-top,
  .auth-signup .stepper-nav,
  .auth-signup .form-header,
  .auth-signup form {
    max-width: 560px;
  }

  .auth-signup .brand-side {
    position: relative;
    top: auto;
    display: flex;
    min-height: 320px;
    height: auto;
    padding: 32px 24px;
    background-position: center;
  }

  .auth-signup .brand-side-content {
    max-width: 620px;
  }

  .auth-signup .brand-side-content h2 {
    max-width: 520px;
    font-size: clamp(34px, 8vw, 52px);
  }

  .auth-signup .brand-feature-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 24px;
  }

  .auth-signup .brand-feature-list li {
    align-items: flex-start;
    font-size: 12px;
    line-height: 1.35;
  }
}

@media (max-width: 640px) {
  .auth-signup .brand-side {
    min-height: 300px;
    padding: 24px 18px;
    background-position: center top;
  }

  .auth-signup .brand-side-footer {
    display: none;
  }

  .auth-signup .brand-feature-list {
    display: none;
  }

  .auth-signup .brand-side-content h2 {
    font-size: 34px;
  }

  .auth-signup .brand-side-content p {
    font-size: 14px;
    line-height: 1.55;
  }

  .form-side {
    padding: 32px 18px;
  }

  .brand-logo-top img {
    height: 36px;
    margin-bottom: 32px;
  }

  .form-header {
    margin-bottom: 24px;
  }

  .type-grid,
  .auth-name-row,
  .rules-container {
    grid-template-columns: 1fr;
  }

  .auth-signup .actions {
    flex-direction: column;
  }

  .pin-container {
    grid-template-columns: repeat(6, minmax(0, 42px));
    gap: 7px;
  }

  .pin-input {
    height: 52px;
    font-size: 21px;
  }

  .modal-box {
    padding: 28px 20px;
  }
}

@media (max-width: 360px) {
  .form-side {
    padding-inline: 14px;
  }

  .pin-container {
    grid-template-columns: repeat(6, minmax(0, 38px));
    gap: 6px;
  }
}
