/* Portal + top bar (colors from maxonomy-theme.css) */

*,
*::before,
*::after {
  box-sizing: border-box;
}

.portal-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background: var(--bg-elevated);
}

.portal-card {
  width: min(100%, 420px);
  padding: 2rem 1.75rem;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.portal-brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: contain;
}

.portal-brand h1 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.35;
  color: var(--text);
  font-weight: 700;
}

.portal-brand p {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.portal-card label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.portal-card input {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

.portal-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.portal-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: #ffffff;
  background: var(--accent);
  transition: background 0.15s ease;
}

.portal-btn:hover {
  background: var(--accent-hover);
}

.portal-error {
  display: none;
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--emph-red);
  background: var(--emph-red-dim);
  border: 1px solid rgba(239, 20, 29, 0.2);
}

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

.portal-dashboard {
  display: none;
  width: min(100%, 640px);
}

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

.portal-dashboard h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  color: var(--text);
  font-weight: 800;
}

.portal-dashboard > p {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

.solution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.solution-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.solution-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.solution-card strong {
  font-size: 1.05rem;
  color: var(--accent);
  font-weight: 800;
}

.solution-card span {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.solution-card.is-disabled {
  pointer-events: none;
  opacity: 0.65;
}

/* Maxonomy-style white top bar (same as maxonomy.net header) */
.portal-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--portal-topbar-h);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0 2.5rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
}

.portal-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

@media (max-width: 768px) {
  .portal-topbar {
    padding: 0 1.25rem;
  }
}

.portal-topbar.is-hidden {
  display: none;
}

.portal-topbar-deploy {
  margin-left: 0.35rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1.2;
}

@media (max-width: 640px) {
  .portal-topbar-deploy {
    display: none;
  }
}

.portal-topbar-back,
.portal-topbar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.portal-topbar-back {
  color: var(--text-muted);
  text-decoration: none;
}

.portal-topbar-back:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.portal-topbar-logout {
  color: var(--text);
  cursor: pointer;
}

.portal-topbar-logout:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.portal-topbar-logout.is-hidden {
  display: none;
}

/* Fixed portal bar does not reserve flow space on guide pages */
body.has-portal-topbar {
  padding-top: var(--portal-topbar-h);
}

body.has-portal-topbar .portal-wrap {
  padding-top: 1.5rem;
}

.has-portal-topbar .site-header {
  top: var(--portal-topbar-h);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
}

.has-portal-topbar .sidebar {
  top: calc(var(--header-h) + var(--portal-topbar-h));
  height: calc(100vh - var(--header-h) - var(--portal-topbar-h));
}

.has-portal-topbar .layout {
  min-height: calc(100vh - var(--header-h) - var(--portal-topbar-h));
}

@media (max-width: 900px) {
  .has-portal-topbar .sidebar,
  .has-portal-topbar .sidebar-overlay {
    top: calc(var(--header-h) + var(--portal-topbar-h));
  }
}

.hidden {
  display: none !important;
}
