/* Moved out of resources/views/partials/auth-style.blade.php on 2026-10-11 so browsers cache it.
   Edit THIS file; the partial links it with ?v=<mtime>. */
@font-face {
  font-family: "Noto Sans Lao";
  font-style: normal;
  font-weight: normal;
  font-display: swap;
  src: url(../../font/noto-sans-lao/NotoSansLao-Regular-v2.woff2) format("woff2"),
       url(../../font/noto-sans-lao/NotoSansLao-Regular.woff) format("woff"),
       url(../../font/noto-sans-lao/NotoSansLao-Regular.ttf) format("truetype");
}

@font-face {
  font-family: "Noto Sans Lao";
  font-style: normal;
  font-weight: bold;
  font-display: swap;
  src: url(../../font/noto-sans-lao/NotoSansLao-Bold-v2.woff2) format("woff2"),
       url(../../font/noto-sans-lao/NotoSansLao-Bold.woff) format("woff"),
       url(../../font/noto-sans-lao/NotoSansLao-Bold.ttf) format("truetype");
}

* {
  box-sizing: border-box;
  font-family: "Noto Sans Lao", "Noto-Sans-Lao", "Lao UI", "DokChampa", Tahoma, Arial, sans-serif;
}

html { height: 100%; }

body {
  margin: 0;
  padding: 20px;
  /* dvh keeps the panel clear of the phone's address bar; vh is the fallback. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #eef3fa;
  background: transparent;
  overflow-y: auto;
}

/* Centres like align-items would, but a panel taller than the screen scrolls
   instead of being cut off at the top — the usual flex-centring trap. */
.auth-panel { margin: auto; }

/* ---------- Transparent glass sign-in panel ---------- */

.auth-panel {
  width: min(100%, 500px);
  padding: 36px 30px 30px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(8, 16, 38, .18);
  box-shadow: 0 0 30px rgba(255, 255, 255, .14), 0 0 90px rgba(110, 165, 255, .2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: center;
}

.brand-logo {
  display: block;
  max-width: 400px;
  width: 92%;
  height: auto;
  margin: 0 auto 26px;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .5));
}

/* Gradient-ring avatar; the QR-sync script may swap in a photo here. */
.auth-avatar {
  width: 104px;
  height: 104px;
  margin: 0 auto 20px;
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6ea5ff, #2563eb);
  box-shadow: 0 0 26px rgba(110, 165, 255, .5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  border: 3px solid #0d2145;
  background: rgba(10, 20, 44, .9);
}

/* The stand-in person: a glyph inside the ring, not a disc of its own — the
   svg fills its box by default, which left no blue showing around it. */
.auth-avatar svg {
  width: 58%;
  height: 58%;
  display: block;
  color: rgba(255, 255, 255, .95);
}

/* The QR code must stay scannable — white plate, no tint or crop. */
.qr-identity {
  position: relative;
  display: block;
  width: 180px;
  height: 180px;
  margin: 0 auto 20px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 26px rgba(110, 165, 255, .5);
}

.qr-identity__code { display: block; width: 100%; height: 100%; }

.qr-identity__mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  padding: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px #fff;
  object-fit: contain;
}

.auth-greet { margin: 0 0 14px; font-size: 14px; color: rgba(207, 224, 255, .85); }
.auth-greet strong { color: #fff; }

.auth-title {
  margin: 24px 0 34px;
  /* Scales with the viewport so the line fills the panel but never wraps
     awkwardly on a narrow phone. */
  font-size: clamp(22px, 5vw, 32px);
  white-space: nowrap;
  font-weight: bold;
  color: #fff;
  line-height: 1.45;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}

/* ---------- Icon fields ---------- */

.icon-field { position: relative; margin-bottom: 16px; text-align: left; }

.icon-field .field-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #9db8e0;
  pointer-events: none;
}

.icon-field .input {
  width: 100%;
  height: 56px;
  padding: 0 48px;
  /* 16px minimum: iOS Safari zooms the whole page in on smaller fields. */
  font-size: 16px;
  color: #eef3fa;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  background: rgba(10, 20, 44, .45);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.icon-field .input::placeholder { color: rgba(232, 237, 245, .5); }

.icon-field .input:focus {
  border-color: rgba(110, 165, 255, .7);
  background: rgba(10, 20, 44, .65);
  box-shadow: 0 0 0 3px rgba(110, 165, 255, .22);
}

.toggle-eye {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: #9db8e0;
  cursor: pointer;
}

.toggle-eye:hover { color: #fff; }
.toggle-eye svg { display: block; width: 20px; height: 20px; }
.toggle-eye .eye-off { display: none; }
.toggle-eye.on .eye-on { display: none; }
.toggle-eye.on .eye-off { display: block; }

/* ---------- OTP code boxes ---------- */

.otp-group {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 2px 0 22px;
}

.otp-box {
  width: 52px;
  height: 62px;
  padding: 0;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: #eef3fa;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 12px;
  background: rgba(10, 20, 44, .45);
  outline: none;
  caret-color: #6ea5ff;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .12s ease;
  -moz-appearance: textfield;
}

.otp-box::-webkit-outer-spin-button,
.otp-box::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.otp-box.filled { border-color: rgba(110, 165, 255, .55); }

.otp-box:focus {
  border-color: rgba(110, 165, 255, .85);
  background: rgba(10, 20, 44, .7);
  box-shadow: 0 0 0 3px rgba(110, 165, 255, .25);
  transform: translateY(-1px);
}

/* A rejected code paints every box red and shakes the row once. */
.otp-group.is-invalid .otp-box {
  border-color: rgba(248, 113, 113, .75);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, .16);
}

.otp-group.is-invalid { animation: otpShake .4s ease; }

@keyframes otpShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@media (max-width: 420px) {
  .otp-group { gap: 7px; }
  .otp-box { width: 44px; height: 54px; font-size: 22px; border-radius: 10px; }
}

/* ---------- Remember / forgot row ---------- */

.remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 2px 6px;
  text-align: left;
}

