/* ============================================================
   GTBNPS FINANCE — AUTH
   Sign-in. Phone number + PIN, the same way the staff already sign
   in to the school's other app — so there is nothing new to learn
   on day one.
   ============================================================ */

.auth {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s5);
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(52,71,138,.5), transparent 60%),
    radial-gradient(900px 560px at 96% 104%, rgba(212,160,23,.16), transparent 58%),
    linear-gradient(165deg, var(--navy) 0%, var(--navy-deep) 100%);
  overflow-y: auto;
}

.auth__card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  padding: var(--s8) var(--s6) var(--s6);
  animation: authIn var(--spring);
}
@keyframes authIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }

.auth__brand { text-align: center; margin-bottom: var(--s6); }
.auth__mark {
  width: 62px; height: 62px; margin: 0 auto var(--s4);
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(145deg, var(--navy), var(--navy-deep));
  display: grid; place-items: center;
  color: var(--gold-light); font-weight: var(--w-black); font-size: 21px; letter-spacing: -1px;
  box-shadow: var(--sh-md);
}
.auth__mark img { width: 100%; height: 100%; object-fit: cover; }
.auth__name { font-size: var(--t-lg); font-weight: var(--w-bold); letter-spacing: -.02em; }
.auth__tag { font-size: var(--t-sm); color: var(--text-3); margin-top: 3px; }

/* PIN entry — six boxes, because a PIN pad reads as a PIN pad and a
   plain password field does not. The real value lives in one hidden
   input so password managers and the numeric keyboard both behave. */
.pin { display: flex; gap: 9px; justify-content: center; margin: var(--s2) 0 var(--s3); }
.pin__box {
  width: 46px; height: 54px; border-radius: var(--r-md);
  border: 1.5px solid var(--border-strong); background: var(--surface-alt);
  display: grid; place-items: center;
  font-size: var(--t-xl); font-weight: var(--w-bold); color: var(--navy);
  transition: border-color var(--fast), background var(--fast), transform var(--fast);
}
.pin__box.filled { border-color: var(--navy); background: #fff; }
.pin__box.filled::after {
  content: ''; width: 11px; height: 11px; border-radius: 50%; background: var(--navy);
}
.pin__box.on { border-color: var(--navy-soft); box-shadow: 0 0 0 3px rgba(52,71,138,.14); }
.pin__input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.pin.shake { animation: shake .4s; }
@keyframes shake {
  10%,90% { transform: translateX(-2px); }
  20%,80% { transform: translateX(4px); }
  30%,50%,70% { transform: translateX(-7px); }
  40%,60% { transform: translateX(7px); }
}

.auth__err {
  background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border);
  padding: 10px var(--s3); border-radius: var(--r-sm);
  font-size: var(--t-sm); font-weight: var(--w-medium);
  margin-bottom: var(--s4); text-align: center;
}
.auth__foot { text-align: center; margin-top: var(--s5); font-size: var(--t-xs); color: var(--text-4); }
.auth__help { text-align: center; margin-top: var(--s4); font-size: var(--t-sm); color: var(--text-3); }

/* Numeric keypad for phones — typing a PIN with the OS keyboard on a
   cheap Android is slower and more error-prone than eight big keys. */
.keypad { display: none; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: var(--s4); }
.keypad__key {
  height: 52px; border-radius: var(--r-md);
  background: var(--surface-alt); border: 1px solid var(--border);
  font-size: var(--t-lg); font-weight: var(--w-semi); color: var(--text);
  transition: background var(--fast), transform var(--fast);
}
.keypad__key:active { background: var(--bg-sunken); transform: scale(.96); }
.keypad__key.fn { font-size: var(--t-sm); color: var(--text-2); font-weight: var(--w-semi); }
@media (hover: none) and (max-width: 640px) { .keypad { display: grid; } }

/* PIN-confirmation dialog for the private view. */
.pinask { text-align: center; padding: var(--s2) 0; }
.pinask__icon {
  width: 48px; height: 48px; margin: 0 auto var(--s3);
  border-radius: var(--r-md); background: var(--gold-pale);
  display: grid; place-items: center; color: #8A6A0C;
}
.pinask__icon svg { width: 23px; height: 23px; stroke-width: 1.9; }

/* ══════════════════════════════════════════════════════════
   COUNTRY CODE PICKER
   ══════════════════════════════════════════════════════════ */
.phone-row { display: flex; gap: var(--s2); }

.dialbtn {
  display: flex; align-items: center; gap: 6px; flex: none;
  height: 40px; padding: 0 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color var(--fast), background var(--fast);
}
.dialbtn:hover { background: var(--bg-sunken); }
.dialbtn__flag { font-size: 17px; line-height: 1; }
.dialbtn__code { font-size: var(--t-base); font-weight: var(--w-semi); font-variant-numeric: tabular-nums; }
.dialbtn__chev { width: 13px; height: 13px; color: var(--text-3); }
.phone-row .input { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; letter-spacing: .02em; }

.dialmenu {
  margin-top: 6px; border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--surface);
  box-shadow: var(--sh-md); overflow: hidden;
  animation: dialIn var(--fast);
}
@keyframes dialIn { from { opacity: 0; transform: translateY(-4px); } }
.dialmenu__item {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%; padding: 10px var(--s3);
  font-size: var(--t-sm); text-align: left;
  transition: background var(--fast);
  border-bottom: 1px solid var(--border-light);
}
.dialmenu__item:last-child { border-bottom: 0; }
.dialmenu__item:hover { background: var(--bg-sunken); }
.dialmenu__item.on { background: var(--blue-bg); }
.dialmenu__flag { font-size: 18px; line-height: 1; flex: none; }
.dialmenu__name { flex: 1; font-weight: var(--w-medium); }
.dialmenu__code {
  color: var(--text-3); font-weight: var(--w-semi);
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════
   PIN STEP — back button and the number being confirmed
   ══════════════════════════════════════════════════════════ */
.auth__back {
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 10px 0 6px; margin-bottom: var(--s3);
  border-radius: var(--r-sm);
  font-size: var(--t-sm); font-weight: var(--w-semi); color: var(--text-2);
  transition: background var(--fast), color var(--fast);
}
.auth__back:hover { background: var(--bg-sunken); color: var(--navy); }
.auth__back svg { width: 15px; height: 15px; stroke-width: 2.4; }

.auth__who { text-align: center; margin-bottom: var(--s4); }
.auth__who-label { font-size: var(--t-xs); color: var(--text-3); }
.auth__who-num {
  font-size: var(--t-md); font-weight: var(--w-bold);
  font-variant-numeric: tabular-nums; letter-spacing: .01em; margin-top: 1px;
}
