/* Login MTTQ — theo tông trang công (data-site-theme) */
:root,
html[data-site-theme="blue"] {
  --mttq-red: #1d4ed8;
  --mttq-red-deep: #1e3a8a;
  --mttq-red-soft: #3b82f6;
  --mttq-gold: #93c5fd;
  --mttq-ink: #0f172a;
  --mttq-muted: #475569;
  --mttq-font: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  --login-body-bg:
    radial-gradient(ellipse 90% 70% at 12% 8%, rgba(96, 165, 250, .28), transparent 55%),
    radial-gradient(ellipse 80% 60% at 88% 85%, rgba(59, 130, 246, .22), transparent 50%),
    radial-gradient(ellipse 55% 45% at 50% 45%, rgba(239, 246, 255, .4), transparent 65%),
    linear-gradient(165deg, #334155 0%, #3b4f6b 35%, #455a7a 65%, #2c3a4f 100%);
  --login-blob-a: rgba(191, 219, 254, .35);
  --login-blob-b: rgba(96, 165, 250, .25);
  --login-card-shadow: rgba(30, 58, 138, .22);
  --login-left-bg: linear-gradient(155deg, #3b82f6 0%, #2563eb 32%, #1d4ed8 58%, #60a5fa 78%, #eff6ff 100%);
  --login-right-bg: linear-gradient(180deg, rgba(255, 255, 255, .92) 0%, rgba(239, 246, 255, .78) 55%, rgba(219, 234, 254, .7) 100%);
  --login-accent-rgb: 29, 78, 216;
  --login-dev-ink: #1e3a8a;
}

html[data-site-theme="teal"] {
  --mttq-red: #0f766e;
  --mttq-red-deep: #134e4a;
  --mttq-red-soft: #14b8a6;
  --mttq-gold: #99f6e4;
  --mttq-ink: #0f172a;
  --mttq-muted: #475569;
  --login-body-bg:
    radial-gradient(ellipse 90% 70% at 12% 8%, rgba(45, 212, 191, .25), transparent 55%),
    radial-gradient(ellipse 80% 60% at 88% 85%, rgba(13, 148, 136, .22), transparent 50%),
    radial-gradient(ellipse 55% 45% at 50% 45%, rgba(240, 253, 250, .4), transparent 65%),
    linear-gradient(165deg, #2d3f42 0%, #355055 35%, #3d5c5f 65%, #28383b 100%);
  --login-blob-a: rgba(153, 246, 228, .32);
  --login-blob-b: rgba(45, 212, 191, .22);
  --login-card-shadow: rgba(19, 78, 74, .22);
  --login-left-bg: linear-gradient(155deg, #14b8a6 0%, #0d9488 32%, #0f766e 58%, #5eead4 78%, #f0fdfa 100%);
  --login-right-bg: linear-gradient(180deg, rgba(255, 255, 255, .92) 0%, rgba(240, 253, 250, .78) 55%, rgba(204, 251, 241, .7) 100%);
  --login-accent-rgb: 15, 118, 110;
  --login-dev-ink: #134e4a;
}

html[data-site-theme="red"] {
  --mttq-red: #b71c1c;
  --mttq-red-deep: #7f0000;
  --mttq-red-soft: #e53935;
  --mttq-gold: #f0c14b;
  --mttq-ink: #1a1212;
  --mttq-muted: #5c4a4a;
  --login-body-bg:
    radial-gradient(ellipse 90% 70% at 12% 8%, rgba(200, 120, 120, .22), transparent 55%),
    radial-gradient(ellipse 80% 60% at 88% 85%, rgba(160, 90, 90, .2), transparent 50%),
    radial-gradient(ellipse 55% 45% at 50% 45%, rgba(255, 245, 240, .35), transparent 65%),
    linear-gradient(165deg, #5a4548 0%, #6e5558 35%, #7a5f62 65%, #534044 100%);
  --login-blob-a: rgba(255, 210, 200, .28);
  --login-blob-b: rgba(180, 120, 130, .22);
  --login-card-shadow: rgba(80, 30, 40, .22);
  --login-left-bg: linear-gradient(155deg, #e53935 0%, #ef5350 32%, #ec407a 58%, #f48fb1 78%, #ffeef2 100%);
  --login-right-bg: linear-gradient(180deg, rgba(255, 255, 255, .92) 0%, rgba(255, 245, 248, .78) 55%, rgba(255, 236, 240, .7) 100%);
  --login-accent-rgb: 183, 28, 28;
  --login-dev-ink: #7f0000;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

.login-body {
  min-height: 100vh;
  font-family: var(--mttq-font);
  color: var(--mttq-ink);
  position: relative;
  overflow-x: hidden;
  background: var(--login-body-bg);
}

.login-body::before,
.login-body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(48px);
  opacity: .4;
  z-index: 0;
}

.login-body::before {
  width: min(420px, 70vw);
  height: min(420px, 70vw);
  top: -8%;
  right: -5%;
  background: var(--login-blob-a);
  animation: login-float 14s ease-in-out infinite;
}

.login-body::after {
  width: min(360px, 60vw);
  height: min(360px, 60vw);
  bottom: -10%;
  left: -8%;
  background: var(--login-blob-b);
  animation: login-float 18s ease-in-out infinite reverse;
}

@keyframes login-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(18px, -22px); }
}

.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.login-card {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .55);
  box-shadow:
    0 28px 70px var(--login-card-shadow),
    inset 0 1px 0 rgba(255, 255, 255, .75);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}

/* ===== Cột trái — dải đỏ / hồng / trắng tươi ===== */
.login-left {
  position: relative;
  padding: 36px 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  background: var(--login-left-bg);
  border-right: 1px solid rgba(255, 255, 255, .35);
}

.login-left::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .22) 0%, transparent 42%),
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, .35), transparent 42%),
    radial-gradient(circle at 88% 78%, rgba(255, 255, 255, .2), transparent 38%);
  pointer-events: none;
}

