/* ==========================================================================
   Customer portal — login, password reset, protected pages.
   Reuses design tokens (--navy, --cream, --font-body, .btn, etc.) defined
   in the main styles.css, which is loaded before this file on every
   portal page.
   ========================================================================== */

.portal-body {
  min-height: 100vh;
  margin: 0;
  background: var(--cream);
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
}

.portal-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.portal-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(11, 31, 58, 0.08);
}

.portal-logo-link {
  display: block;
  margin-bottom: 28px;
}

.portal-logo { height: 30px; width: auto; display: block; }
.portal-logo--small { height: 24px; }

.portal-title {
  font-size: 1.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--text-dark);
  margin: 0 0 8px;
}

.portal-subtitle {
  font-size: 0.9375rem;
  color: var(--text-body);
  line-height: 1.5;
  margin: 0 0 28px;
}

/* --- Notices ---------------------------------------------------------- */

.portal-notice {
  display: none;
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  background: #eef6f0;
  color: #1f5c37;
  border: 1px solid #cfe8d6;
}

.portal-notice.is-visible { display: block; }

.portal-notice--error {
  background: #fdeeee;
  color: #8a2020;
  border-color: #f3cfcf;
}

/* --- Form fields (matches the main site's contact form input style) --- */

.form-field { margin-bottom: 20px; }

.form-field label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.form-field input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border-light);
  background: transparent;
  padding: 8px 0 10px;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text-dark);
}

.form-field input:focus {
  outline: none;
  border-bottom-color: var(--navy);
}

.form-field input[aria-invalid="true"] {
  border-bottom-color: #c23a3a;
}

.field-error {
  display: block;
  min-height: 18px;
  font-size: 0.8125rem;
  color: #c23a3a;
  margin-top: 6px;
}

.password-field { position: relative; display: flex; align-items: center; }
.password-field input { padding-right: 34px; }

.password-toggle {
  position: absolute;
  right: 0;
  background: none;
  border: none;
  padding: 4px;
  color: var(--text-body);
  display: flex;
  cursor: pointer;
}
.password-toggle svg { width: 20px; height: 20px; }
.password-toggle svg[hidden] { display: none; }
.password-toggle:hover { color: var(--text-dark); }

.portal-form-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.portal-link {
  font-size: 0.875rem;
  color: var(--text-body);
  text-decoration: underline;
}
.portal-link:hover { color: var(--text-dark); }

.portal-submit { width: 100%; }

.portal-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.portal-back-link {
  display: block;
  text-align: center;
  margin-top: 24px;
  font-size: 0.875rem;
  color: var(--text-body);
}
.portal-back-link:hover { color: var(--text-dark); }

/* --- Protected page chrome --------------------------------------------- */

.portal-body--page { background: var(--cream); }

.portal-page-header {
  background: var(--navy);
  padding: 14px clamp(20px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.portal-page-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.portal-customer-name {
  color: var(--text-on-navy-muted, rgba(255,255,255,0.78));
  font-size: 0.9375rem;
  font-weight: 500;
}

.portal-logout-form { margin: 0; }

.portal-logout-btn {
  background: transparent;
  color: var(--white);
  border-color: var(--border-on-navy, rgba(255,255,255,0.35));
  padding: 9px 18px;
  font-size: 0.875rem;
}

.portal-page-content {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) 20px;
}

.portal-content-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: clamp(28px, 5vw, 48px);
}

.portal-eyebrow {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-body);
  margin-bottom: 12px;
}

.portal-content-title {
  font-size: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--text-dark);
  margin: 0 0 16px;
}

.portal-content-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-body);
  max-width: 60ch;
}

@media (max-width: 480px) {
  .portal-card { padding: 32px 24px; }
}
