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

body {
  background: linear-gradient(135deg, rgb(2, 3, 129) 0%, rgb(40, 116, 252) 100%);
  min-height: 100vh;
  color: #ffffff;
  font-family: 'Recursive', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  max-width: 480px;
  width: 100%;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
  display: block;
}

h1 {
  font-size: 3rem;
  font-weight: 900;
  color: #ffffff;
  margin-top: 0.25rem;
}

.subtitle {
  color: #ffffff;
  font-size: 0.9rem;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.75rem;
}

.link-card {
  display: block;
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  text-decoration: none;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.link-card:hover {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.link-card:active {
  transform: translateY(0);
}

.login-btn {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  background-color: #5865f2;
  color: #ffffff;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-family: 'Recursive', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.login-btn:hover {
  background-color: #4752c4;
  transform: translateY(-1px);
}

.login-btn:active {
  transform: translateY(0);
}

/* ── 403 ─────────────────────────────────────────────────── */

.forbidden-container {
  text-align: center;
  gap: 1rem;
}

.forbidden-gif {
  width: 100%;
  max-width: 400px;
  border-radius: 0.75rem;
}

.forbidden-hint {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
}

/* ── Portal ──────────────────────────────────────────────── */

.portal-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.5rem;
  background: rgba(2, 3, 129, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10;
}

/* ── Portal nav (left side) ──────────────────────────────── */

.portal-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

/* Flat nav links (unlabelled section) */
.portal-nav-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.portal-nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Grouped nav section (dropdown) */
.portal-nav-section {
  position: relative;
}

.portal-nav-trigger {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  cursor: pointer;
  list-style: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.portal-nav-trigger::-webkit-details-marker,
.portal-nav-trigger::marker {
  display: none;
}

.portal-nav-trigger:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

.portal-nav-chevron {
  font-size: 0.7rem;
  opacity: 0.55;
  transition: transform 0.15s ease;
}

details.portal-nav-section[open] .portal-nav-chevron {
  transform: rotate(180deg);
}

.portal-nav-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 180px;
  background: rgba(5, 6, 150, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  overflow: hidden;
  z-index: 20;
}

.portal-nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.portal-nav-dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.nav-icon {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.portal-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.portal-username {
  font-weight: 500;
  font-size: 0.95rem;
}

/* ── Profile dropdown ────────────────────────────────────── */

.profile-menu {
  position: relative;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.625rem 0.25rem 0.375rem;
  border-radius: 0.5rem;
  cursor: pointer;
  list-style: none;
  transition: background-color 0.15s ease;
}

.profile-trigger::-webkit-details-marker,
.profile-trigger::marker {
  display: none;
}

.profile-trigger:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.profile-chevron {
  font-size: 0.7rem;
  opacity: 0.55;
  transition: transform 0.15s ease;
}

details[open] .profile-chevron {
  transform: rotate(180deg);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 160px;
  background: rgba(5, 6, 150, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  overflow: hidden;
  z-index: 20;
}

.profile-dropdown form {
  display: block;
}

.profile-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  color: #ffffff;
  text-decoration: none;
  font-family: 'Recursive', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.profile-dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.portal-back {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.portal-back:hover {
  color: #ffffff;
}

.portal-page-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 0.25rem;
}

.portal-main {
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding: 6rem 1.5rem 3rem;
}

.portal-section-title {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.75rem;
}

.portal-service-card {
  font-size: 1rem;
}

/* ── Setup flow ──────────────────────────────────────────── */

.setup-container {
  max-width: 520px;
}

.setup-container h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.setup-form {
  width: 100%;
  margin-top: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

.field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
}

.input {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.5rem;
  color: #ffffff;
  font-family: 'Recursive', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.625rem 0.875rem;
  width: 100%;
  transition: border-color 0.15s ease;
}

.input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.6);
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-weight: 400;
}

.input-readonly {
  opacity: 0.6;
  cursor: not-allowed;
}

.field-hint {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

.field-ok {
  font-size: 0.8rem;
  color: #6ee7b7;
}

.field-error {
  font-size: 0.8rem;
  color: #fca5a5;
}

.btn-submit {
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.5rem;
  color: #ffffff;
  cursor: pointer;
  font-family: 'Recursive', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
  width: 100%;
}

.btn-submit:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-submit:active {
  transform: translateY(0);
}

/* ── Provisioning status ─────────────────────────────────── */

.status-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
  margin-top: 1rem;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-pending   .status-badge { background: rgba(255,255,255,0.15); }
.status-provisioning .status-badge { background: rgba(251,191,36,0.3);  color: #fbbf24; }
.status-provisioned  .status-badge { background: rgba(110,231,183,0.3); color: #6ee7b7; }
.status-failed    .status-badge { background: rgba(252,165,165,0.3);  color: #fca5a5; }
.status-disabled  .status-badge { background: rgba(255,255,255,0.1);  color: rgba(255,255,255,0.5); }

/* ── Password change results ─────────────────────────────── */

.pw-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.pw-result-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.pw-result-ok   { background: rgba(110,231,183,0.15); color: #6ee7b7; }
.pw-result-fail { background: rgba(252,165,165,0.15); color: #fca5a5; }

.pw-result-icon {
  font-size: 0.8rem;
  width: 1rem;
  text-align: center;
}

/* ── Provisioning status ─────────────────────────────────── */

.status-complete {
  text-align: center;
  margin-top: 1rem;
}

.status-complete p {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

/* ── Docs ────────────────────────────────────────────────── */

.docs-main {
  max-width: 720px;
}

.docs-content {
  line-height: 1.75;
}

.docs-content h1 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
}

.docs-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.docs-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.docs-content p {
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

.docs-content a {
  color: #93c5fd;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.docs-content a:hover {
  color: #ffffff;
}

.docs-content ul,
.docs-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.docs-content li {
  margin-bottom: 0.375rem;
  color: rgba(255, 255, 255, 0.9);
}

.docs-content code {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.25rem;
  padding: 0.1em 0.35em;
  font-size: 0.875em;
  font-family: 'Recursive', monospace;
}

.docs-content pre {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.docs-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
}

.docs-content strong {
  font-weight: 700;
  color: #ffffff;
}

.docs-content blockquote {
  border-left: 3px solid rgba(255, 255, 255, 0.3);
  padding-left: 1rem;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.65);
}

/* ── Downloads ───────────────────────────────────────────── */

.downloads-empty {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.downloads-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.downloads-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.625rem;
  padding: 0.75rem 1rem;
  transition: background-color 0.15s ease;
}

.downloads-row:hover {
  background: rgba(255, 255, 255, 0.13);
}

.downloads-name {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
  word-break: break-all;
}

.downloads-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  flex-shrink: 0;
}

.downloads-size {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.downloads-date {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

.downloads-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.375rem;
  color: #ffffff;
  text-decoration: none;
  font-size: 1rem;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.downloads-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.downloads-btn:active {
  transform: translateY(0);
}