*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --yellow: #f5a800;
  --yellow-dark: #d98f00;
  --yellow-light: #fff8e7;
  --red: #d0202e;
  --navy: #014c8d;
  --navy-dark: #111d33;

  --white: #ffffff;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #adb5bd;
  --gray-500: #6c757d;
  --gray-600: #555d66;
  --gray-700: #495057;
  --gray-900: #212529;

  --text-primary: var(--gray-900);
  --text-muted: var(--gray-500);
  --border: #d9d9d9;
  --border-focus: var(--yellow);
  --error: #dc3545;
  --error-bg: #fff5f5;
  --input-bg: var(--white);

  --panel-left-w: 520px;
  --status-bar-h: 40px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --transition: 0.18s ease;
}

html,
body {
  height: 100%;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: #e8eaed;

  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

svg {
  display: block;
  flex-shrink: 0;
}

.page-wrapper {
  position: relative;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.panel-left {
  width: var(--panel-left-w);
  min-width: var(--panel-left-w);
  height: 100%;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 48px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10;
  position: absolute;
  border-radius: 0 24px 24px 0;
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.15);
}

.logo-area {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.vnpost-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}

.vnpost-logo svg {
  display: block;
}

.vnpost-logo__text {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: #1f365c;
  line-height: 1;
}

.vnpost-logo__img {
  display: block;
  max-width: 100%;
  height: 52px;
  object-fit: contain;
}

.form-header {
  width: 100%;
  margin-bottom: 18px;
  text-align: center;
}

.form-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 4px;
}

.form-subtitle {
  font-size: 14px;
  color: #f5a800;
  line-height: 1.4;
  font-weight: 500;
}

.alert-message {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  background-color: #fff4e5;
  color: #8a6d3b;
  border: 1px solid #e6c19a;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
}

.alert-message img {
  flex-shrink: 0;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-700);
  line-height: 1.2;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  height: 55px;
  border: 1px solid #d9e2ed;
  border-radius: 12px;
  padding: 0 44px 0 40px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--input-bg);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  outline: none;
  line-height: 55px;
}

.form-input::placeholder {
  color: var(--gray-400);
  font-size: 13px;
}

.form-input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(245, 168, 0, 0.14);
}

.form-input.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  color: var(--gray-400);
  pointer-events: none;
}

.input-icon svg {
  width: 24px;
  height: 24px;
}

.btn-icon-right {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  padding: 2px;
  color: var(--gray-500);
  transition: color var(--transition);
  line-height: 0;
}

.btn-icon-right:hover {
  color: var(--yellow-dark);
}

.btn-icon-right svg,
.btn-icon-right img {
  width: 20px;
  height: 20px;
}

/* Eye toggle icon wrapper */
.eye-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 40px;
  height: 30px;
}

/* Diagonal line for eye-off state */
.eye-off-line {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 2px;
  background: var(--gray-400);
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 1px;
  pointer-events: none;
}

.field-error {
  font-size: 11.5px;
  color: var(--error);
  min-height: 13px;
  line-height: 13px;
}

.forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.link-forgot {
  font-size: 16px;
  font-weight: 500;
  color: var(--navy);
  transition: color var(--transition);
}

.link-forgot:hover {
  color: var(--yellow-dark);
  text-decoration: underline;
}

.captcha-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.captcha-image-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.captcha-image {
  width: 160px;
  height: 56px;
  flex-shrink: 0;
  border: 1px solid #d9e2ed;
  border-radius: 12px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: stretch;
  overflow: hidden;
  user-select: none;
}

.captcha-image canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: fill;
}

/* VNP CaptchaWidget render <div.x-cap__row><img.x-cap__img>; ép vừa khung captcha */
.captcha-image .x-cap__row {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.captcha-image .x-cap__img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
}

.btn-icon-refresh {
  width: 55px;
  height: 55px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid #d9e2ed;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition:
    border-color var(--transition),
    color var(--transition),
    background var(--transition);
}

.btn-icon-refresh:hover {
  border-color: var(--yellow);
  color: var(--yellow-dark);
  background: var(--yellow-light);
}

.btn-icon-refresh svg,
.btn-icon-refresh img {
  width: 18px;
  height: 18px;
}

.btn-icon-refresh.spin svg,
.btn-icon-refresh.spin img {
  animation: spin 0.45s linear;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  min-width: 320px;
  max-width: 420px;
  transform: translateX(120%);
  opacity: 0;
  border-left: 6px solid transparent;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  animation: toastSlideIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  box-sizing: border-box;
}

.toast-success {
  background: #e8f8f0;
  border-left-color: #2ecc71;
}

.toast-success .toast-title {
  color: #1e7e34;
}

.toast-success .toast-message {
  color: #27ae60;
}

.toast-success .toast-icon {
  color: #2ecc71;
}

.toast-success .toast-close {
  color: #2ecc71;
}

.toast-info {
  background: #eaf2f8;
  border-left-color: #3498db;
}

.toast-info .toast-title {
  color: #1a5276;
}

.toast-info .toast-message {
  color: #2980b9;
}

