/* =========================================================
   Client Portal Auth Pages
   login.html / sign-up.html / forgot-password.html
   ========================================================= */

:root{
  --portal-link: #11a44a;
  --portal-danger: #ff4d4d;
  --portal-bg: #05070a;
  --portal-line: rgba(255,255,255,0.22);
  --portal-line-strong: rgba(255,255,255,0.55);
  --portal-border: rgba(255,255,255,0.12);
  --portal-warn-bg: rgba(255,159,0,0.10);
  --portal-warn-border: rgba(255,159,0,0.28);
  --portal-info-bg: rgba(33,197,255,0.10);
  --portal-info-border: rgba(33,197,255,0.30);
  --portal-link-accent: #21C5FF;
}

/* Page shell */
.login-page{
  min-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 32px;
  padding-bottom: 40px;
}

.login-shell{
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

/* Gradient frame */
.login-frame{
  width: 100%;
  border-radius: 26px;
  padding: 2px;
  background: linear-gradient(
    135deg,
    var(--blue),
    #e7f1ff,
    var(--green),
    #f2ffe6,
    var(--blue)
  );
  box-shadow: 0 22px 45px rgba(0,0,0,0.65);
}

.login-card{
  border-radius: 24px;
  background: var(--portal-bg);
  padding: 26px 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Top pill */
.login-pill{
  align-self: flex-start;
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.03);
}

/* Auth block */
.portal-auth{
  width: 100%;
  max-width: 560px;
}

.portal-auth-title{
  text-align: center;
  font-size: 30px;
  line-height: 1.15;
  margin: 2px 0 4px;
  font-weight: 600;
  color: var(--text);
}

.portal-auth-form{
  margin-top: 2px;
}

.portal-field{
  margin: 10px 0 12px;
}

/* Inputs */
.portal-input{
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--portal-line);
  padding: 9px 0 7px;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: var(--text);
}

.portal-input::placeholder{
  color: rgba(255,255,255,0.32);
}

.portal-input:focus{
  border-bottom-color: var(--portal-line-strong);
}

/* Help / validation line */
.portal-help{
  min-height: 18px;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.2;
  color: rgba(255,255,255,0.62);
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-help.is-error{
  color: var(--portal-danger);
}

.portal-help.is-error::before{
  content: "!";
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: #0b0f16;
  background: var(--portal-danger);
}

/* Terms row */
.portal-check-row{
  position: relative;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  transition: transform 140ms ease;
}

.portal-check-row input{
  margin-top: 2px;
  flex: 0 0 auto;
}

.portal-check-row a{
  color: var(--text);
  opacity: 0.9;
  text-decoration: none;
}

.portal-check-row a:hover{
  text-decoration: underline;
}

.portal-check-row::after{
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 10px;
  border: 2px solid transparent;
  pointer-events: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.portal-check-row.is-expanded{
  transform: scale(1.015);
}

.portal-check-row.is-error::after{
  border-color: var(--portal-danger);
  box-shadow: 0 0 0 1px rgba(255,77,77,0.22);
}

@keyframes portalTermsPulse{
  0%{ transform: scale(1); }
  55%{ transform: scale(1.02); }
  100%{ transform: scale(1.015); }
}

.portal-check-row.pulse{
  animation: portalTermsPulse 220ms ease-out;
}

/* Primary button */
.login-btn-primary{
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  background: rgba(13,117,245,0.56);
  color: #eaf2ff;
  border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer;
  opacity: 1;
  box-shadow: 0 12px 26px rgba(13,117,245,0.16);
  transition:
    transform 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease;
}

.login-btn-primary:hover{
  background: rgba(13,117,245,0.64);
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(13,117,245,0.20);
  border-color: rgba(255,255,255,0.16);
}

.login-btn-primary:active{
  transform: translateY(0);
}

.login-btn-primary:focus-visible{
  outline: 2px solid rgba(13,117,245,0.75);
  outline-offset: 3px;
}

.portal-btn{
  width: 100%;
  margin-top: 8px;
  padding: 13px 16px;
  border-radius: 9999px;
}

/* Links under button */
.portal-links-row.is-below{
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.portal-link{
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 650;
  color: var(--portal-link);
}

.portal-link:hover{
  text-decoration: underline;
}

/* Status / result messages */
.portal-status{
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,0.78);
  box-shadow: 0 10px 22px rgba(0,0,0,0.35);
}

.portal-status.is-showing{
  display: block;
}

.portal-status[hidden]{
  display: none !important;
}

.portal-status:empty{
  display: none;
}

.portal-status--warn{
  background: var(--portal-warn-bg);
  border: 1px solid var(--portal-warn-border);
}

.portal-status--info{
  background: var(--portal-info-bg);
  border: 1px solid var(--portal-info-border);
  color: rgba(231,248,255,0.92);
}

.portal-status a,
.portal-cta-link{
  color: var(--portal-link-accent);
  font-weight: 600;
  text-decoration: none;
}

.portal-status a:hover,
.portal-cta-link:hover{
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-cta-link:focus-visible{
  outline: 2px solid rgba(13,117,245,0.75);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Brand footer inside card */
.login-brand{
  border-top: 1px solid #151b25;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.login-brand-mark{
  width: 76px;
  height: 76px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 20%, rgba(89,224,11,0), transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(13,117,245,0), transparent 70%),
    url("/assets/logo_website_final_cropped2.png") center/60% no-repeat;
  box-shadow: 0 14px 30px rgba(0,0,0,0.6);
}

.login-brand-name{
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  text-align: center;
}

.login-brand-tagline{
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* Autofill cleanup */
.portal-input:-webkit-autofill,
.portal-input:-webkit-autofill:hover,
.portal-input:-webkit-autofill:focus,
.portal-input:-webkit-autofill:active{
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--portal-bg) inset !important;
  box-shadow: 0 0 0 1000px var(--portal-bg) inset !important;
  border-color: rgba(255,255,255,0.18);
  transition: background-color 9999s ease-out 0s;
}

.portal-input:autofill{
  -webkit-text-fill-color: var(--text) !important;
  box-shadow: 0 0 0 1000px var(--portal-bg) inset !important;
}

.portal-input:-moz-autofill,
.portal-input:-moz-autofill:focus{
  box-shadow: 0 0 0 1000px var(--portal-bg) inset !important;
  -moz-text-fill-color: var(--text) !important;
}

/* Responsive */
@media (max-width: 600px){
  .login-card{
    padding: 22px 18px 18px;
  }

  .login-page{
    padding-top: 24px;
    padding-bottom: 32px;
    min-height: calc(100vh - 140px);
  }

  .portal-auth-title{
    font-size: 26px;
  }
}