html,
body {
  min-height: 100%;
}

body:has(.form-signin) {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: flex-end;
  overflow-x: hidden;
  padding: 48px max(7vw, 40px) !important;
  color: #172033;
  background: linear-gradient(90deg, #151a24 0%, #151a24 52%, #f3f5f8 52%, #f3f5f8 100%) !important;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body:has(.form-signin)::before {
  position: fixed;
  top: 9vh;
  bottom: 9vh;
  left: 7vw;
  width: min(38vw, 560px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 18%, rgba(217, 35, 50, 0.72), transparent 10rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.015));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
  content: "";
}

body:has(.form-signin)::after {
  position: fixed;
  bottom: 15vh;
  left: calc(7vw + 48px);
  width: min(28vw, 420px);
  color: rgba(255, 255, 255, 0.9);
  content: "B2B workspace";
  font-size: clamp(2rem, 4vw, 4.4rem);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.form-signin {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  margin: 0 !important;
  padding: 0;
}

.form-signin form {
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid #dfe4ec;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.13);
}

.form-signin picture {
  display: inline-flex;
  margin-bottom: 28px;
  padding: 7px 10px;
  border: 1px solid #e8ebf0;
  border-radius: 9px;
  background: #fff;
}

.form-signin picture img {
  width: 168px;
  height: auto;
}

.form-signin br {
  display: none;
}

.form-signin h1,
.form-signin .h3 {
  margin-bottom: 8px !important;
  color: #172033;
  font-size: 1.72rem;
  font-weight: 740 !important;
  letter-spacing: -0.035em;
}

.auth-intro {
  margin: 0 0 24px;
  color: #6b7587;
  font-size: 0.9rem;
  line-height: 1.55;
}

.form-signin .form-floating {
  margin-top: 12px !important;
}

.form-signin .form-control {
  min-height: 54px;
  border-color: #cfd6e0;
  border-radius: 10px;
  color: #172033;
  background: #fff;
  box-shadow: none;
}

.form-signin .form-control:focus {
  border-color: #d92332;
  box-shadow: 0 0 0 4px rgba(217, 35, 50, 0.1);
}

.form-signin .form-floating:focus-within {
  z-index: 2;
}

.form-signin .form-check {
  color: #596477;
  font-size: 0.84rem;
}

.form-signin .form-check-input:checked {
  border-color: #d92332;
  background-color: #d92332;
}

.form-signin .btn-primary {
  min-height: 46px;
  border-color: #d92332;
  border-radius: 10px;
  background: #d92332;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(217, 35, 50, 0.2);
}

.form-signin .btn-primary:hover {
  border-color: #b91825;
  background: #b91825;
  transform: translateY(-1px);
}

.form-signin .form-group {
  margin-top: 14px;
  text-align: center;
}

.form-signin .ForgetPwd,
.form-signin a {
  color: #b91825;
  font-size: 0.84rem;
  font-weight: 650;
  text-underline-offset: 3px;
}

.form-signin .row:last-of-type {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #e7eaf0;
}

.form-signin small {
  font-size: 0.7rem;
}

.form-signin .alert {
  margin-top: 16px;
  border: 1px solid #f0d6a8;
  border-radius: 10px;
  color: #80500f;
  background: #fff8e8;
  font-size: 0.82rem;
}

.bd-mode-toggle {
  z-index: 1500;
}

.bd-mode-toggle > .btn {
  width: 42px;
  height: 42px;
  justify-content: center;
  padding: 0;
  border: 1px solid #dfe4ec;
  border-radius: 50%;
  color: #172033;
  background: #fff;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.14);
}

.bd-mode-toggle > .btn::after {
  display: none;
}

.bd-mode-toggle .dropdown-menu .active .bi {
  display: block !important;
}

.pr_grey {
  color: #596477;
  font-weight: 700;
}

.login-container {
  display: grid;
  min-height: calc(100vh - 40px);
  place-items: center;
  margin-block: 20px;
}

.login-container form {
  padding: 34px;
}

.login-form-2 {
  width: min(100%, 520px);
  padding: 0;
  overflow: hidden;
  border: 1px solid #dfe4ec;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(16, 24, 40, 0.12);
}

.login-form-2 h1,
.login-form-2 h2,
.login-form-2 h3 {
  color: #172033;
  font-weight: 740;
  letter-spacing: -0.025em;
  text-align: left;
}

.login-form-2 .btnSubmit {
  border-color: #d92332;
  color: #fff;
  background-color: #d92332;
  font-weight: 700;
}

.login-form-2 .ForgetPwd {
  color: #b91825;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 900px) {
  body:has(.form-signin) {
    justify-content: center;
    padding: 32px 20px !important;
    background: #f3f5f8 !important;
  }

  body:has(.form-signin)::before,
  body:has(.form-signin)::after {
    display: none;
  }
}

@media (max-width: 480px) {
  body:has(.form-signin) {
    align-items: flex-start;
    padding: 12px !important;
  }

  .form-signin form {
    padding: 26px 22px;
    border-radius: 16px;
  }
}

[data-bs-theme="dark"] body:has(.form-signin) {
  color: #eef1f6;
  background: linear-gradient(90deg, #0c0f14 0%, #0c0f14 52%, #12161d 52%, #12161d 100%) !important;
}

[data-bs-theme="dark"] .form-signin form,
[data-bs-theme="dark"] .login-form-2,
[data-bs-theme="dark"] .bd-mode-toggle > .btn {
  border-color: #343b48;
  color: #eef1f6;
  background: #1c212b;
}

[data-bs-theme="dark"] .form-signin picture {
  border-color: rgba(255, 255, 255, 0.12);
}

[data-bs-theme="dark"] .form-signin h1,
[data-bs-theme="dark"] .form-signin .h3,
[data-bs-theme="dark"] .login-form-2 h1,
[data-bs-theme="dark"] .login-form-2 h2,
[data-bs-theme="dark"] .login-form-2 h3 {
  color: #f5f7fa;
}

[data-bs-theme="dark"] .form-signin .form-control {
  border-color: #47505f;
  color: #eef1f6;
  background: #151a22;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* Signed-out screen */
.logout-page {
  min-height: 100vh;
  margin: 0;
  color: #172033;
  background: #f3f5f8;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.logout-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 0.92fr) minmax(520px, 1.08fr);
}

.logout-visual {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(36px, 5vw, 76px);
  color: #fff;
  background:
    radial-gradient(circle at 18% 22%, rgba(217, 35, 50, 0.7), transparent 18rem),
    linear-gradient(145deg, #191e29 0%, #11151d 68%, #231820 100%);
}

.logout-visual::before,
.logout-visual::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.logout-visual::before {
  right: -15rem;
  bottom: -10rem;
  width: 34rem;
  height: 34rem;
}

.logout-visual::after {
  right: -7rem;
  bottom: -2rem;
  width: 20rem;
  height: 20rem;
  border-color: rgba(217, 35, 50, 0.24);
}

.logout-visual-brand,
.logout-visual-copy {
  position: relative;
  z-index: 1;
}

.logout-visual-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logout-visual-brand picture {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff;
}

.logout-visual-brand img {
  width: 154px;
  height: auto;
}

.logout-visual-brand span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.logout-visual-copy {
  max-width: 620px;
  margin-bottom: 8vh;
}

.logout-eyebrow,
.logout-kicker {
  margin: 0 0 14px;
  color: #f45c68;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.logout-visual-copy h1 {
  margin: 0;
  font-size: clamp(2.8rem, 5vw, 5.7rem);
  font-weight: 760;
  letter-spacing: -0.06em;
  line-height: 0.96;
}

.logout-visual-copy > p:last-child {
  max-width: 500px;
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: clamp(0.95rem, 1.2vw, 1.08rem);
  line-height: 1.65;
}

.logout-content {
  display: flex;
  min-width: 0;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 6vw, 84px);
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 35, 50, 0.07), transparent 22rem),
    #f3f5f8;
}

.logout-card {
  width: min(100%, 510px);
  padding: clamp(32px, 4.5vw, 52px);
  border: 1px solid #dfe4ec;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(16, 24, 40, 0.13);
}

.logout-status-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 30px;
  place-items: center;
  border: 1px solid #bfe6d7;
  border-radius: 18px;
  color: #17855f;
  background: #eaf8f2;
}

