:root {
  --bg-0: #0b1c24;
  --bg-1: #123040;
  --bg-2: #1a4556;
  --accent: #3ecfbc;
  --accent-deep: #2aa89a;
  --text: #f4f7f8;
  --text-muted: rgba(244, 247, 248, 0.72);
  --card: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.14);
  --danger: #ff7b7b;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.portal-body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(62, 207, 188, 0.28), transparent 55%),
    radial-gradient(900px 600px at 100% 10%, rgba(78, 130, 180, 0.28), transparent 50%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1) 45%, var(--bg-2));
  background-attachment: fixed;
}

.portal-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.portal-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 36px 32px 32px;
  animation: portal-rise 0.7s ease both;
}

.portal-card.wide {
  max-width: 720px;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
}

.brand-tagline {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 300;
}

.portal-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 0 0 8px;
}

.portal-copy {
  color: var(--text-muted);
  margin: 0 0 24px;
  line-height: 1.55;
}

.portal-label {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.portal-input {
  width: 100%;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(62, 207, 188, 0.2);
}

.portal-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #062018;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 10px 24px rgba(42, 168, 154, 0.35);
}

.portal-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.portal-btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--card-border);
  box-shadow: none;
  margin-top: 12px;
}

.portal-alert {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 0.95rem;
}

.portal-alert.error {
  background: rgba(255, 123, 123, 0.16);
  border: 1px solid rgba(255, 123, 123, 0.35);
  color: #ffd5d5;
}

.portal-alert.success {
  background: rgba(62, 207, 188, 0.14);
  border: 1px solid rgba(62, 207, 188, 0.35);
  color: #d7fff8;
}

.portal-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  margin: 0 0 18px;
  font-size: 0.95rem;
}

.portal-footer {
  margin-top: 22px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.affiliate-hero {
  text-align: left;
}

.affiliate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 28px 0 8px;
}

.affiliate-tile {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 18px 16px;
  animation: portal-rise 0.8s ease both;
}

.affiliate-tile:nth-child(2) {
  animation-delay: 0.08s;
}

.affiliate-tile:nth-child(3) {
  animation-delay: 0.16s;
}

.affiliate-tile h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-family: var(--font-display);
}

.affiliate-tile p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.affiliate-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.affiliate-topbar a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.affiliate-topbar a:hover {
  text-decoration: underline;
}

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

@media (max-width: 560px) {
  .portal-card {
    padding: 28px 20px;
  }

  .affiliate-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
