/* ============================================================
   ePortal auth (login) — matches homepage / SDGI design system
   ============================================================ */

.ep-auth {
  font-family: var(--font-sans);
  color: var(--fg-1);
  -webkit-font-smoothing: antialiased;
  min-height: calc(100vh - 90px);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}

.ep-auth a {
  text-decoration: none;
  color: inherit;
}

/* ---- Brand panel ---- */
.ep-auth-brand {
  position: relative;
  overflow: hidden;
  background: var(--n-900);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-12) var(--space-12) var(--space-10);
  min-height: 100%;
}

.ep-auth-brand-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(70% 55% at 72% 18%, rgba(232, 70, 38, 0.42), transparent 60%),
    radial-gradient(90% 80% at 12% 100%, rgba(156, 16, 6, 0.5), transparent 60%),
    linear-gradient(120deg, #240c06 0%, #3a0f08 38%, #120b09 100%);
}

.ep-auth-brand-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../img/background.png");
  background-size: cover;
  background-position: center;
  opacity: 0.16;
  mix-blend-mode: luminosity;
}

.ep-auth-brand-inner {
  position: relative;
  z-index: 1;
}

.ep-auth-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 48px;
}

.ep-auth-logo img {
  height: 36px;
  width: auto;
  display: block;
}

.ep-auth-logo-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.28);
}

.ep-auth-logo-label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
}

.ep-auth-brand h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 4.2vw, 54px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0;
  max-width: 12ch;
}

.ep-auth-brand .ep-hl {
  position: relative;
  white-space: nowrap;
  color: #fff;
}

.ep-auth-brand .ep-hl::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.04em;
  height: 0.13em;
  background: var(--palm-orange);
  border-radius: 2px;
}

.ep-auth-brand-lead {
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  margin: 22px 0 0;
  max-width: 28rem;
}

.ep-auth-brand-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13.5px;
  font-weight: 500;
  margin-top: 48px;
}

.ep-auth-brand-foot i {
  color: var(--palm-orange);
}

/* ---- Form panel ---- */
.ep-auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-10);
  background: var(--n-25);
}

.ep-auth-card {
  width: 100%;
  max-width: 420px;
  opacity: 0;
  animation: ep-auth-rise 0.65s var(--ease-out) 0.08s forwards;
}

.ep-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--n-500);
  margin-bottom: 28px;
  transition: color var(--dur-fast), gap var(--dur-fast);
}

.ep-auth-back:hover {
  color: var(--palm-red);
  gap: 11px;
}

.ep-auth-eyebrow {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--palm-red);
  display: inline-block;
}

.ep-auth-card h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.022em;
  margin: 12px 0 0;
  color: var(--n-900);
}

.ep-auth-sub {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--n-500);
  margin: 12px 0 0;
}

.ep-auth-messages {
  margin-top: 22px;
}

.ep-auth-messages .alert {
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 500;
  padding: 12px 14px;
  margin-bottom: 0;
}

.ep-auth-messages .alert-danger {
  background: #fdebe7;
  border-color: rgba(201, 12, 15, 0.18);
  color: var(--palm-brown);
}

.ep-auth-messages .alert-success {
  background: #e8f3ec;
  border-color: rgba(0, 77, 36, 0.18);
  color: var(--sustain-green);
}

.ep-auth-messages ul {
  color: var(--palm-red);
  margin: 10px 0 0;
  padding-left: 1.2rem;
  font-size: 14px;
  font-weight: 500;
}

.ep-auth-form {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ep-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg-2);
  margin-bottom: 6px;
}

.ep-field label .req {
  color: var(--palm-red);
  margin-left: 2px;
}

.ep-input {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--n-200);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.ep-input:focus-within {
  border-color: var(--palm-red);
  box-shadow: 0 0 0 3px rgba(201, 12, 15, 0.14);
}

.ep-input-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  flex: none;
  color: var(--n-400);
  background: var(--n-50);
  border-right: 1px solid var(--n-100);
  font-size: 1rem;
}

.ep-input:focus-within .ep-input-ic {
  color: var(--palm-red);
  background: #fdebe7;
  border-right-color: rgba(201, 12, 15, 0.12);
}

.ep-input input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--fg-1);
  padding: 13px 14px;
  min-width: 0;
}

.ep-input input::placeholder {
  color: var(--n-400);
}

.ep-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--palm-orange);
  margin-top: 8px;
}

.ep-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ep-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--n-600);
  cursor: pointer;
  user-select: none;
}

.ep-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--palm-red);
  cursor: pointer;
  margin: 0;
}

.ep-auth-forgot {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--palm-red);
  transition: opacity var(--dur-fast);
}

.ep-auth-forgot:hover {
  opacity: 0.8;
}

.ep-auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}

.ep-auth-foot {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 14.5px;
  color: var(--n-500);
  text-align: center;
}

.ep-auth-foot a {
  font-weight: 700;
  color: var(--palm-red);
}

.ep-auth-foot a:hover {
  text-decoration: underline;
}

@keyframes ep-auth-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ep-auth-card {
    opacity: 1;
    animation: none;
  }
}

@media (max-width: 940px) {
  .ep-auth {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .ep-auth-brand {
    min-height: auto;
    padding: var(--space-10) var(--space-8);
  }

  .ep-auth-logo {
    margin-bottom: 28px;
  }

  .ep-auth-brand-lead {
    margin-bottom: 0;
  }

  .ep-auth-brand-foot {
    margin-top: 28px;
  }

  .ep-auth-panel {
    padding: var(--space-10) var(--space-6) var(--space-16);
  }
}

@media (max-width: 560px) {
  .ep-auth-brand h1 {
    max-width: none;
  }
}
