/* Trang đăng nhập Công đức — split 50/50 (tự chứa form, không phụ thuộc Bootstrap/TheAdmin) */
@import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700&family=Noto+Serif:wght@400;600&display=swap");

body:has(.auth-wrapper) {
  --ml-maroon: #7a1620;
  --ml-maroon-deep: #3a090e;
  --ml-gold: #c79a36;
  --ml-gold-bright: #dcae52;
  --ml-gold-pale: #e7c98f;
  --ml-gold-deep: #8a5a16;
  --ml-cream: #faf7f2;
  --ml-line: #e6dac3;
  --ml-text: #3a2c20;
  --ml-mute: #7a6a58;
  --ml-ease: cubic-bezier(.22, .61, .36, 1);
  --ml-login-bg-image: url("../img/demo/heritage-gate.webp");
  margin: 0;
  min-height: 100vh;
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  color: var(--ml-text);
  background: var(--ml-cream);
}
html:has(.auth-wrapper),
body:has(.auth-wrapper) {
  height: auto;
  min-height: 100%;
}

body:has(.auth-wrapper)::before {
  content: "";
  position: fixed;
  inset: 0 auto 0 0;
  width: 50vw;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(58, 9, 14, .35), rgba(58, 9, 14, .9) 75%),
    linear-gradient(180deg, rgba(30, 6, 8, .55), rgba(30, 6, 8, .92)),
    var(--ml-login-bg-image) center / cover no-repeat;
}

.ml-brand {
  position: fixed;
  inset: 0 auto 0 0;
  width: 50vw;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  text-align: center;
  color: rgba(255, 255, 255, .82);
  animation: ml-fade 1.2s var(--ml-ease) both;
}
.ml-brand__logo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin-bottom: 26px;
  object-fit: cover;
  box-shadow: 0 0 0 3px rgba(231, 201, 143, .45), 0 0 50px rgba(220, 174, 82, .35);
  background: #fff;
}
.ml-brand__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ml-gold-pale);
  margin-bottom: 12px;
}
.ml-brand__title {
  margin: 0 0 14px;
  font-family: "Noto Serif", Georgia, serif;
  font-weight: 600;
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.2;
  background: linear-gradient(100deg, var(--ml-gold-deep), var(--ml-gold-bright) 35%, #fff3d4 50%, var(--ml-gold-bright) 65%, var(--ml-gold));
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ml-shimmer 8s ease-in-out infinite;
}
.ml-brand__lead {
  max-width: 380px;
  margin: 0;
  font-weight: 300;
  line-height: 1.7;
}
.ml-brand__mandala {
  position: absolute;
  width: min(620px, 46vw);
  aspect-ratio: 1;
  opacity: .12;
  color: var(--ml-gold-pale);
  animation: ml-spin 160s linear infinite;
  pointer-events: none;
}

body:has(.auth-wrapper) > .d-flex {
  position: relative;
  z-index: 2;
  margin-left: 50vw;
  width: 50vw;
  min-height: 100vh;
  height: auto !important;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}
body:has(.auth-wrapper) .container-fluid {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}
.auth-wrapper {
  width: 100%;
  animation: ml-rise 1s var(--ml-ease) .1s both;
  box-sizing: border-box;
}
.auth-wrapper *,
.auth-wrapper *::before,
.auth-wrapper *::after {
  box-sizing: border-box;
}
.auth-wrapper > .row {
  display: block;
  margin: 0;
  width: 100%;
}
.auth-wrapper > .row > [class*="col-"] {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  flex: none;
}

.auth-wrapper .auth-form {
  background: #fff;
  border: 1px solid var(--ml-line);
  border-radius: 16px;
  padding: 36px 34px 30px;
  box-shadow: 0 24px 50px -28px rgba(74, 12, 18, .35);
  position: relative;
  overflow: hidden;
  width: 100%;
}
.auth-wrapper .auth-form::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--ml-gold-deep), var(--ml-gold-bright), var(--ml-gold-deep));
}
.auth-wrapper h1 {
  font-family: "Noto Serif", Georgia, serif;
  font-weight: 600;
  font-size: 26px !important;
  color: var(--ml-maroon);
  margin: 0 0 4px;
  line-height: 1.3;
}
.auth-wrapper .ml-sub {
  margin: 0 0 26px;
  font-size: 14px;
  color: var(--ml-mute);
}
.auth-wrapper hr {
  display: none;
}
.auth-wrapper .mb-3 {
  margin-bottom: 1rem;
}
.auth-wrapper .list-unstyled {
  list-style: none;
  padding: 0;
  margin: 0;
}

