:root {
  --ink: #16161a;
  --ink-mid: #4a4a58;
  --ink-soft: #7a7a88;
  --bg: #0a0a0f;
  --surface: #13131a;
  --surface-hover: #1c1c28;
  --border: #2a2a3a;
  --primary: #424fd1;
  --primary-light: #6b7ae8;
  --primary-soft: rgba(66, 79, 209, 0.18);
  --green: #22c55e;
  --amber: #f59e0b;
  --text: #f8f8ff;
  --text-secondary: #9999aa;
  --text-muted: #55556a;
  --font: "Inter", system-ui, sans-serif;
  --display: "DM Serif Display", Georgia, serif;
}

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 70% 45% at 15% -10%, rgba(66, 79, 209, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 10%, rgba(34, 197, 94, 0.08), transparent 50%);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

.portal-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #fff;
}

.brand-mark svg {
  width: 28px;
  height: 28px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 16px;
  cursor: pointer;
  transition: 0.15s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-light);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-google {
  width: 100%;
  background: #fff;
  color: #1f1f1f;
  border-color: #dadce0;
  padding: 12px 18px;
}

.btn-google:hover:not(:disabled) {
  background: #f7f8fa;
}

.portal-main {
  flex: 1;
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 72px;
}

.hidden {
  display: none !important;
}

/* Sign-in */
.auth-panel {
  max-width: 440px;
  margin: 48px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: 0 0 0 1px rgba(66, 79, 209, 0.08), 0 24px 64px rgba(0, 0, 0, 0.45);
  animation: rise 0.45s ease both;
}

.auth-panel h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.auth-panel .lead {
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 28px;
  font-size: 0.95rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-hint {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--primary-soft);
  border: 1px solid rgba(66, 79, 209, 0.28);
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}

.auth-error {
  margin-top: 14px;
  color: #f87171;
  font-size: 0.85rem;
}

/* Services */
.services-head {
  margin-bottom: 28px;
  animation: rise 0.4s ease both;
}

.services-head .eyebrow {
  color: var(--primary-light);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.services-head h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.services-head p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.55;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 760px) {
  .service-grid {
    grid-template-columns: 1fr;
  }
  .portal-main {
    padding-top: 28px;
  }
  .auth-panel {
    margin-top: 24px;
    padding: 28px 22px;
  }
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  min-height: 220px;
  animation: rise 0.5s ease both;
}

.service-card:nth-child(2) {
  animation-delay: 0.06s;
}

.service-card:nth-child(3) {
  animation-delay: 0.12s;
}

.service-card:hover {
  transform: translateY(-3px);
  border-color: rgba(66, 79, 209, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.service-card.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.service-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-light);
}

.service-card h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.service-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  flex: 1;
}

.service-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-live {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
}

.badge-demo {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber);
}

.cta-label {
  color: var(--primary-light);
  font-size: 0.85rem;
  font-weight: 700;
}

.user-chip {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  max-width: 240px;
}

.user-chip.show {
  display: inline-flex;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-email {
  font-size: 0.78rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-foot {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
