/* Login page styling - matches demo.png layout (foundation approximation). */

body {
  background:
    radial-gradient(ellipse at top left, rgba(43,181,155,.10), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(111,99,255,.08), transparent 55%),
    #ffffff;
}

.login-shell {
  min-height: 100vh;
  display: grid;

  /* Tighten spacing between logo (left) and card (right) */
  grid-template-columns: minmax(360px, 520px) minmax(360px, 520px);
  justify-content: center;
  column-gap: 28px;

  align-items: center;
  padding: clamp(18px, 4vw, 64px);
}

.login-left {
  display: flex;
  align-items: center;

  /* Push logo closer toward the card */
  justify-content: flex-end;

  padding: 10px;
}

.brand-wrap {
  max-width: 520px;

  /* Align the logo visually toward the card side */
  text-align: right;
}

.brand-wrap .brand-logo {
  width: min(520px, 85vw);
  filter: drop-shadow(0 24px 40px rgba(17,24,39,.10));
}

.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.login-card {
  width: min(520px, 92vw);
  padding: 34px 34px 28px 34px;
  border-radius: 22px;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(17,24,39,.10);
  box-shadow: 0 18px 45px rgba(17,24,39,.10);
  backdrop-filter: blur(10px);
}

.login-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.login-title {
  margin: 0 0 18px 0;
  font-size: 2.25rem;
  font-weight: 300;
  letter-spacing: .03em;
  color: #1aa58a;
}

.login-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

body[data-login-mode="branded"] .brand-wrap .brand-logo {
  width: min(520px, 82vw);
}

body[data-login-mode="branded"] .login-card {
  padding-top: 28px;
}

body[data-login-mode="branded"] .login-top-branded {
  position: relative;
  min-height: 92px;
  margin-bottom: 10px;
  justify-content: flex-end;
}

body[data-login-mode="branded"] .login-top-branded .lang-toggle {
  position: relative;
  z-index: 1;
  margin-top: 6px;
}

body[data-login-mode="branded"] .login-company-header {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(280px, calc(100% - 92px));
  min-height: 78px;
  pointer-events: none;
}

body[data-login-mode="branded"] .login-company-logo {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 78px;
  object-fit: contain;
}

body[data-login-mode="branded"] .login-company-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  width: 100%;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.2;
  color: rgba(17,24,39,.86);
  text-transform: uppercase;
}

body[data-login-mode="branded"] .form-row {
  margin: 16px 0;
}

body[data-login-mode="branded"] .row-between {
  margin: 10px 0 22px 0;
}

.lang-toggle {
  border: 1px solid rgba(17,24,39,.12);
  background: #ffffff;
  border-radius: 999px;
  padding: .45rem .7rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: rgba(17,24,39,.78);
}

.lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(43,181,155,.15);
}

.form-row {
  margin: 14px 0;
}

.field {
  position: relative;
}

.field .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .55;
}

.field input {
  padding-left: 44px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 18px 0;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  user-select: none;
  color: rgba(17,24,39,.72);
}

.check input {
  width: 16px;
  height: 16px;
}

.link {
  color: rgba(17,24,39,.55);
  font-size: .95rem;
}

.link:hover {
  color: rgba(17,24,39,.80);
}

.login-btn {
  width: 100%;
  padding: 1rem 1.2rem;
  border-radius: 999px;
  font-size: 1rem;
  letter-spacing: .08em;
}

.login-error {
  display: none;
  margin-top: 12px;
  padding: .8rem .9rem;
  border-radius: 14px;
  background: rgba(220, 38, 38, .08);
  border: 1px solid rgba(220, 38, 38, .18);
  color: rgba(153, 27, 27, .95);
  font-size: .95rem;
}

/* Session expired message */

.login-expired-message {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
}

.login-expired-title {
  font-weight: 800;
  margin-bottom: 4px;
}

.login-expired-copy {
  font-size: 13px;
  line-height: 1.45;
}

.login-expired-actions {
  display: flex;
  margin-top: 12px;
}

.login-expired-actions .btn {
  width: 100%;
  justify-content: center;
}

/* Responsive */

@media screen and (max-width: 980px) {

  .login-shell {
    grid-template-columns: 1fr;
    padding: 22px;
    column-gap: 0;
  }

  .login-left {
    display: none;
  }

  .login-card {
    padding: 30px 26px 24px 26px;
  }

  .login-title {
    font-size: 2rem;
  }

  body[data-login-mode="branded"] .login-top-branded {
    min-height: 84px;
  }

  body[data-login-mode="branded"] .login-company-header {
    position: static;
    transform: none;
    width: 100%;
    min-height: 70px;
    margin-right: auto;
  }

  body[data-login-mode="branded"] .login-top-branded .lang-toggle {
    margin-top: 0;
  }

}

/* Modal (Forgot Password) */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 999;
}

.modal.show {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17,24,39,.45);
  backdrop-filter: blur(2px);
}

.modal-dialog {
  position: relative;
  width: min(520px, 92vw);
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(17,24,39,.12);
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 20px 55px rgba(17,24,39,.20);
}

.modal-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: rgba(17,24,39,.85);
}