/* Login page */
.auth-wrap{
  min-height:100vh; min-height:100svh;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:32px 20px calc(24px + env(safe-area-inset-bottom));
  background:linear-gradient(160deg, #deeaff 0%, #f0f4fb 50%, #fff 100%);
}

/* Brand */
.auth-brand{text-align:center; margin:0 0 24px}
.auth-brand img{
  width:110px; height:110px; display:block; margin:0 auto 14px;
  filter:drop-shadow(0 8px 18px rgba(13,59,138,.2));
}
.auth-brand h1{font-size:22px; font-weight:800; color:#0d3b8a; letter-spacing:-.3px; margin:0}
.auth-brand p{font-size:13px; color:var(--muted); margin:4px 0 0}

/* Card */
.auth-card{
  width:100%; max-width:360px;
  background:#fff; border-radius:20px;
  padding:24px 20px 20px;
  box-shadow:0 4px 6px rgba(15,23,42,.04), 0 16px 40px rgba(15,23,42,.10);
  display:flex; flex-direction:column; gap:16px;
}

/* Error */
.auth-alert{
  padding:10px 14px; border-radius:10px; font-size:13px; font-weight:500;
  background:var(--err-soft); color:var(--err); border:1px solid #fca5a5;
}

/* Field label */
.auth-field{display:flex; flex-direction:column; gap:7px}
.auth-field > span:first-child{font-size:12px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.05em}

/* Phone input */
.auth-input{
  position:relative; display:flex; align-items:center;
  height:52px; border:1.5px solid var(--border); border-radius:12px; background:#fafbfd;
  transition:border-color .12s, box-shadow .12s;
}
.auth-input:focus-within{border-color:var(--primary); background:#fff; box-shadow:0 0 0 3px rgba(21,101,192,.12)}
.auth-input > svg{flex:0 0 20px; width:20px; height:20px; margin:0 10px 0 14px; color:var(--faint)}
.auth-input input{
  flex:1; min-width:0; height:100%; border:0; outline:0; background:transparent;
  font-size:17px; color:var(--fg); padding:0 14px 0 0; letter-spacing:.01em;
}
.auth-input input::placeholder{color:#c0cad8; font-size:15px}

/* PIN dots */
.auth-pin-wrap{position:relative}
.auth-pin-hidden{
  position:absolute; opacity:0; pointer-events:none;
  width:1px; height:1px; top:0; left:0;
}
.auth-pin-dots{
  display:flex; gap:16px; justify-content:center; align-items:center;
  height:60px; border:1.5px solid var(--border); border-radius:12px;
  background:#fafbfd; cursor:text; transition:border-color .12s, box-shadow .12s;
}
.auth-pin-dots.focused{border-color:var(--primary); background:#fff; box-shadow:0 0 0 3px rgba(21,101,192,.12)}
.auth-pin-dot{
  width:16px; height:16px; border-radius:50%;
  border:2px solid #d0d8e8; background:transparent;
  transition:background .12s, border-color .12s, transform .1s;
}
.auth-pin-dot.filled{background:var(--primary); border-color:var(--primary)}
.auth-pin-dot.active{border-color:var(--primary); transform:scale(1.25)}
/* Digit shown (eye on) */
.auth-pin-dot.digit{
  width:22px; height:28px; border:0; border-radius:0; background:transparent;
  display:flex; align-items:center; justify-content:center;
  font-size:22px; font-weight:800; color:var(--fg); line-height:1;
}

/* Eye toggle, inside the PIN box on the right */
.auth-eye{
  position:absolute; top:50%; right:6px; transform:translateY(-50%);
  width:44px; height:44px; border:0; border-radius:10px; background:transparent;
  display:flex; align-items:center; justify-content:center;
  color:var(--faint); cursor:pointer; -webkit-tap-highlight-color:transparent;
}
.auth-eye:hover{color:var(--primary)}
.auth-eye svg{width:22px; height:22px}
.auth-eye .eye-off{display:none}
.auth-eye.on{color:var(--primary)}
.auth-eye.on .eye-on{display:none}
.auth-eye.on .eye-off{display:block}

/* Login button */
.auth-btn{
  position:relative; height:52px; border:0; border-radius:12px; cursor:pointer;
  background:var(--primary); color:#fff; font-family:inherit; font-size:16px; font-weight:700;
  box-shadow:0 4px 14px rgba(21,101,192,.30);
  display:flex; align-items:center; justify-content:center; gap:10px;
  -webkit-tap-highlight-color:transparent;
  transition:transform .08s, filter .12s;
  margin-top:4px;
}
.auth-btn:active{transform:scale(.98)}
.auth-btn:disabled{filter:saturate(.7) brightness(.95); cursor:wait}
.auth-spin{
  display:none; width:18px; height:18px; border-radius:50%;
  border:2px solid rgba(255,255,255,.4); border-top-color:#fff;
  animation:auth-spin .7s linear infinite;
}
.auth-btn.busy .auth-spin{display:block}
@keyframes auth-spin{to{transform:rotate(360deg)}}

/* Auto-login status (replaces the button) */
.auth-alert[hidden], .auth-status[hidden]{display:none}
.auth-status{
  display:flex; align-items:center; justify-content:center; gap:10px;
  height:48px; border-radius:12px; font-size:15px; font-weight:700;
}
.auth-status.wait{background:#eef4ff; color:var(--primary)}
.auth-status.ok{background:#e7f7ee; color:#15803d; border:1px solid #86efac}
.auth-status-ico{width:18px; height:18px; flex:0 0 18px; border-radius:50%}
.auth-status.wait .auth-status-ico{
  border:2px solid rgba(21,101,192,.25); border-top-color:var(--primary);
  animation:auth-spin .7s linear infinite;
}
.auth-status.ok .auth-status-ico{
  background:#16a34a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/12px no-repeat;
}
.auth-pin-dots.shake{animation:auth-shake .35s; border-color:var(--err)}
@keyframes auth-shake{
  20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)}
}

/* Credit */
.auth-credit{margin:20px 0 0; font-size:12px; color:var(--faint)}
.auth-credit b{color:var(--text-2); font-weight:600}

/* ---------- PC: split screen (brand panel left, form right) ---------- */
.auth-side, .auth-head{display:none}

@media (min-width:960px){
  .auth-shell{display:grid; grid-template-columns:minmax(420px, 46%) 1fr; min-height:100vh}

  .auth-side{
    position:relative; overflow:hidden;
    display:flex; flex-direction:column; justify-content:space-between;
    padding:40px 56px; color:#fff;
    background:
      radial-gradient(600px 400px at 85% 10%, rgba(255,255,255,.14), transparent 60%),
      radial-gradient(500px 500px at 0% 100%, rgba(56,189,248,.25), transparent 60%),
      linear-gradient(155deg, #0d47a1 0%, #1565c0 55%, #1e88e5 100%);
  }
  /* soft dotted texture */
  .auth-side::before{
    content:""; position:absolute; inset:0; pointer-events:none;
    background-image:radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
    background-size:22px 22px;
    mask-image:linear-gradient(180deg, #000 0%, transparent 70%);
    -webkit-mask-image:linear-gradient(180deg, #000 0%, transparent 70%);
  }
  .auth-side > *{position:relative}

  .auth-side-top{display:flex; align-items:center; gap:12px; font-size:18px; font-weight:700; letter-spacing:-.2px}
  .auth-side-top img{width:44px; height:44px; border-radius:12px; background:#fff; padding:4px; box-shadow:0 6px 16px rgba(0,0,0,.18)}

  .auth-side-mid{max-width:440px}
  .auth-side-mid h2{font-size:36px; line-height:1.18; font-weight:700; letter-spacing:-.8px; margin:0 0 14px}
  .auth-side-mid > p{font-size:15px; line-height:1.6; color:rgba(255,255,255,.82); margin:0 0 32px}

  .auth-feats{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:12px}
  .auth-feats li{
    display:flex; align-items:center; gap:14px;
    padding:14px 16px; border-radius:14px;
    background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.14);
    backdrop-filter:blur(6px);
  }
  .auth-feat-ico{
    flex:0 0 40px; width:40px; height:40px; border-radius:10px;
    display:flex; align-items:center; justify-content:center;
    background:rgba(255,255,255,.16);
  }
  .auth-feat-ico svg{width:20px; height:20px}
  .auth-feats li > span:last-child{display:flex; flex-direction:column; gap:2px; font-size:13px; color:rgba(255,255,255,.78)}
  .auth-feats b{font-size:14px; font-weight:600; color:#fff}

  .auth-side-foot{margin:0; font-size:12px; color:rgba(255,255,255,.6)}

  /* Right side */
  .auth-wrap{background:#f7f9fc; padding:48px}
  .auth-brand{display:none}
  .auth-head{display:block; width:100%; max-width:400px; margin:0 0 24px}
  .auth-head h1{font-size:28px; font-weight:700; letter-spacing:-.6px; color:var(--fg); margin:0 0 6px}
  .auth-head p{font-size:14px; color:var(--muted); margin:0}

  .auth-card{max-width:400px; padding:28px; border:1px solid var(--border); box-shadow:0 1px 2px rgba(15,23,42,.04), 0 12px 32px rgba(15,23,42,.06)}
  .auth-credit{display:none}
}

@media (min-width:1400px){
  .auth-side{padding:56px 80px}
  .auth-side-mid h2{font-size:42px}
}
