/* Trang đăng nhập. Chỉ dùng token của tinvan.css (--tt-*), nên tự đổi theo nền tối. */

.lg {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 14rem);
  padding: 1.5rem 0 2rem;
}
.lg-card {
  position: relative;
  width: 100%;
  max-width: 25rem;
  padding: 2.25rem 2rem 1.75rem;
  background: var(--tt-paper);
  border: 1px solid var(--tt-rule);
  border-radius: 1.25rem;
  box-shadow: var(--tt-lift);
  animation: lg-in .5s var(--tt-ease) both;
}
/* Một vệt màu nhấn mảnh ở mép trên — dấu hiệu nhận diện, không phải trang trí thêm khối. */
.lg-card::before {
  content: "";
  position: absolute; left: 2rem; right: 2rem; top: -1px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--tt-accent);
}
.lg-mark {
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  border-radius: .85rem;
  background: var(--tt-accent-soft);
  color: var(--tt-accent);
}
.lg-mark svg { width: 1.4rem; height: 1.4rem; }
.lg-title {
  margin-top: 1.1rem;
  font-family: var(--tt-display);
  font-weight: 600;
  font-size: 1.85rem;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--tt-ink);
}
.lg-lede { margin-top: .4rem; font-size: .9375rem; line-height: 1.5; color: var(--tt-muted); }

.lg-note {
  margin-top: 1.25rem;
  padding: .7rem .85rem;
  border-radius: .75rem;
  font-size: .875rem; line-height: 1.45;
  color: var(--tt-ink-2);
  background: var(--tt-sunk);
  border: 1px solid var(--tt-rule);
}
.lg-note.is-err {
  color: var(--tt-danger);
  background: color-mix(in srgb, var(--tt-danger) 8%, var(--tt-paper));
  border-color: color-mix(in srgb, var(--tt-danger) 30%, var(--tt-rule));
}
.lg-note.is-ok { color: var(--tt-accent-strong); background: var(--tt-accent-soft); border-color: transparent; }

.lg-form { margin-top: 1.5rem; display: grid; gap: 1.1rem; }
.lg-field label { display: block; margin-bottom: .4rem; font-size: .8125rem; font-weight: 600; color: var(--tt-ink-2); }
.lg-input { position: relative; }
.lg-input > .tt-ic {
  position: absolute; left: .9rem; top: 50%; transform: translateY(-50%);
  color: var(--tt-muted); pointer-events: none; transition: color .2s;
}
.lg-input:focus-within > .tt-ic { color: var(--tt-accent); }
.lg-input .tt-field { height: 3rem; padding: 0 1rem 0 2.6rem; }
#password.tt-field { padding-right: 3rem; }
.lg-input.is-bad .tt-field { border-color: var(--tt-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tt-danger) 14%, transparent); }
.lg-input.is-bad { animation: lg-shake .35s var(--tt-ease); }

.lg-peek {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  width: 2.4rem; height: 2.4rem; display: grid; place-items: center;
  border-radius: .6rem; color: var(--tt-muted);
  -webkit-tap-highlight-color: transparent;
}
.lg-peek:hover { background: var(--tt-sunk); color: var(--tt-ink); }
.lg-peek:focus-visible { outline: 2px solid var(--tt-accent); outline-offset: 1px; }
.lg-peek .lg-eye-off, .lg-peek[aria-pressed="true"] .lg-eye { display: none; }
.lg-peek[aria-pressed="true"] .lg-eye-off { display: block; }
.lg-caps { margin-top: .4rem; font-size: .8125rem; color: var(--tt-amber); }

.lg-submit { width: 100%; min-height: 3rem; margin-top: .35rem; font-size: .9375rem; border-radius: .8rem; }
.lg-submit:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tt-accent-soft), 0 0 0 1px var(--tt-accent); }
.lg-spin {
  display: none; width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: lg-rot .7s linear infinite;
}
.lg-submit.is-busy { pointer-events: none; opacity: .85; }
.lg-submit.is-busy .lg-spin { display: inline-block; }

.lg-foot {
  margin-top: 1.4rem; padding-top: 1.1rem;
  border-top: 1px solid var(--tt-rule);
  font-size: .8125rem; line-height: 1.55; color: var(--tt-muted);
}

@keyframes lg-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes lg-rot { to { transform: rotate(360deg); } }
@keyframes lg-shake { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@media (prefers-reduced-motion: reduce) {
  .lg-card, .lg-input.is-bad { animation: none; }
}

@media (max-width: 479px) {
  .lg { place-items: start center; min-height: 0; padding-top: .75rem; }
  .lg-card { padding: 1.75rem 1.25rem 1.4rem; border-radius: 1rem; }
  .lg-card::before { left: 1.25rem; right: 1.25rem; }
  .lg-title { font-size: 1.6rem; }
}