.login-left-main,
.login-left-foot {
  position: relative;
  z-index: 1;
}

.login-left-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .92), rgba(255, 248, 240, .75));
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 10px 28px rgba(0, 0, 0, .18);
  backdrop-filter: blur(10px);
}

.login-logo {
  width: 120px;
  height: auto;
  max-height: 88px;
  object-fit: contain;
  display: block;
}

.login-app-name {
  margin: 8px 0 0;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1.35;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
}

.login-app-name__province {
  display: block;
  color: #fff8e7;
  font-size: .95em;
  text-shadow: 0 1px 8px rgba(120, 20, 40, .25);
}

.login-app-sub {
  margin: 0;
  color: rgba(255, 248, 240, .95);
  font-weight: 600;
  font-size: .88rem;
  letter-spacing: .04em;
  text-shadow: 0 1px 6px rgba(100, 20, 40, .2);
}

.login-lead {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, .9);
  font-size: .9rem;
  line-height: 1.5;
  max-width: 34ch;
  text-shadow: 0 1px 4px rgba(80, 20, 40, .2);
}

.login-back {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: #fff8e1;
  font-weight: 700;
  font-size: .88rem;
  text-decoration: none;
  transition: color .15s ease, transform .15s ease;
}

.login-back:hover {
  color: #fff;
  transform: translateX(-2px);
}

.login-left-foot {
  padding-top: 16px;
  border-top: 1px solid rgba(var(--login-accent-rgb), .18);
  text-align: center;
}

.login-dev-label {
  margin: 0 0 10px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(var(--login-accent-rgb), .75);
}

.login-dev-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none !important;
  color: var(--login-dev-ink);
}

.login-dev-brand:hover { color: var(--mttq-red); }

.login-dev-logo-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background: #fff;
  border-radius: 5px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .85),
    0 4px 14px rgba(0, 0, 0, .18);
  overflow: hidden;
  line-height: 0;
}

.login-dev-logo {
  height: 36px;
  width: auto;
  max-width: min(200px, 72vw);
  object-fit: contain;
  display: block;
}

.login-dev-name {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
}

/* ===== Cột phải — form kính ===== */
.login-right {
  padding: 36px 32px 28px;
  background: var(--login-right-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.login-title {
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--mttq-red-deep);
  font-weight: 800;
  font-size: 1.35rem;
}

.login-title-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(155deg, var(--mttq-red-soft), var(--mttq-red-deep));
  color: #fff;
  font-size: 1.1rem;
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 8px 20px rgba(var(--login-accent-rgb), .28);
}

