/* css/login.css
   Mobile = Fullscreen Brand (.lm-*).  Desktop = 50/50 Hero+Card (.ld-*).
   Tenant colors come from CSS variables set inline in index.html. */

/* ---------- Mobile (Fullscreen Brand) ---------- */

.lm {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 24px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  padding-top: calc(env(safe-area-inset-top, 0px) + 48px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: #1a2a25;
}

.lm-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.14), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.10), transparent 45%);
}

.lm-brand {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 56px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #fff;
  z-index: 1;
}
.lm-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(255,255,255,0.96) var(--brand-logo) center/68% no-repeat;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.lm-name { font-size: 20px; font-weight: 700; }
.lm-sub  { font-size: 12px; color: rgba(255,255,255,0.78); }

.lm-card {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.98);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  width: 100%;
  max-width: 380px;
}
.lm-title { font-size: 16px; font-weight: 700; color: #1a2a25; text-align: center; }

.lm-field { display: flex; flex-direction: column; gap: 6px; }
.lm-field label {
  font-size: 11px;
  font-weight: 600;
  color: #5a6a64;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.lm-field input {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1.5px solid #e5ebe8;
  background: #fafbfa;
  padding: 0 14px;
  font-size: 15px;
  color: #1a2a25;
  box-sizing: border-box;
}
.lm-field input:focus {
  border-color: var(--brand);
  background: #fff;
  outline: none;
}
.lm-field.is-error input {
  border-color: #d4351c;
  background: #fff5f3;
  animation: shake 320ms ease;
}
.lm-error {
  display: none;
  color: #d4351c;
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}
.lm-field.is-error .lm-error { display: block; }

.lm-pw-row { position: relative; }
.lm-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  font-size: 18px;
  color: #5a6a64;
  cursor: pointer;
}

.lm-banner {
  background: #fdf0e9;
  color: #9c4318;
  border: 1px solid #f5c4a7;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

.lm-submit {
  position: relative;
  height: 48px;
  border: none;
  border-radius: 13px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 80ms ease, opacity 80ms ease;
}
.lm-submit:active { transform: scale(0.98); }
.lm-submit:disabled { cursor: default; opacity: 0.85; }
.lm-submit.is-loading .lm-submit-label { opacity: 0.4; }
.lm-submit-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border: 2px solid rgba(255,255,255,0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.lm-qr {
  height: 42px;
  background: transparent;
  border: none;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lm-footer {
  position: relative;
  z-index: 1;
  color: rgba(255,255,255,0.78);
  font-size: 11px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  width: 100%;
  max-width: 380px;
}
.lm-footer a { color: inherit; text-decoration: underline; }
.lm-version { margin-left: auto; opacity: 0.6; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Desktop (50/50 Hero + Card) ---------- */

.ld {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

.ld-hero {
  position: relative;
  background: linear-gradient(160deg,
    var(--brand-deep)  0%,
    var(--brand)      60%,
    var(--brand-light) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
  color: #fff;
  overflow: hidden;
}
.ld-hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.16), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.10), transparent 45%);
}
.ld-hero-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(255,255,255,0.96) var(--brand-logo) center/68% no-repeat;
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}
.ld-hero-headline {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
  position: relative;
  z-index: 1;
}
.ld-hero-sub {
  font-size: 16px;
  color: rgba(255,255,255,0.82);
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

.ld-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: #fff;
}
.ld-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ld-title { font-size: 22px; font-weight: 700; color: #1a2a25; margin-bottom: 4px; }

.ld-field { display: flex; flex-direction: column; gap: 6px; }
.ld-field label {
  font-size: 11px;
  font-weight: 600;
  color: #5a6a64;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ld-field input {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid #e5ebe8;
  background: #fafbfa;
  padding: 0 14px;
  font-size: 14px;
  color: #1a2a25;
  box-sizing: border-box;
}
.ld-field input:focus {
  border-color: var(--brand);
  background: #fff;
  outline: none;
}
.ld-field.is-error input {
  border-color: #d4351c;
  background: #fff5f3;
  animation: shake 320ms ease;
}
.ld-error {
  display: none;
  color: #d4351c;
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}
.ld-field.is-error .ld-error { display: block; }

.ld-pw-row { position: relative; }
.ld-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  font-size: 18px;
  color: #5a6a64;
  cursor: pointer;
}

.ld-banner {
  background: #fdf0e9;
  color: #9c4318;
  border: 1px solid #f5c4a7;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

.ld-submit {
  position: relative;
  height: 48px;
  border: none;
  border-radius: 13px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 80ms ease, opacity 80ms ease;
}
.ld-submit:active { transform: scale(0.98); }
.ld-submit:disabled { cursor: default; opacity: 0.85; }
.ld-submit.is-loading .ld-submit-label { opacity: 0.4; }
.ld-submit-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border: 2px solid rgba(255,255,255,0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.ld-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8b9690;
  font-size: 12px;
  font-weight: 500;
}
.ld-divider::before,
.ld-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5ebe8;
}

.ld-qr {
  height: 44px;
  border: 1.5px solid #e5ebe8;
  background: #fff;
  border-radius: 12px;
  color: #1a2a25;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 120ms ease, color 120ms ease;
}
.ld-qr:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.ld-footer {
  margin-top: 24px;
  font-size: 12px;
  color: #5a6a64;
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 380px;
}
.ld-footer a { color: inherit; text-decoration: underline; }
.ld-version { margin-left: auto; opacity: 0.6; }
