/* PAGE */
.auth-page {
  background: #0a0a0a;
  color: #f2f2f2;
  min-height: 100vh;
  overflow-x: hidden;
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 65px);
}

/* BRAND STAGE */
.auth-stage {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: 150px;
  padding: 28px 20px 54px;
  background: #0d0d0d;
}

.auth-stage::before {
  content: '';
  position: absolute;
  inset: auto auto -40% -25%;
  width: 420px;
  height: 420px;
  background: radial-gradient(
    circle,
    rgba(229, 53, 53, 0.35),
    rgba(229, 53, 53, 0) 65%
  );
  pointer-events: none;
}

.auth-sweep {
  position: absolute;
  inset: 0 auto 0 -35%;
  width: 35%;
  pointer-events: none;
  transform: skewX(-12deg);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.07),
    transparent
  );
}

.auth-glow {
  position: absolute;
  right: -10%;
  bottom: 8px;
  width: 80%;
  height: 110px;
  pointer-events: none;
  background: radial-gradient(
    closest-side,
    rgba(229, 53, 53, 0.4),
    rgba(229, 53, 53, 0)
  );
  filter: blur(8px);
}

.auth-hero {
  position: relative;
  z-index: 1;
}

.auth-hero h2 {
  margin: 0;
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-hero h2 em {
  font-style: normal;
  color: #e53535;
}

.auth-hero p,
.auth-chips {
  display: none;
}

/* FORM SHEET */
.auth-sheet {
  position: relative;
  z-index: 2;
  flex: 1;
  margin-top: -30px;
  padding: 54px 20px 32px;
  background: linear-gradient(180deg, #181818, #121212 200px);
  clip-path: polygon(0 30px, 100% 0, 100% 100%, 0 100%);
}

.auth-edge {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  width: 100%;
  height: 30px;
  overflow: visible;
  pointer-events: none;
}

.auth-edge-wide {
  display: none;
}

.auth-edge path {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.auth-edge .auth-edge-glow {
  stroke-width: 6;
  opacity: 0.35;
  filter: blur(3px);
}

.auth-view {
  max-width: 420px;
  margin: 0 auto;
}

.auth-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding: 4px 0;
  margin: -4px 0;
}

.auth-word > span {
  display: inline-block;
}

/* TITLES */
.auth-title {
  margin: 0 0 8px;
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-lede {
  margin: 0 0 28px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 15px;
}

.auth-lede strong {
  color: #f2f2f2;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* FIELDS */
.auth-label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-control {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-icon {
  position: absolute;
  left: 16px;
  color: rgba(255, 255, 255, 0.28);
  font-size: 18px;
  pointer-events: none;
  transition: color 0.2s ease;
}

.auth-control:focus-within .auth-icon {
  color: #f87171;
}

.auth-input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 46px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: #f2f2f2;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  outline: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.auth-input:focus {
  border-color: #e53535;
  background: rgba(229, 53, 53, 0.05);
  box-shadow: 0 0 0 4px rgba(229, 53, 53, 0.1);
}

.auth-input.is-error {
  border-color: rgba(239, 68, 68, 0.65);
  background: rgba(239, 68, 68, 0.04);
}

.auth-input.is-valid {
  border-color: rgba(16, 185, 129, 0.4);
}

.auth-input.has-eye {
  padding-right: 52px;
}

.auth-input.auth-code {
  height: 64px;
  padding: 0 0 0 0.55em;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.55em;
  text-align: center;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f2f2f2;
  caret-color: #f2f2f2;
  box-shadow: 0 0 0 1000px #1b1b1b inset;
  transition: background-color 9999s ease-in-out 0s;
}

.auth-eye {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: 0;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.28);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.auth-eye:hover {
  color: #f2f2f2;
}

/* STRENGTH BAR */
.strength-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition:
    width 0.4s ease,
    background 0.4s ease;
}

.strength-fill.weak {
  width: 33%;
  background: #ef4444;
}
.strength-fill.medium {
  width: 66%;
  background: #f59e0b;
}
.strength-fill.strong {
  width: 100%;
  background: #10b981;
}

/* BUTTONS AND LINKS */
.auth-btn {
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ee3d3d, #b91c1c);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow:
    0 10px 30px rgba(229, 53, 53, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition:
    transform 0.15s ease,
    filter 0.2s ease;
}

.auth-btn:hover {
  filter: brightness(1.08);
}

.auth-btn:active {
  transform: scale(0.98);
}

.auth-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.auth-link {
  padding: 0;
  background: none;
  border: 0;
  color: #f87171;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-link:hover {
  color: #fca5a5;
}

.auth-link:disabled {
  color: rgba(255, 255, 255, 0.28);
  cursor: not-allowed;
}

.auth-check {
  width: 20px;
  height: 20px;
  margin: 0;
  display: grid;
  place-items: center;
  appearance: none;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
}

.auth-check:checked {
  background: #e53535;
  border-color: #e53535;
}

.auth-check:checked::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.auth-btn:focus-visible,
.auth-link:focus-visible,
.auth-eye:focus-visible,
.auth-check:focus-visible {
  outline: 2px solid #e53535;
  outline-offset: 3px;
}

.auth-alt {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  text-align: center;
}

.auth-alt-sub {
  color: rgba(255, 255, 255, 0.28);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-alt-sub:hover {
  color: rgba(255, 255, 255, 0.55);
}

.auth-note {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.22);
  color: #4ade80;
}

.auth-resend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
}

.auth-count {
  color: rgba(255, 255, 255, 0.28);
  font-variant-numeric: tabular-nums;
}

/* DESKTOP */
@media (min-width: 900px) {
  .auth-stage {
    flex: 1.15;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    min-height: 0;
    padding: 56px;
    z-index: 1;
  }

  .auth-stage::before {
    inset: auto -10% -25% auto;
    width: 720px;
    height: 720px;
  }

  .auth-glow {
    display: none;
  }

  .auth-hero {
    max-width: 560px;
  }

  .auth-hero h2 {
    margin-bottom: 20px;
    font-size: clamp(64px, 7vw, 104px);
    line-height: 0.92;
    letter-spacing: 0.02em;
  }

  .auth-hero p {
    display: block;
    max-width: 40ch;
    margin: 0 0 28px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 17px;
  }

  .auth-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .auth-chips span {
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
  }

  .auth-sheet {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-height: calc(100vh - 65px);
    margin-top: 0;
    margin-left: -44px;
    padding: 48px 56px 48px 100px;
    background: #121212;
    clip-path: polygon(44px 0, 100% 0, 100% 100%, 0 100%);
  }

  .auth-view {
    width: 100%;
  }

  .auth-edge {
    display: none;
  }

  .auth-edge-wide {
    display: block;
    top: 0;
    left: 0;
    width: 44px;
    height: 100%;
  }

  .auth-title {
    font-size: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-btn,
  .auth-input {
    transition: none;
  }
}
