/* 7Fabs customer portal styles (WP-14).
   Builds on the CSS custom properties defined in ../styles.css
   (--ink, --muted, --line, --panel, --surface, --accent, --shadow, etc.)
   rather than duplicating a second design language. */

/* View sections are toggled with the hidden attribute; keep it authoritative
   over any display value set by layout classes like .portal-dashboard. */
[hidden] {
  display: none !important;
}

.portal-body {
  background: var(--surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portal-topnav {
  justify-content: flex-end;
}

/* The public-site mobile menu hides .primary-nav behind a toggle button the
   portal header doesn't have — keep the short portal nav always visible. */
@media (max-width: 960px) {
  .portal-body .primary-nav {
    position: static;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
    border-bottom: 0;
    background: transparent;
    box-shadow: none;
  }
}

.portal-main {
  display: grid;
  gap: 1rem;
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 2rem) 3rem;
  flex: 1;
}

.portal-panel-card {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 14px);
  background: var(--panel);
  box-shadow: var(--shadow-sm, 0 4px 14px rgba(16, 26, 38, 0.06));
}

.portal-auth-card {
  width: min(100%, 34rem);
  margin: clamp(1rem, 6vh, 3.5rem) auto 0;
}

.portal-auth-card h1 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
}

.portal-inline-link {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.portal-inline-link:hover {
  text-decoration: underline;
}

.portal-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.12;
}

.portal-dashboard {
  display: grid;
  gap: 1rem;
}

.portal-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.portal-progress {
  height: 0.4rem;
  margin-top: 1rem;
  border-radius: 999px;
  background: var(--surface-strong);
  overflow: hidden;
}

.portal-progress span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  animation: portal-progress-slide 1.2s ease-in-out infinite alternate;
}

@keyframes portal-progress-slide {
  from {
    transform: translateX(-30%);
  }

  to {
    transform: translateX(220%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-progress span {
    animation: none;
  }
}

.portal-status {
  display: block;
  min-height: 1.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(31, 94, 174, 0.28);
  border-radius: 8px;
  background: rgba(31, 94, 174, 0.07);
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 700;
}

.portal-status:empty {
  display: none;
}

.portal-status.ok {
  border-color: rgba(27, 111, 82, 0.32);
  background: rgba(27, 111, 82, 0.08);
  color: var(--green);
}

.portal-status.error {
  border-color: rgba(147, 102, 15, 0.38);
  background: rgba(147, 102, 15, 0.09);
  color: #6f4c06;
}

.portal-note {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.portal-empty {
  margin: 0.65rem 0 0;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.timeline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.timeline-step {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.timeline-step::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--line);
}

.timeline-step--done {
  border-color: rgba(27, 111, 82, 0.4);
  background: rgba(27, 111, 82, 0.08);
  color: var(--green);
}

.timeline-step--done::before {
  background: var(--green);
}

.portal-row-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem;
  margin-top: 0.65rem;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: var(--surface);
}

.portal-row-card > div:first-child {
  display: grid;
  gap: 0.2rem;
}

.portal-row-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.5;
}

.portal-row-card__actions {
  display: grid;
  gap: 0.5rem;
  min-width: min(100%, 20rem);
}

.quote-approval,
.payment-action {
  display: grid;
  gap: 0.6rem;
}

.quote-terms-details {
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
}

.quote-terms-details summary {
  padding: 0.6rem 0.8rem;
  font-weight: 750;
  cursor: pointer;
}

.quote-terms-body {
  max-height: 14rem;
  overflow-y: auto;
  padding: 0 0.9rem 0.9rem;
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.quote-terms-check {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 650;
}

.quote-approval__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.portal-footer {
  padding: 1.25rem clamp(1rem, 4vw, 2rem) 2rem;
  border-top: 1px solid var(--soft-line);
  background: var(--panel);
  text-align: center;
}

.portal-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.portal-footer a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.portal-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .portal-row-card {
    flex-direction: column;
  }

  .portal-row-card__actions {
    min-width: 0;
    width: 100%;
  }
}