.remember-row .remember-check { display: flex; align-items: center; gap: 8px; }

.remember-row input[type=checkbox] {
  width: 17px;
  height: 17px;
  accent-color: #2563eb;
  cursor: pointer;
}

.remember-row label { font-size: 14px; color: rgba(207, 224, 255, .85); cursor: pointer; }

.forgot-link { font-size: 14px; color: #9ec5ff; text-decoration: none; white-space: nowrap; }
.forgot-link:hover { color: #fff; }

/* The fields and buttons sit narrower than the widened card, centred. */
.auth-panel form { max-width: 400px; margin-left: auto; margin-right: auto; }

/* ---------- Store badges under the form ---------- */
.app-links { margin-top: 22px; text-align: center; }
.app-links-title { font-size: 13px; color: #cfe0ff; margin-bottom: 10px; letter-spacing: .02em; }
.app-links-row { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.app-links-row a { display: inline-block; line-height: 0; border-radius: 8px; transition: transform .15s ease, opacity .15s ease; }
.app-links-row a:hover { transform: translateY(-1px); opacity: .92; }
.app-links-row img { height: 44px; width: auto; display: block; }

/* ---------- Buttons / error / footer ---------- */

.btn-login {
  width: 100%;
  height: 56px;
  margin-top: 16px;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  border: none;
  border-radius: 12px;
  background: #2563eb;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .35);
  transition: background .2s ease, transform .15s ease;
}

.btn-login:hover { background: #1d4ed8; }
.btn-login:active { transform: scale(.985); }

.btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 92%;
  height: 54px;
  margin-top: 24px;
  font-size: 24px;
  font-weight: bold;
  color: #cfe0ff;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.btn-cancel:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.error-box {
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(248, 113, 113, .5);
  background: rgba(220, 38, 38, .22);
  color: #ffd9d9;
  font-size: 14px;
  text-align: left;
}

.day-calendar { margin: 26px 0 0; }
.day-calendar img { width: 64px; height: 64px; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .35)); }

/* Mobile: drop the glass box — the form sits straight on the scene. */
@media (max-width: 576px) {
  /* The form starts near the top: centred, it floated in the middle of the
     screen with the scene crowding it from below — with breathing room above
     it, clear of the status bar. */
  body { align-items: flex-start; padding: calc(40px + env(safe-area-inset-top, 0px)) 12px 24px; }

  .auth-panel {
    margin: 0 auto auto;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 480px) {
  .auth-panel { padding: 6px 14px 18px; }

  /* The panel loses its box on a phone, so the brand, the photo, the title
     and the button take that space instead of shrinking with it. */
  .brand-logo { max-width: 340px; width: 100%; margin-bottom: 20px; }
  .auth-avatar { width: 118px; height: 118px; margin-bottom: 18px; }
  .auth-title { margin: 18px 0 26px; font-size: clamp(19px, 6vw, 26px); }
  .icon-field .input { height: 48px; }
  .btn-login { height: 46px; font-size: 22px; }
  .qr-identity { width: 170px; height: 170px; margin-bottom: 16px; }
  .qr-identity__mark { width: 27px; height: 27px; }
  .day-calendar { margin-top: 18px; }
  .day-calendar img { width: 76px; height: 76px; }
}

/* Short screens (a landscape phone, or a small one with the keyboard up):
   tighten the gaps rather than the elements themselves. */
@media (max-height: 700px) {
  .brand-logo { margin-bottom: 12px; }
  .auth-avatar { width: 96px; height: 96px; margin-bottom: 12px; }
  .auth-title { margin: 12px 0 18px; }
  .qr-identity { width: 150px; height: 150px; margin-bottom: 12px; }
  .qr-identity__mark { width: 24px; height: 24px; }
  .day-calendar { margin-top: 12px; }
  .day-calendar img { width: 56px; height: 56px; }
}
