.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #0b4f8a 0%, #1c7fd6 55%, #0b4f8a 100%);
}

.auth-card {
  width: 100%;
  max-width: 1000px;
  min-height: 620px;
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(3, 25, 48, 0.35);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

/* ===== Left panel ===== */
.auth-side {
  position: relative;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: var(--white);
  padding: 50px 44px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-side-content { position: relative; z-index: 2; text-align: center; }
.auth-cooperative-logo {
  display: block;
  width: 100px;
  height: 100px;
  margin: 0 auto 18px;
  object-fit: contain;
}
.auth-eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 3px;
  font-size: 13px;
  margin-bottom: 14px;
  display: block;
}
.auth-side h1 { font-size: 34px; font-weight: 800; margin-bottom: 16px; line-height: 1.25; }
.auth-side p { opacity: .85; font-size: 15px; max-width: 320px; margin-right: auto; margin-left: auto; }

/* decorative shapes */
.auth-side .deco-ring {
  position: absolute;
  border-radius: 50%;
  border: 46px solid rgba(255, 255, 255, 0.12);
}
.auth-side .ring-top {
  width: 320px; height: 320px;
  top: -140px; right: -120px;
  border-color: rgba(255,255,255,.15);
}
.auth-side .ring-bottom {
  width: 380px; height: 380px;
  bottom: -180px; right: -140px;
  border-color: rgba(255,255,255,.10);
}
.auth-side .dot-grid {
  position: absolute;
  top: 40px; left: 40px;
  width: 90px; height: 90px;
  background-image: radial-gradient(rgba(255,255,255,.35) 1.5px, transparent 1.5px);
  background-size: 14px 14px;
  z-index: 1;
}
.auth-side .dot-grid.bottom {
  top: auto; bottom: 40px; left: 40px;
}
/* ===== Right panel (form) ===== */
.auth-form-panel { padding: 56px 56px; display: flex; flex-direction: column; justify-content: center; }
.auth-form-panel h2 { font-size: 32px; font-weight: 800; color: var(--primary-dark); margin-bottom: 30px; }
.auth-login-logo { display: block; width: 100px; height: 100px; margin: 0 auto 30px; object-fit: contain; }
.unit-login-selector { margin-bottom: 22px; }
.unit-login-selector.is-hidden { display: none; }
.unit-login-selector > p { margin: 0 0 10px; color: var(--text); font-size: 14px; font-weight: 700; }
.unit-login-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.unit-login-option { display: flex; align-items: center; gap: 10px; min-height: 68px; padding: 11px 12px; border: 1.5px solid #dbe4ed; border-radius: 12px; background: #f8fafc; color: #334155; text-align: left; cursor: pointer; transition: .18s ease; }
.unit-login-option:hover { border-color: #86b7df; background: #f2f8fd; }
.unit-login-option.active { border-color: var(--primary); background: #eaf5ff; box-shadow: 0 0 0 3px rgba(28,127,214,.12); color: var(--primary-dark); }
.unit-login-icon { font-size: 24px; }
.unit-login-option strong, .unit-login-option small { display: block; }
.unit-login-option strong { font-size: 14px; }
.unit-login-option small { margin-top: 2px; color: #64748b; font-size: 10.5px; line-height: 1.25; }
.google-login-choice { margin-top: 18px; }
.google-login-choice .auth-divider { margin: 0 0 16px; }
.login-credentials { display: none; }
.login-credentials.is-visible { display: block; animation: loginFormIn .22s ease-out; }
.selected-unit-heading { margin: -4px 0 18px; padding: 8px 11px; border-left: 3px solid var(--accent); background: #f8fafc; color: #64748b; font-size: 13px; }
.back-to-unit { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px; padding: 7px 11px; border: 1px solid #dbe4ed; border-radius: 8px; background: #fff; color: var(--primary-dark); font-size: 13px; font-weight: 700; cursor: pointer; }
.back-to-unit:hover { border-color: var(--primary); background: #f2f8fd; }
@keyframes loginFormIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.auth-field { margin-bottom: 20px; }
.auth-field label { display: block; font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.auth-input-wrap { position: relative; }
.auth-input-wrap .field-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: #94a3b8; font-size: 17px; pointer-events: none;
}
.auth-input-wrap input {
  width: 100%;
  padding: 13px 16px 13px 46px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14.5px;
  background: #f8fafc;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.auth-input-wrap input:focus { border-color: var(--primary); background: var(--white); }
.auth-input-wrap .toggle-password {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: #94a3b8; font-size: 16px;
}

.auth-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 20px;
  transition: opacity .3s ease, transform .3s ease;
}
.auth-alert-hiding { opacity: 0; transform: translateY(-6px); }
.auth-alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.auth-alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

.auth-captcha-field { margin-bottom: 24px; }
.captcha-box { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.captcha-box img {
  display: block;
  width: 190px;
  height: 70px;
  border: 1.5px solid #d4e2ee;
  border-radius: 10px;
  background: #eef5fb;
}
.btn-refresh-captcha {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid #d4e2ee;
  border-radius: 10px;
  background: var(--white);
  color: var(--primary);
  font-size: 25px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn-refresh-captcha:hover { background: #eef5fb; border-color: var(--primary); transform: rotate(20deg); }
.btn-refresh-captcha:focus-visible { outline: 3px solid rgba(28,127,214,.22); outline-offset: 2px; }
.captcha-input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 14.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.captcha-input:focus { border-color: var(--primary); background: var(--white); }

.btn-auth-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(120deg, var(--primary), var(--primary-dark));
  color: var(--white);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: .5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-auth-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(11,79,138,.28); }

.auth-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #e2e8f0; }

.btn-auth-outline {
  display: block; width: 100%; text-align: center;
  padding: 13px; border-radius: 10px; border: 2px solid var(--primary);
  color: var(--primary); font-weight: 700; font-size: 14.5px; background: var(--white);
  cursor: pointer; transition: all .15s ease;
}
.btn-auth-outline:hover { background: var(--primary); color: var(--white); }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px;
  border: 1.5px solid #dadce0; border-radius: 10px;
  background: var(--white); color: #3c4043;
  font-weight: 700; font-size: 14.5px;
  cursor: pointer; transition: all .15s ease;
}
.btn-google:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); border-color: #c6c9cc; }
.google-icon { flex-shrink: 0; }

@media (max-width: 820px) {
  .auth-card { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-form-panel { padding: 44px 28px; }
}
@media (max-width: 420px) { .unit-login-options { grid-template-columns: 1fr; } }