.logout-status-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.logout-card h2 {
  margin: 0;
  color: #101828;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 1.04;
}

.logout-message {
  margin: 20px 0 30px;
  color: #667085;
  font-size: 0.98rem;
  line-height: 1.7;
}

.logout-message strong {
  color: #344054;
  font-weight: 700;
}

.logout-action {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border: 1px solid #d92332;
  border-radius: 12px;
  color: #fff;
  background: #d92332;
  box-shadow: 0 10px 24px rgba(217, 35, 50, 0.22);
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.logout-action span {
  font-size: 1.2rem;
}

.logout-action:hover,
.logout-action:focus-visible {
  color: #fff;
  background: #b91825;
  box-shadow: 0 14px 28px rgba(185, 24, 37, 0.25);
  transform: translateY(-1px);
}

.logout-security-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 22px 0 0;
  color: #7b8494;
  font-size: 0.76rem;
}

.logout-security-note span {
  color: #28b782;
  font-size: 0.7rem;
}

.logout-footer {
  display: flex;
  width: min(100%, 510px);
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
  color: #8a93a3;
  font-size: 0.72rem;
}

.logout-footer a {
  color: #596477;
  font-weight: 650;
  text-decoration: none;
}

.logout-footer a:hover {
  color: #b91825;
}

@media (max-width: 980px) {
  .logout-shell {
    grid-template-columns: 1fr;
  }

  .logout-visual {
    min-height: auto;
    padding: 28px;
  }

  .logout-visual-copy {
    display: none;
  }

  .logout-content {
    min-height: calc(100vh - 108px);
    padding: 40px 20px;
  }
}

@media (max-width: 520px) {
  .logout-visual-brand span {
    display: none;
  }

  .logout-card {
    padding: 30px 24px;
    border-radius: 18px;
  }

  .logout-footer {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
}

[data-bs-theme="dark"] .logout-content {
  background: #12161d;
}

[data-bs-theme="dark"] .logout-card {
  border-color: #343b48;
  color: #eef1f6;
  background: #1c212b;
}

[data-bs-theme="dark"] .logout-card h2,
[data-bs-theme="dark"] .logout-message strong {
  color: #f5f7fa;
}