.toast-info .toast-icon {
  color: #3498db;
}

.toast-info .toast-close {
  color: #3498db;
}

.toast-warning {
  background: #fef9e7;
  border-left-color: #f5a800;
}

.toast-warning .toast-title {
  color: #7d6608;
}

.toast-warning .toast-message {
  color: #b7950b;
}

.toast-warning .toast-icon {
  color: #f5a800;
}

.toast-warning .toast-close {
  color: #f5a800;
}

.toast-error {
  background: #fdedec;
  border-left-color: #ea2c3b;
}

.toast-error .toast-title {
  color: #78281f;
}

.toast-error .toast-message {
  color: #c0392b;
}

.toast-error .toast-icon {
  color: #ea2c3b;
}

.toast-error .toast-close {
  color: #ea2c3b;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon svg {
  width: 100%;
  height: 100%;
}

.toast-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toast-title {
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.2;
}

.toast-message {
  font-size: 12.5px;
  line-height: 1.35;
  font-weight: 500;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: 1px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.toast-close:hover {
  opacity: 1;
}

.toast-close svg {
  width: 100%;
  height: 100%;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

@media (max-width: 480px) {
  .toast-container {
    top: 16px;
    right: 16px;
    left: 16px;
  }

  .toast {
    min-width: unset;
    width: 100%;
  }
}

.btn-submit,
.btn-back,
.btn-crm-password {
  height: 55px;
  width: 100%;
  border-radius: 12px;
  background: linear-gradient(to right, #f5a800 0%, #e09500 100%);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  transition:
    filter var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
  box-shadow: 0 2px 10px rgba(245, 168, 0, 0.32);
}

.btn-submit:hover:not(:disabled),
.btn-back:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(245, 168, 0, 0.38);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@media (min-height: 650px) {
  .logo-area {
    margin-top: auto;
  }
  .login-form {
    margin-bottom: auto;
  }
}

.panel-footer {
  margin-top: auto;
  padding-top: 14px;
  text-align: center;
  width: 100%;
}

.footer-credit {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.footer-company {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  transition: color var(--transition);
}

.panel-right {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(145deg, #0d3b27 0%, #1b5e3b 28%, #2d7a52 55%, #3a8f60 78%, #2b6e47 100%);
  overflow: hidden;
  z-index: 1;
  padding-bottom: 64px;
}

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("../images/login-bg-0.png");
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.panel-right::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(5, 20, 12, 0.3) 0%, rgba(5, 20, 12, 0.05) 50%, rgba(5, 20, 12, 0.5) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 156px 56px 0;
  flex-shrink: 0;
  margin-left: calc(var(--panel-left-w));
}

.hero-title {
  font-size: clamp(32px, 3.8vw, 52px);
  font-weight: 800;
  color: #fff;
  line-height: 1.12;
  margin-bottom: 16px;
}

.hero-accent {
  width: 44px;
  height: 4px;
  background: var(--yellow);
  border-radius: 2px;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.5;
}

.feature-grid {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 48px;
  padding: 24px 56px 48px;
  justify-content: flex-start;
  flex-shrink: 0;
  margin-left: calc(var(--panel-left-w));
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 0;
  width: 160px;
}

.feature-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.feature-icon svg,
.feature-icon img {
  width: 32px;
  height: 32px;
  stroke: var(--yellow, #f5a800);
  display: block;
}

.feature-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.feature-desc {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
  max-width: 160px;
}

.login-footer {
  position: absolute;
  bottom: 0;
  left: calc(var(--panel-left-w) * 0.52);
  right: 0;
  height: 64px;
  background: #102a4c;
  z-index: 5;
}

.login-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding-left: calc(var(--panel-left-w) * 0.48 + 32px);
  padding-right: 80px;
  margin-left: 100px;
}

.login-footer__item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
}

.login-footer__item svg,
.login-footer__item img {
  flex-shrink: 0;
  stroke: var(--yellow, #f5a800);
}

.footer-logo-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

.btn-group {
  display: flex;
  gap: 10px;
}

.btn-back,
.btn-crm-password {
  opacity: 1;
  border: 1px solid var(--yellow);
  background: transparent;
  color: var(--yellow);
  box-shadow: none;
}

.btn-crm-password {
  background: #ffffff;
  background-image: none;
  border: 1px solid #014c8d;
  color: #014c8d;
  box-shadow: none;
}

.btn-crm-password:hover {
  background: #f0f4f8;
  color: #013b6f;
  border-color: #013b6f;
}

@media (max-width: 900px) {
  html,
  body {
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
  }

  .page-wrapper {
    display: block;
    height: 100%;
    overflow: visible;
  }

  .panel-left {
    position: relative;
    width: 100%;
    min-width: unset;
    min-height: 100vh;
    padding: 40px 24px 24px;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .panel-right {
    display: none;
  }

  .login-footer {
    display: none;
  }
}

.shadow-text {
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-input--no-icon {
  padding-left: 16px;
}

@media (max-width: 480px) {
  .form-row-2col {
    grid-template-columns: 1fr;
  }
}
