:root {
  --c: #344e41;
  --cl: #3f6050;
  --cd: #2a3e34;
  --bg: #f6f4f0;
  --sf: #fff;
  --sa: #f0ede8;
  --bd: #ddd8d0;
  --bl: #ebe8e3;
  --t: #1a1a1a;
  --ts: #555550;
  --tm: #8a8880;
  --ok: #2e7d4f;
  --er: #8b0000;
  --accent: #6f9d82;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  min-height: 100vh;
  font-family: 'Lato', sans-serif;
  background: var(--bg);
  color: var(--t);
  overflow: hidden;
}

.page {
  display: flex;
  min-height: 100vh;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.page.ready {
  opacity: 1;
}

/* Full-screen preloader (shown until the background image is ready) */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #2a3e34;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.45s ease;
}
#preloader.hide {
  opacity: 0;
  pointer-events: none;
}
#preloader .pl-spin {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(246, 244, 240, 0.22);
  border-top-color: #f6f4f0;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Left branding panel (building photo + green overlay) ── */
.brand {
  flex: 1.15;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 72px;
  position: relative;
  overflow: hidden;
  background: #2a3e34 url('https://xps5-uxem-jjsp.n7e.xano.io/vault/dd0o8JxP/yr6aBxgu8Vq8sp4m7ZpcFgF11tQ/Y8n0QQ../patrick-tomasso-5eZu5p0vSPg-unsplash.jpg') center / cover no-repeat;
}
.brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, rgba(28, 42, 34, 0.92) 0%, rgba(42, 62, 52, 0.86) 45%, rgba(52, 78, 65, 0.78) 100%);
}
.brand-content {
  position: relative;
  z-index: 1;
  max-width: 460px;
}
.brand-logo {
  height: 34px;
  margin-bottom: 64px;
  opacity: 0.95;
}
.brand-h1 {
  font-family: 'Lato', sans-serif;
  font-size: 3rem;
  font-weight: 900;
  color: #f6f4f0;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}
.brand-rule {
  width: 62px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin-bottom: 24px;
}
.brand-p {
  font-size: 1rem;
  color: rgba(246, 244, 240, 0.72);
  line-height: 1.7;
  margin-bottom: 48px;
}
.brand-features {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.brand-feat {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.brand-feat-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(246, 244, 240, 0.10);
  border: 1px solid rgba(246, 244, 240, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-feat-icon svg {
  width: 20px;
  height: 20px;
  stroke: rgba(246, 244, 240, 0.9);
  fill: none;
  stroke-width: 2;
}
.brand-feat-t {
  color: #f6f4f0;
  font-weight: 700;
  font-size: 0.96rem;
  margin-bottom: 3px;
}
.brand-feat-d {
  color: rgba(246, 244, 240, 0.62);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ── Right auth panel (light bg + floating card) ── */
.auth {
  flex: 1;
  min-width: 480px;
  background: var(--bg);
  background-image: radial-gradient(rgba(52, 78, 65, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--sf);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(28, 42, 34, 0.12);
  padding: 42px 44px;
  position: relative;
  z-index: 2;
}
.auth-tabs {
  display: flex;
  gap: 2px;
  background: var(--sa);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 26px;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tm);
  border-radius: 8px;
  cursor: pointer;
  transition: 0.15s;
  border: none;
  background: none;
  font-family: 'Lato', sans-serif;
}
.auth-tab.active {
  background: var(--sf);
  color: var(--c);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.auth-title {
  font-family: 'Lato', sans-serif;
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--c);
  text-align: center;
  margin-bottom: 6px;
}
.auth-sub {
  font-size: 0.84rem;
  color: var(--tm);
  text-align: center;
  margin-bottom: 26px;
}

.fg {
  margin-bottom: 16px;
}
.fg label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--tm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.input-wrap {
  position: relative;
}
.input-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  stroke: var(--tm);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}
.eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  color: var(--tm);
}
.eye-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.eye-btn:hover {
  color: var(--c);
}
.fi {
  width: 100%;
  padding: 12px 14px;
  background: var(--sf);
  border: 1.5px solid var(--bd);
  border-radius: 10px;
  color: var(--t);
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  outline: 0;
  transition: 0.2s;
  -webkit-user-select: text;
  user-select: text;
  pointer-events: auto;
}
.fi.has-ico {
  padding-left: 42px;
}
.fi.has-ico-r {
  padding-right: 42px;
}
.fi:focus {
  border-color: var(--c);
  box-shadow: 0 0 0 3px rgba(52, 78, 65, 0.1);
}
.fi::placeholder {
  color: var(--bd);
}
.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 6px;
  font-size: 0.8rem;
  color: var(--ts);
  cursor: pointer;
}
.remember input {
  width: auto;
  margin: 0;
  width: 15px;
  height: 15px;
  accent-color: var(--c);
  cursor: pointer;
}

.submit-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #2a3e34, #344e41, #3f6050);
  color: #f6f4f0;
  border: none;
  border-radius: 10px;
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  box-shadow: 0 2px 10px rgba(52, 78, 65, 0.25);
}
.submit-btn:hover {
  background: var(--cl);
}
.submit-btn:active {
  transform: scale(0.99);
}
.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-arrow {
  position: absolute;
  right: 16px;
  width: 18px;
  height: 18px;
  stroke: #f6f4f0;
  fill: none;
  stroke-width: 2;
}
.submit-btn .spin {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(246, 244, 240, 0.3);
  border-top-color: #f6f4f0;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: none;
}
.submit-btn.loading .spin {
  display: block;
}
.submit-btn.loading .btn-text,
.submit-btn.loading .btn-arrow {
  display: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* OR divider + Microsoft SSO */
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--tm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bl);
}
.ms-btn {
  width: 100%;
  padding: 12px;
  background: var(--sf);
  border: 1.5px solid var(--bd);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Lato', sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--t);
  cursor: pointer;
  transition: 0.15s;
}
.ms-btn:hover {
  background: var(--sa);
}
.ms-logo {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.forgot {
  text-align: center;
  margin-top: 16px;
}
.forgot a {
  font-size: 0.8rem;
  color: var(--c);
  font-weight: 700;
  text-decoration: none;
}
.forgot a:hover {
  text-decoration: underline;
}

.msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}
.msg.err {
  display: block;
  background: rgba(139, 0, 0, 0.06);
  color: var(--er);
  border: 1px solid rgba(139, 0, 0, 0.12);
}
.msg.ok {
  display: block;
  background: rgba(46, 125, 79, 0.06);
  color: var(--ok);
  border: 1px solid rgba(46, 125, 79, 0.15);
}

.auth-footer {
  position: absolute;
  bottom: 24px;
  right: 34px;
  font-size: 0.74rem;
  color: var(--tm);
}
.auth-footer a {
  color: var(--c);
  font-weight: 600;
  text-decoration: none;
}
.auth-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  html, body { overflow: auto; }
  .page {
    flex-direction: column;
  }
  .brand {
    padding: 40px 32px 48px;
    min-height: auto;
    flex: none;
  }
  .brand-logo { margin-bottom: 36px; }
  .brand-h1 {
    font-size: 2rem;
  }
  .brand-features {
    display: none;
  }
  .auth {
    width: 100%;
    min-width: 0;
    flex: 1;
    padding: 32px 20px 64px;
  }
  .auth-card { padding: 32px 26px; }
  .auth-footer { position: static; text-align: center; margin-top: 22px; }
}