.login-label {
  display: block;
  font-weight: 700;
  font-size: .82rem;
  color: var(--mttq-red-deep);
  margin: 12px 0 6px;
}

.login-label:first-of-type { margin-top: 0; }

.login-field {
  position: relative;
  display: flex;
  align-items: stretch;
}

.login-field-icon {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 46px;
  display: grid;
  place-items: center;
  color: var(--mttq-red);
  font-size: .95rem;
  pointer-events: none;
  border-right: 1px solid rgba(var(--login-accent-rgb), .12);
  background: linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(var(--login-accent-rgb), .08));
  border-radius: 12px 0 0 12px;
  transition: color .15s ease, background .15s ease;
}

.login-field .login-input { padding-left: 3.25rem; }
.login-field--password .login-input { padding-right: 2.85rem; }

.login-pass-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #7a6565;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.login-pass-toggle:hover {
  color: var(--mttq-red);
  background: rgba(var(--login-accent-rgb), .08);
}

.login-field:focus-within .login-field-icon {
  color: #fff;
  background: linear-gradient(155deg, var(--mttq-red-soft), var(--mttq-red-deep));
  border-right-color: rgba(255, 255, 255, .2);
}

.login-input {
  width: 100%;
  border: 1px solid rgba(var(--login-accent-rgb), .18);
  border-radius: 12px;
  padding: .72rem .85rem;
  font: inherit;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(8px);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.login-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.login-input:focus,
.login-field:focus-within .login-input {
  outline: none;
  border-color: rgba(var(--login-accent-rgb), .45);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 3px rgba(var(--login-accent-rgb), .15);
}

.login-err {
  display: block;
  color: var(--mttq-red);
  font-size: .78rem;
  font-weight: 700;
  margin-top: 4px;
}

.login-alert {
  margin: 12px 0 0;
  padding: .65rem .85rem;
  border-radius: 10px;
  background: rgba(var(--login-accent-rgb), .1);
  border: 1px solid rgba(var(--login-accent-rgb), .22);
  color: var(--mttq-red-deep);
  font-weight: 700;
  font-size: .88rem;
  display: flex;
  align-items: flex-start;
  gap: .45rem;
}

/* Captcha glass */
.login-captcha {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(7.5rem, 9rem);
  gap: .45rem;
  align-items: center;
}

.login-captcha__input {
  min-width: 7.5rem;
  text-align: center;
  font-weight: 700;
}

.login-captcha__q {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: .35rem .6rem;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .03em;
  user-select: none;
  color: var(--mttq-red-deep);
  background: linear-gradient(160deg, rgba(255, 255, 255, .65), rgba(var(--login-accent-rgb), .12));
  border: 1px dashed rgba(var(--login-accent-rgb), .28);
  backdrop-filter: blur(8px);
}

.login-captcha__refresh {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 12px;
  border: 1px solid rgba(var(--login-accent-rgb), .2);
  background: rgba(255, 255, 255, .65);
  color: var(--mttq-red);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease, transform .15s ease;
}

.login-captcha__refresh:hover {
  background: rgba(var(--login-accent-rgb), .1);
  transform: rotate(-20deg);
}

.login-submit {
  width: 100%;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  padding: .78rem 1rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, var(--mttq-red-soft), var(--mttq-red) 55%, var(--mttq-red-deep));
  box-shadow:
    0 10px 24px rgba(var(--login-accent-rgb), .35),
    inset 0 1px 0 rgba(255, 255, 255, .25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: filter .15s ease, transform .15s ease;
}

.login-submit:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.login-submit:active { transform: translateY(0); }

.login-note {
  margin: 14px 0 0;
  color: var(--mttq-muted);
  font-size: .8rem;
  line-height: 1.45;
  text-align: center;
}

.login-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  margin-top: 12px;
  color: var(--mttq-red);
  font-weight: 700;
  font-size: .88rem;
  text-decoration: none;
}

.login-home-link:hover { color: var(--mttq-red-deep); text-decoration: underline; }

@media (max-width: 820px) {
  .login-card {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .login-left {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .18);
    padding: 28px 24px 22px;
    min-height: auto;
  }

  .login-right { padding: 28px 24px; }

  .login-lead { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .login-body::before,
  .login-body::after { animation: none; }
  .login-submit,
  .login-captcha__refresh { transition: none; }
}
