/* Customer portal — extends styles.css */

.portal-body {
  min-height: 100vh;
  background: var(--black);
}

.portal-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--muted);
  text-align: center;
  padding: 2rem var(--gutter);
  gap: 0.75rem;
  flex-direction: column;
}

.portal-gate[hidden],
.portal-shell[hidden] {
  display: none !important;
}

.portal-gate-error {
  margin: 0;
  font-size: 0.9375rem;
  color: #f87171;
  max-width: 28rem;
}

.portal-gate a {
  color: var(--amber-bright);
  font-weight: 600;
}

.portal-shell {
  display: grid;
  gap: 0;
  padding-top: var(--header-h);
  min-height: 100vh;
}

@media (min-width: 900px) {
  .portal-shell {
    grid-template-columns: 240px 1fr;
  }
}

.portal-sidebar {
  padding: 1.5rem var(--gutter);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 900px) {
  .portal-sidebar {
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    border-bottom: none;
    border-right: 1px solid var(--line);
    padding: 2rem 1.25rem;
  }
}

.portal-sidebar .logo {
  display: inline-flex;
  margin-bottom: 1.5rem;
}

.portal-sidebar .logo-img {
  height: 2.65rem;
  max-width: 12rem;
}

.portal-user {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.portal-site-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.portal-site-nav a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--amber-bright);
  text-decoration: none;
  padding: 0.4rem 0;
  transition: color 0.2s;
}

.portal-site-nav a:hover {
  color: var(--white);
}

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

@media (min-width: 900px) {
  .portal-nav {
    flex-direction: column;
  }
}

.portal-nav button {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.2s, transform 0.2s var(--ease-out);
}

.portal-nav button:hover,
.portal-nav button.is-active {
  background: var(--surface);
  color: var(--white);
}

.portal-nav button.is-active {
  box-shadow: inset 3px 0 0 var(--amber);
}

.portal-nav button:active:not(.is-active) {
  transform: scale(0.98);
}

.portal-nav button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.portal-nav-link {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  transition: background 0.25s var(--ease), color 0.2s;
}

.portal-nav-link:hover {
  background: var(--surface);
  color: var(--white);
}

.portal-logout {
  margin-top: 1.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.portal-logout:hover {
  color: var(--white);
}

.portal-main {
  padding: 2rem var(--gutter) 4rem;
}

.portal-view h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.portal-view > p {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.portal-cards {
  display: grid;
  gap: 0.75rem;
}

.portal-card {
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.portal-card--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.portal-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.portal-reg {
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: 0.06em;
}

.portal-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.portal-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.portal-badge--pending {
  background: var(--amber-soft);
  color: var(--amber-bright);
}

.portal-badge--confirmed {
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.portal-badge--completed {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.portal-badge--cancelled {
  background: rgba(255, 80, 80, 0.12);
  color: #f87171;
}

.portal-empty {
  color: var(--muted);
  font-size: 0.9375rem;
}

.portal-link-btn {
  font: inherit;
  font-weight: 600;
  color: var(--amber-bright);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

a.portal-link-btn {
  display: inline;
  border: none;
}

.portal-muted {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.portal-icon-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.portal-icon-btn:hover {
  color: #f87171;
  border-color: #f87171;
}

.portal-form {
  max-width: 28rem;
  display: grid;
  gap: 1rem;
}

.portal-form .field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.portal-form .field input,
.portal-form .field select {
  width: 100%;
  max-width: 100%;
  padding: 0.8rem 0.9rem;
  font-family: var(--font-body);
  font-size: max(16px, 1rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--dark-2);
  color: var(--white);
}

.portal-form .field input:focus,
.portal-form .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-focus);
}

/* Registration field: dark text on light plate (readable on the yellow tint) */
.portal-form .field input.input-reg {
  color: #0a0a0a;
  background: #fffde8;
}

.portal-form .field input.input-reg:focus {
  color: #0a0a0a;
  background: #fffef5;
}

.portal-form .field-row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 480px) {
  .portal-form .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.portal-check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.portal-check input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

.portal-status {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
}

.portal-status--success {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber-bright);
}

.portal-status--error {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

.portal-status--warn {
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
}

.portal-split {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .portal-split {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + env(safe-area-inset-top) + 2rem) var(--gutter)
    calc(3rem + env(safe-area-inset-bottom));
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.auth-card > p {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.auth-status {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
}

.auth-status--error {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

.auth-status--success {
  background: var(--amber-soft);
  color: var(--amber-bright);
}

.auth-toggle {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
}

.auth-toggle a {
  color: var(--accent-bright);
  font-weight: 600;
}

.auth-logo {
  display: inline-flex;
  margin-bottom: 1.5rem;
}

.auth-logo .logo-img {
  height: 3.1rem;
  max-width: 13rem;
}

.auth-back {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.auth-back:hover {
  color: var(--white);
}