.auth-wrapper .form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ml-text);
  margin-bottom: 6px;
}
.auth-wrapper .form-control {
  display: block;
  width: 100%;
  height: 46px;
  max-width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.4;
  color: var(--ml-text);
  background: #fffdf8;
  border: 1px solid var(--ml-line);
  border-radius: 10px;
  transition: border-color .3s, box-shadow .3s;
  appearance: none;
}
.auth-wrapper .form-control:focus {
  border-color: var(--ml-gold);
  box-shadow: 0 0 0 4px rgba(199, 154, 54, .16);
  background: #fff;
  outline: 0;
}

/* Password + eye: flex group tự chứa, không cần Bootstrap */
.auth-wrapper .input-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  position: relative;
}
.auth-wrapper .input-group > .form-control {
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.auth-wrapper .input-group > .btn,
.auth-wrapper .input-group > #togglePassword {
  flex: 0 0 46px;
  width: 46px;
  min-width: 46px;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ml-line);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: #fffdf8;
  color: var(--ml-mute);
  box-shadow: none;
  cursor: pointer;
}
.auth-wrapper .input-group > .btn:hover,
.auth-wrapper .input-group > #togglePassword:hover {
  color: var(--ml-maroon);
  background: #fbf3e2;
}
.auth-wrapper .input-group > .btn:focus,
.auth-wrapper .input-group > #togglePassword:focus {
  outline: 0;
  box-shadow: none;
}

.auth-wrapper .auth-form .form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 0;
  margin: 0.25rem 0 1rem;
  min-height: 0;
}
.auth-wrapper .auth-form .form-check .form-check-input {
  float: none;
  margin: 0;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 1px solid #cdbb98;
  accent-color: var(--ml-maroon);
}
.auth-wrapper .form-check-input:checked {
  background-color: var(--ml-maroon);
  border-color: var(--ml-maroon);
}
.auth-wrapper .form-check-input:focus {
  box-shadow: 0 0 0 4px rgba(199, 154, 54, .16);
  border-color: var(--ml-gold);
}
.auth-wrapper .form-check-label {
  font-size: 14px;
  color: var(--ml-mute);
  margin: 0;
}

.auth-wrapper .btn-primary,
.auth-wrapper button[type="submit"].btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  margin-top: 6px;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .02em;
  color: #2a1406;
  background: linear-gradient(135deg, var(--ml-gold-bright), var(--ml-gold) 55%, var(--ml-gold-deep));
  box-shadow: 0 10px 24px -10px rgba(199, 154, 54, .8);
  cursor: pointer;
  transition: transform .35s var(--ml-ease), box-shadow .35s var(--ml-ease), filter .3s;
}
.auth-wrapper .btn-primary:hover,
.auth-wrapper .btn-primary:focus {
  color: #2a1406;
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 14px 28px -10px rgba(199, 154, 54, .9);
}
.auth-wrapper .btn-primary:active {
  transform: none;
}

.auth-wrapper a {
  color: var(--ml-maroon);
  text-decoration: none;
}
.auth-wrapper a:hover {
  color: var(--ml-gold-deep);
  text-decoration: underline;
}
.auth-wrapper .text-danger,
.auth-wrapper .validation-summary-errors {
  color: #9a3520 !important;
  font-size: 13px;
}
.auth-wrapper .validation-summary-errors ul {
  margin: 0 0 14px;
  padding-left: 18px;
}
.auth-wrapper .alert {
  border-radius: 10px;
  font-size: 14px;
}

.ml-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--ml-mute) !important;
  text-decoration: none !important;
  transition: color .3s, gap .3s var(--ml-ease);
}
.ml-back:hover {
  color: var(--ml-maroon) !important;
  gap: 10px;
}
.ml-mobile-logo {
  display: none;
  object-fit: cover;
  background: #fff;
}

@keyframes ml-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ml-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ml-spin { to { rotate: 360deg; } }
@keyframes ml-shimmer { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

@media (max-width: 900px) {
  body:has(.auth-wrapper)::before {
    width: 100vw;
    height: 230px;
    inset: 0 0 auto 0;
    position: absolute;
  }
  .ml-brand { display: none; }
  body:has(.auth-wrapper) > .d-flex {
    margin-left: 0;
    width: 100%;
    padding: 120px 16px 40px;
    align-items: flex-start !important;
    justify-content: flex-start;
  }
  .ml-mobile-logo {
    display: block;
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(231, 201, 143, .6), 0 10px 30px rgba(0, 0, 0, .3);
  }
  .auth-wrapper .auth-form {
    padding: 30px 22px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ml-brand,
  .auth-wrapper,
  .ml-brand__title,
  .ml-brand__mandala {
    animation: none !important;
  }
}
