:root{
  --auth-bg:#f4f7fb;
  --auth-card:#ffffff;
  --auth-line:#d8e4f5;
  --auth-text:#10243f;
  --auth-muted:#5c6f8f;
  --auth-accent:#0b5ed7;
  --auth-accent-strong:#0848a5;
  --auth-danger:#c62828;
  --auth-success:#1f7a45;
}

*{
  box-sizing:border-box;
}

body.auth-body{
  margin:0;
  min-height:100vh;
  font-family:"Montserrat",Arial,sans-serif;
  color:var(--auth-text);
  background-image:
    linear-gradient(rgba(244,247,251,.78), rgba(238,244,251,.88)),
    var(--auth-background-image, none),
    radial-gradient(circle at top, rgba(11,94,215,.10), transparent 30%),
    linear-gradient(180deg, #f7faff 0%, #eef4fb 100%);
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  background-attachment:fixed;
}

.auth-layout{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
}

.auth-panel{
  width:min(100%, 404px);
  min-width:0;
  padding:26px 26px 28px;
  border:1px solid var(--auth-line);
  border-radius:26px;
  background:var(--auth-card);
  box-shadow:0 24px 64px rgba(8,34,84,.10);
}

.auth-panel__top{
  position:relative;
  min-height:52px;
  display:grid;
  place-items:center;
  margin-bottom:18px;
}

.auth-panel__back{
  position:absolute;
  left:0;
  top:0;
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  border:1px solid var(--auth-line);
  border-radius:13px;
  background:#fff;
  color:var(--auth-accent);
  text-decoration:none;
  transition:background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.auth-panel__back svg{
  width:20px;
  height:20px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.auth-panel__back:hover{
  background:#f4f8ff;
  border-color:#b9cff0;
  transform:translateX(-2px);
  box-shadow:0 8px 18px rgba(11,94,215,.10);
}

.auth-panel__brand{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
}

.auth-panel__logo{
  width:40px;
  height:40px;
}

.auth-panel__copy{
  margin:0 0 18px;
}

.auth-panel__eyebrow{
  display:inline-block;
  margin-bottom:12px;
  color:var(--auth-accent);
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.auth-panel__copy h1{
  margin:0 0 10px;
  font-size:38px;
  line-height:1.02;
}

.auth-panel__copy p,
#auth-resend-hint{
  margin:0;
  color:var(--auth-muted);
  line-height:1.6;
}

.auth-panel__copy p{
  max-width:290px;
  font-size:14px;
}

.auth-form{
  display:grid;
  gap:12px;
  min-width:0;
}

.auth-step{
  display:grid;
  gap:14px;
  min-width:0;
}

.auth-step[hidden]{
  display:none !important;
}

.auth-step--code{
  width:100%;
  overflow:hidden;
  gap:16px;
}

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0, 0, 0, 0);
  white-space:nowrap;
  border:0;
}

.auth-field input{
  width:100%;
  min-height:56px;
  padding:0 16px;
  border:1px solid var(--auth-line);
  border-radius:18px;
  font:inherit;
  color:var(--auth-text);
  background:#fbfcff;
}

.auth-field input:focus{
  outline:none;
  border-color:rgba(11,94,215,.6);
  box-shadow:0 0 0 4px rgba(11,94,215,.10);
}

.auth-honeypot{
  position:absolute;
  left:-9999px;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}

.auth-button{
  min-height:58px;
  border:0;
  border-radius:18px;
  background:var(--auth-accent);
  color:#fff;
  font:inherit;
  font-weight:700;
  cursor:pointer;
  transition:transform .18s ease, background .18s ease, opacity .18s ease;
}

.auth-button:hover{
  background:var(--auth-accent-strong);
}

.auth-button:active{
  transform:scale(.985);
}

.auth-button:disabled{
  cursor:default;
  opacity:.7;
}

.auth-button--resend{
  background:#f3f6fb;
  color:var(--auth-text);
}

.auth-button--resend:not(:disabled){
  background:var(--auth-accent);
  color:#fff;
}

.auth-button--resend:not(:disabled):hover{
  background:var(--auth-accent-strong);
}

.auth-code-copy{
  display:grid;
  gap:8px;
  text-align:center;
}

.auth-code-copy h2{
  margin:0;
  font-size:28px;
  line-height:1.05;
}

.auth-code-copy p{
  margin:0;
  font-size:15px;
  line-height:1.5;
  color:var(--auth-text);
}

.auth-code-copy strong{
  display:block;
  margin-top:4px;
  font-weight:700;
  color:var(--auth-text);
}

.auth-code-copy__spam-hint{
  color:var(--auth-muted) !important;
  font-size:13px !important;
}

.auth-code-inputs{
  display:grid;
  width:100%;
  grid-template-columns:repeat(6, minmax(0, 1fr));
  gap:8px;
  min-width:0;
}

.auth-code-inputs input{
  min-width:0;
  min-height:64px;
  padding:0;
  border:1.5px solid #d6e2f5;
  border-radius:18px;
  text-align:center;
  font-size:30px;
  font-weight:600;
  color:var(--auth-text);
  background:#fff;
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease, color .18s ease;
}

.auth-code-inputs input:focus{
  outline:none;
  border-color:rgba(11,94,215,.65);
  box-shadow:0 0 0 4px rgba(11,94,215,.10);
}

.auth-code-inputs input:hover:not(:focus){
  background:#fff;
  border-color:#d6e2f5;
  box-shadow:none;
}

.auth-code-inputs.is-error input{
  border-color:rgba(198,40,40,.45);
  background:#fff5f5;
  color:#b42318;
}

.auth-code-inputs.is-success input{
  border-color:rgba(31,122,69,.42);
  background:#f1fbf5;
  color:#17663a;
  font-weight:800;
  animation:auth-success-pop .42s ease;
}

.auth-code-inputs.is-shaking{
  animation:auth-shake .34s cubic-bezier(.36,.07,.19,.97);
}

@keyframes auth-shake{
  10%,90%{transform:translateX(-1px)}
  20%,80%{transform:translateX(2px)}
  30%,50%,70%{transform:translateX(-4px)}
  40%,60%{transform:translateX(4px)}
}

@keyframes auth-success-pop{
  0%{transform:translateY(0) scale(1)}
  45%{transform:translateY(-1px) scale(1.04)}
  100%{transform:translateY(0) scale(1)}
}

.auth-feedback{
  min-height:20px;
  margin:0;
  font-size:14px;
  line-height:1.5;
  text-align:center;
}

.auth-feedback[data-type="error"]{
  color:var(--auth-danger);
}

.auth-feedback[data-type="success"]{
  color:var(--auth-success);
}

.auth-panel.is-code-step .auth-panel__copy{
  display:none;
}

#auth-resend-hint{
  text-align:center;
  font-size:13px;
  line-height:1.45;
}

@media (max-width: 640px){
  .auth-layout{
    padding:12px;
  }

  .auth-panel{
    width:min(100%, 390px);
    padding:22px 18px 24px;
    border-radius:24px;
  }

  .auth-panel__copy h1{
    font-size:28px;
  }

  .auth-code-inputs input{
    min-height:58px;
    font-size:26px;
  }
}
