/* ==========================
   PORTAL RESET & BASE
   ========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Tokeny globalne: includes/tokens.css (ładowane przez header.php).
   Portal celowo nadpisuje tylko cienie – karty siatki portalu mają
   miększy, głębszy cień niż karty kalkulatorów. */
:root {
  --shadow-sm: 0 4px 16px rgba(23, 105, 212, 0.06);
  --shadow-md: 0 10px 30px rgba(23, 105, 212, 0.12);
  --shadow-lg: 0 20px 48px rgba(23, 105, 212, 0.18);
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

#snowCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
  /* Zwiększony z-index, by padał nad tłem hero */
  opacity: 0.45;
}

.page-wrapper {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ==========================
   HERO
   ========================== */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  padding: 80px 24px 100px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg);
  clip-path: ellipse(60% 100% at 50% 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 6px 18px;
  border-radius: 100px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 20px;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .hero h1 {
    white-space: normal;
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }
}

.gradient-text {
  background: linear-gradient(90deg, #fff 0%, #caf0f8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

/* ==========================
   PORTAL GRID
   ========================== */
.app-container {
  max-width: 1040px;
  margin: 40px auto 40px;
  /* Dodano odstęp od niebieskiego nagłówka (usunięto -60px) */
  padding: 0 24px;
  width: 100%;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }

  .app-container {
    margin-top: 20px;
  }

  /* Zmniejszony na mobile */
}

/* ==========================
   PORTAL CARDS
   ========================== */
.portal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  text-decoration: none;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.portal-card.active {
  border-color: var(--primary);
  background: linear-gradient(to bottom right, #ffffff, #f4f9ff);
  box-shadow: var(--shadow-md);
}

.portal-card.active:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.portal-card.disabled {
  background: var(--bg-section);
  opacity: 0.75;
  cursor: default;
  border-color: rgba(221, 227, 239, 0.6);
}

.card-icon-wrap {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  background: rgba(23, 105, 212, 0.08);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  transition: transform 0.3s;
}

.portal-card.active:hover .card-icon-wrap {
  transform: scale(1.1) rotate(4deg);
  background: rgba(23, 105, 212, 0.12);
}

.portal-card.disabled .card-icon-wrap {
  background: rgba(128, 144, 173, 0.1);
  filter: grayscale(1);
}

.card-content {
  flex: 1;
}

.card-content h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.portal-card.active h2 {
  color: var(--primary);
}

.card-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-arrow {
  font-size: 1.4rem;
  color: var(--primary);
  font-weight: 800;
  opacity: 0.5;
  transition: all 0.3s;
  align-self: center;
}

.portal-card.active:hover .card-arrow {
  opacity: 1;
  transform: translateX(6px);
}

.coming-soon-ribbon {
  position: absolute;
  top: 25px;
  right: -32px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #ffb703, #fb8500);
  color: #fff;
  padding: 5px 40px;
  transform: rotate(45deg);
  box-shadow: 0 4px 12px rgba(251, 133, 0, 0.3);
}

.coming-soon-ribbon.highlight-ribbon {
  background: linear-gradient(135deg, #8338ec, #ff006e);
  box-shadow: 0 4px 12px rgba(131, 56, 236, 0.3);
}

/* ==========================
   FOOTER
   ========================== */
.site-footer {
  margin-top: 40px;
  padding: 40px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-section);
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer-logo-link {
  display: inline-block;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-logo-link:hover {
  opacity: 1;
}

.footer-logo {
  width: 140px;
  height: auto;
  display: block;
}

.footer-copy {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0;
}

.footer-disclaimer {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 600px;
  margin: 0;
  opacity: 0.8;
}

.footer-disclaimer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.footer-disclaimer a:hover {
  text-decoration: underline;
}

/* ==========================
   SEO CONTENT SECTION
   ========================== */
.seo-content {
  margin: 20px auto 60px;
  max-width: 800px;
  padding: 0 24px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.seo-content h2 {
  font-size: 1.4rem;
  color: #1255b0;
  /* primary-dark */
  margin-top: 10px;
  margin-bottom: 12px;
  font-weight: 800;
  text-align: center;
}

.seo-content h3 {
  font-size: 1.15rem;
  color: var(--primary);
  margin-top: 32px;
  margin-bottom: 16px;
  font-weight: 700;
}

.seo-intro {
  text-align: center;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.seo-content p {
  margin-bottom: 16px;
  opacity: 0.85;
}

.seo-content ul {
  margin-bottom: 20px;
  padding-left: 24px;
  opacity: 0.85;
}

.seo-content li {
  margin-bottom: 8px;
}

.seo-content li strong {
  color: var(--text-primary);
}

/* ── Error 404 ──────────────────────────────── */
.error-404-wrap {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.error-404-content {
  text-align: center;
  max-width: 520px;
}

.error-404-code {
  font-size: clamp(5rem, 20vw, 8rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #00b4d8, #1769d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.error-404-content h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  margin: 0 0 1rem;
}

.error-404-content > p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.error-404-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.error-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  background: white;
  border: 1.5px solid #dde3ef;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: border-color 0.2s, transform 0.15s;
}

.error-card:hover {
  border-color: #00b4d8;
  transform: translateY(-2px);
}

.error-card-icon {
  font-size: 1.3rem;
}

.error-home-link {
  color: #00b4d8;
  text-decoration: none;
  font-weight: 500;
}

.error-home-link:hover {
  text-decoration: underline;
}

/* ==========================
   QUIZ PORTAL CARD
   ========================== */
.portal-card.quiz-card {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f2fb 100%);
  border-color: var(--primary);
  align-items: center;
}

.portal-card.quiz-card h2 {
  color: var(--primary);
}

.portal-card.quiz-card p {
  color: var(--text-secondary);
}

.portal-card.quiz-card .card-icon-wrap {
  background: rgba(23, 105, 212, 0.1);
}

.portal-card.quiz-card:hover .card-icon-wrap {
  background: rgba(23, 105, 212, 0.16);
}

.portal-card.quiz-card .card-arrow {
  color: var(--primary);
  opacity: 0.5;
}

.portal-card.quiz-card:hover .card-arrow {
  opacity: 1;
}

.quiz-label-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: #f97316;
  color: #fff;
  padding: 4px 10px;
  border-radius: 100px;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
}