:root {
  --auth-bg: #eef3f8;
  --auth-panel: #ffffff;
  --auth-text: #14202e;
  --auth-muted: #6d7e91;
  --auth-border: #d7e1eb;
  --auth-blue: #2f6fdd;
  --auth-blue-dark: #174ea6;
  --auth-danger: #b4232f;
  --auth-danger-bg: #fff0f1;
  --auth-success: #207653;
  --auth-success-bg: #e9f7ef;
  --auth-shadow: 0 24px 70px rgba(25, 37, 52, 0.16);
  --auth-font: "Aptos", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --auth-mono: "IBM Plex Mono", "Cascadia Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--auth-font);
  color: var(--auth-text);
  background:
    radial-gradient(circle at 18% 18%, rgba(47, 111, 221, 0.14), transparent 28%),
    linear-gradient(135deg, #f7fbff 0%, var(--auth-bg) 50%, #e7eef7 100%);
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  overflow: hidden;
  border: 1px solid var(--auth-border);
  border-radius: 28px;
  background: var(--auth-panel);
  box-shadow: var(--auth-shadow);
  transition: max-width 0.24s ease, grid-template-columns 0.24s ease;
}

.auth-story {
  min-height: 620px;
  padding: 44px;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(12, 24, 42, 0.78), rgba(17, 44, 80, 0.72)),
    url("/assets/entrada-residential-shell.jpg") center / cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  background: var(--auth-blue);
  box-shadow: 0 12px 28px rgba(47, 111, 221, 0.35);
}

.auth-mark svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.auth-copy {
  max-width: 390px;
}

.auth-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.auth-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  line-height: 1.7;
}

.auth-form-panel {
  padding: 48px;
  display: grid;
  align-content: center;
  position: relative;
}

.auth-kicker {
  margin-bottom: 10px;
  color: var(--auth-blue);
  font-family: var(--auth-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-form-panel h2 {
  margin: 0 0 10px;
  font-size: 32px;
  letter-spacing: -0.045em;
}

.auth-subtitle {
  margin: 0 0 28px;
  color: var(--auth-muted);
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-field {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--auth-text);
}

.auth-field input {
  height: 48px;
  border: 1px solid var(--auth-border);
  border-radius: 14px;
  padding: 0 14px;
  font: inherit;
  color: var(--auth-text);
  background: #fbfdff;
  outline: none;
}

.auth-field input:focus {
  border-color: var(--auth-blue);
  box-shadow: 0 0 0 4px rgba(47, 111, 221, 0.12);
}

.auth-button {
  height: 50px;
  border: 0;
  border-radius: 14px;
  background: var(--auth-blue);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.16s ease;
}

.auth-button:hover {
  background: var(--auth-blue-dark);
}

.auth-button:active {
  transform: translateY(1px);
}

.auth-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-link-button {
  border: 0;
  padding: 0;
  color: var(--auth-blue);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.otp-page {
  background:
    radial-gradient(circle at 50% 18%, rgba(47, 111, 221, 0.2), transparent 34%),
    radial-gradient(circle at 18% 82%, rgba(23, 78, 166, 0.16), transparent 32%),
    linear-gradient(135deg, #f7fbff 0%, var(--auth-bg) 58%, #e3edf8 100%);
}

.otp-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.otp-card {
  width: min(500px, 100%);
  position: relative;
  overflow: hidden;
  padding: 48px;
  border: 1px solid rgba(185, 202, 221, 0.86);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.94)),
    #ffffff;
  box-shadow: 0 28px 80px rgba(25, 37, 52, 0.17);
  text-align: center;
  animation: otpRise 0.28s ease both;
}

.otp-card::before {
  content: "";
  position: absolute;
  inset: -50% 18% auto;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(47, 111, 221, 0.22), transparent 68%);
  pointer-events: none;
}

.otp-brand {
  position: relative;
  margin-bottom: 22px;
  color: var(--auth-blue);
  font-family: var(--auth-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.otp-card h1 {
  position: relative;
  margin: 0 0 12px;
  font-size: clamp(38px, 7vw, 54px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.otp-note-text {
  position: relative;
  margin: 0 auto 28px;
  max-width: 360px;
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.6;
}

.otp-form {
  position: relative;
  display: grid;
  gap: 18px;
}

.otp-verified .otp-card {
  box-shadow: 0 28px 90px rgba(47, 111, 221, 0.24);
}

.otp-code-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 2px;
  position: relative;
  transition: width 0.28s ease, height 0.28s ease, border-color 0.28s ease, background-color 0.28s ease, box-shadow 0.28s ease;
}

.otp-digit {
  width: 100%;
  height: 58px;
  border: 1px solid var(--auth-border);
  border-radius: 16px;
  background: #f8fbff;
  color: var(--auth-text);
  font: 800 24px/1 var(--auth-mono);
  text-align: center;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}

.otp-digit:focus {
  border-color: var(--auth-blue);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(47, 111, 221, 0.12), 0 12px 28px rgba(47, 111, 221, 0.14);
  transform: translateY(-1px);
}

.otp-digit.is-filled {
  border-color: rgba(47, 111, 221, 0.46);
}

.otp-code-grid::after {
  content: "";
  width: 18px;
  height: 32px;
  position: absolute;
  left: 50%;
  top: 46%;
  border-right: 4px solid #ffffff;
  border-bottom: 4px solid #ffffff;
  opacity: 0;
  transform: translate(-50%, -54%) rotate(45deg) scale(0.6);
  transition: opacity 0.18s ease 0.2s, transform 0.22s ease 0.2s;
}

.otp-verified .otp-code-grid {
  width: 92px;
  height: 72px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid rgba(32, 118, 83, 0.28);
  border-radius: 24px;
  background: linear-gradient(145deg, #1f9d67, #207653);
  box-shadow: 0 18px 44px rgba(32, 118, 83, 0.28);
}

.otp-verified .otp-code-grid::after {
  opacity: 1;
  transform: translate(-50%, -54%) rotate(45deg) scale(1);
}

.otp-verified .otp-digit {
  opacity: 0;
  transform: scale(0.64);
  pointer-events: none;
}

.otp-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--auth-muted);
  font-size: 13px;
}

.auth-back-button {
  justify-self: center;
  margin-top: 2px;
}

@keyframes otpRise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.auth-note,
.auth-error {
  display: none;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.auth-note {
  color: var(--auth-success);
  background: var(--auth-success-bg);
}

.auth-error {
  color: var(--auth-danger);
  background: var(--auth-danger-bg);
}

.auth-switch {
  margin-top: 22px;
  color: var(--auth-muted);
  font-size: 14px;
}

.auth-switch a {
  color: var(--auth-blue);
  font-weight: 800;
  text-decoration: none;
}

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

  .auth-card {
    min-height: 100dvh;
    grid-template-columns: 1fr;
    border-radius: 0;
  }

  .auth-story {
    min-height: 270px;
    padding: 28px;
  }

  .auth-form-panel {
    padding: 30px 22px 40px;
  }

  .otp-code-grid {
    gap: 7px;
  }

  .otp-digit {
    height: 52px;
    border-radius: 14px;
    font-size: 21px;
  }

  .otp-screen {
    padding: 18px;
  }

  .otp-card {
    padding: 38px 20px;
    border-radius: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .auth-button,
  .otp-code-grid,
  .otp-code-grid::after,
  .otp-digit,
  .otp-card {
    animation: none;
    transition: none;
  }
}
