:root {
  --navy: #03060f;
  --steel: rgba(8, 18, 38, 0.85);
  --accent: #00e5ff;
  --light: #e8f4ff;
  --muted: #7a90ad;
  --border: rgba(0, 229, 255, 0.18);
  --danger: #ff7b7b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(0, 102, 255, 0.12) 0%, transparent 55%),
    linear-gradient(180deg, #03060f 0%, #050a14 100%);
  color: var(--light);
  min-height: 100vh;
}

.portal-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.portal-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.portal-card {
  width: 100%;
  max-width: 480px;
  background: var(--steel);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.portal-card--wide { max-width: 560px; }

.portal-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: #fff;
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
}

.portal-logo span { color: var(--accent); }

.portal-subtitle, .portal-note {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.portal-subtitle { margin-bottom: 1.5rem; }
.portal-note { margin-top: 1.25rem; }
.portal-note a { color: var(--accent); }

.portal-form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.portal-form input,
.portal-form textarea,
.portal-form select {
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  background: rgba(3, 8, 18, 0.8);
  color: var(--light);
  font: inherit;
}

.portal-form input:focus,
.portal-form textarea:focus,
.portal-form select:focus {
  outline: none;
  border-color: var(--accent);
}

.portal-btn,
.portal-btn-secondary,
.portal-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.portal-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.85rem 1.2rem;
  background: var(--accent);
  color: var(--navy);
}

.portal-btn-secondary {
  padding: 0.65rem 1rem;
  background: transparent;
  color: var(--light);
  border: 1px solid var(--border);
}

.portal-btn-danger {
  padding: 0.45rem 0.75rem;
  background: rgba(255, 80, 80, 0.12);
  color: var(--danger);
  border: 1px solid rgba(255, 80, 80, 0.35);
  font-size: 0.78rem;
}

.portal-alert {
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.portal-alert--error {
  border: 1px solid rgba(255, 80, 80, 0.35);
  background: rgba(255, 80, 80, 0.08);
  color: var(--danger);
}

.portal-alert--success {
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.08);
  color: var(--accent);
}

.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.portal-topbar-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.portal-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.portal-tab {
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
}

.portal-tab.active {
  color: var(--navy);
  background: var(--accent);
  border-color: var(--accent);
}

.portal-panel {
  display: none;
  background: var(--steel);
  border: 1px solid var(--border);
  padding: 1.5rem;
}

.portal-panel.active { display: block; }

.portal-section-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  margin: 1.25rem 0 1rem;
  color: #fff;
}

.portal-section-title:first-child { margin-top: 0; }

.portal-list-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.portal-list-item:last-child { border-bottom: none; }

.portal-list-item a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.portal-meta { font-size: 0.82rem; color: var(--muted); margin-top: 0.35rem; }

.portal-message {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.portal-message:last-child { border-bottom: none; }

.status-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--border);
}

.status-pill--open { color: #ffd27d; border-color: rgba(255,210,125,0.35); }
.status-pill--in_progress { color: var(--accent); }
.status-pill--resolved, .status-pill--closed { color: var(--muted); }

.portal-empty { color: var(--muted); text-align: center; padding: 2rem 0; }

@media (max-width: 700px) {
  .portal-layout { padding: 1.25rem; }
}
