/* Custom CSS Variables */
:root {
  --primary-purple: #7c3aed;
  --primary-purple-dark: #6d28d9;
  --primary-purple-light: #9575ff;
  --dark-bg: #1a1a2e;
  --dark-card: #16213e;
  --dark-border: rgba(139, 92, 246, 0.2);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --success-green: #10b981;
  --warning-yellow: #f59e0b;
  --danger-red: #ef4444;
}

/* Base Styles */
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--dark-bg);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Custom Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(0, -3px, 0);
  }
}

/* ========================================
   SITE HEADER
   ======================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--dark-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.12);
}

.nav-link {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s ease, background 0.15s ease;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.08);
}

.nav-link:focus-visible {
  outline: 2px solid var(--primary-purple-light);
  outline-offset: 2px;
}

.mobile-nav-link {
  display: block;
  padding: 0.625rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0.375rem;
  transition: color 0.15s ease, background 0.15s ease;
}

.mobile-nav-link:hover {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.08);
}

/* ========================================
   HERO
   ======================================== */
.hero-section {
  padding: 3rem 0 2.5rem;
  background: var(--dark-bg);
  position: relative;
  overflow: hidden;
}

.hero-section::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.07) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

@media (min-width: 768px) {
  .hero-section {
    padding: 5rem 0 4rem;
  }
}

@media (min-width: 1024px) {
  .hero-section {
    padding: 6rem 0 5rem;
  }
}

.hero-overline {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-purple-light);
  margin-bottom: 1.25rem;
}

.hero-headline {
  font-size: clamp(2.5rem, 8vw, 4.25rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--text-primary);
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
}

.hero-body {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 32rem;
  margin: 0 0 2rem;
}

@media (min-width: 768px) {
  .hero-body {
    font-size: 1.25rem;
  }
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: var(--success-green);
  color: var(--dark-bg);
  font-weight: 700;
  font-size: 0.9375rem;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.hero-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.hero-cta:active {
  transform: translateY(0);
}

.hero-cta:focus-visible {
  outline: 2px solid var(--success-green);
  outline-offset: 3px;
}

/* ========================================
   FILTERS
   ======================================== */
.filters-bar {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  background: var(--dark-bg);
  position: sticky;
  top: 56px;
  z-index: 40;
}

@media (min-width: 768px) {
  .filters-bar {
    top: 64px;
  }
}

.filters-count {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.filters-count strong {
  color: var(--text-primary);
  font-weight: 700;
}

.filters-divider {
  width: 1px;
  height: 16px;
  background: rgba(139, 92, 246, 0.2);
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.15);
}

.filter-pill.active {
  color: var(--text-primary);
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.3);
  font-weight: 600;
}

.filter-pill:focus-visible {
  outline: 2px solid var(--primary-purple-light);
  outline-offset: 2px;
}

/* ========================================
   OFFERS LIST
   ======================================== */
.offers-section {
  padding: 1.5rem 0 3rem;
}

@media (min-width: 768px) {
  .offers-section {
    padding: 2rem 0 4rem;
  }
}

.offers-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .offers-list {
    gap: 0.625rem;
  }
}

/* ========================================
   OFFER ROW (unified for mobile + desktop)
   ======================================== */
.offer-row {
  border: 1px solid rgba(139, 92, 246, 0.1);
  border-radius: 0.75rem;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: var(--dark-card);
}

.offer-row:hover {
  border-color: rgba(139, 92, 246, 0.25);
  background: rgba(22, 33, 62, 0.8);
}

.offer-row-inner {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  gap: 0.75rem;
}

@media (max-width: 767px) {
  .offer-row-inner {
    flex-wrap: wrap;
    row-gap: 0;
  }
}

/* --- Logo --- */
.offer-logo {
  flex-shrink: 0;
}

.logo-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(139, 92, 246, 0.1);
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.logo-fallback {
  font-size: 0.875rem;
  color: var(--primary-purple-light);
}

@media (min-width: 768px) {
  .logo-wrapper {
    width: 48px;
    height: 48px;
  }
}

/* --- Info --- */
.offer-info {
  flex: 1;
  min-width: 0;
}

@media (max-width: 767px) {
  .offer-info {
    flex: 1 1 calc(100% - 48px - 0.75rem);
  }
}

.offer-meta {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.meta-category {
  color: rgba(139, 92, 246, 0.9);
  background: rgba(139, 92, 246, 0.12);
}

.meta-deadline {
  color: rgba(245, 158, 11, 0.9);
  background: rgba(245, 158, 11, 0.1);
}

.meta-deadline.warning {
  color: rgba(251, 191, 36, 0.95);
  background: rgba(251, 191, 36, 0.12);
}

.meta-deadline.urgent {
  color: rgba(239, 68, 68, 0.95);
  background: rgba(239, 68, 68, 0.1);
}

.meta-deadline.expired {
  color: rgba(107, 114, 128, 0.8);
  background: rgba(107, 114, 128, 0.1);
}

.meta-badge {
  color: #1a1a2e;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.02em;
}

@media (min-width: 768px) {
  .meta-tag {
    font-size: 0.75rem;
  }
}

.offer-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  color: var(--text-primary);
}

.offer-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.offer-title a:hover {
  color: var(--primary-purple-light);
}

@media (min-width: 768px) {
  .offer-title {
    font-size: 1rem;
  }
}

.offer-desc {
  display: none;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0.375rem 0 0;
  max-width: 55ch;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 767px) {
  .offer-desc {
    display: none;
  }
}

@media (min-width: 768px) {
  .offer-desc {
    display: -webkit-box;
  }
}

/* --- Reward --- */
.offer-reward {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

@media (max-width: 767px) {
  .offer-reward {
    margin-left: auto;
    margin-top: 0.375rem;
  }
}

.reward-label-mobile {
  font-size: 0.625rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  margin-bottom: 0.125rem;
}

.reward-amount {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--success-green);
  line-height: 1.2;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .reward-amount {
    font-size: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .reward-amount {
    font-size: 1.75rem;
  }
}

/* --- Action --- */
.offer-action {
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .offer-action {
    margin-top: 0.375rem;
  }
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  background: var(--success-green);
  color: var(--dark-bg);
  font-weight: 600;
  font-size: 0.75rem;
  border-radius: 0.375rem;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.action-btn:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

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

.action-btn:focus-visible {
  outline: 2px solid var(--success-green);
  outline-offset: 2px;
}

@media (min-width: 768px) {
  .action-btn {
    padding: 0.625rem 1.125rem;
    font-size: 0.8125rem;
  }
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.empty-state .empty-icon {
  font-size: 1.5rem;
  color: var(--text-secondary);
  opacity: 0.5;
  margin-bottom: 0.5rem;
}

.empty-state h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ========================================
   UTILITY / SHARED
   ======================================== */
.btn-primary {
  background: linear-gradient(135deg, var(--success-green) 0%, #059669 100%);
  color: white;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-primary:active {
  transform: translateY(0) scale(1.02);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--primary-purple);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--primary-purple);
  color: white;
  transform: translateY(-1px);
}

.loading-spinner {
  animation: spin 1s linear infinite;
}

.hover-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.info-item {
  background: #0f3460;
  border-radius: 0.5rem;
  padding: 0.75rem;
  text-align: center;
  transition: all 0.3s ease;
}

.info-item:hover {
  background: #0d2847;
  transform: translateY(-2px);
}

.info-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--success-green);
  margin-bottom: 0.25rem;
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Badge Styles (used in offer detail pages) */
.badge-our-choice,
.badge-hit,
.badge-biggest,
.badge-ending {
  padding: 0.375rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.badge-our-choice {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #1a1a2e;
}

.badge-hit {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.badge-biggest {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
}

.badge-ending {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  animation: pulse 2s infinite;
}

/* Category Tags (used in offer detail pages) */
.category-tag {
  background: rgba(139, 92, 246, 0.2);
  color: var(--primary-purple-light);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  display: inline-block;
}

.category-tag.blue {
  background: rgba(33, 150, 243, 0.2);
  color: #60a5fa;
}

.category-tag.orange {
  background: rgba(255, 152, 0, 0.2);
  color: #fbbf24;
}

.category-tag.purple {
  background: rgba(156, 39, 176, 0.2);
  color: #c084fc;
}

.category-tag.yellow {
  background: rgba(255, 193, 7, 0.2);
  color: #fbbf24;
}

/* Mobile grid override */
@media (max-width: 768px) {
  .info-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* ========================================
   LEGACY STYLES (other pages still use these)
   ======================================== */

/* Hero gradient (offer_detail, company_detail, about_us, etc.) */
.hero-gradient {
  position: relative;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 58, 237, 0.15), transparent),
    radial-gradient(circle at 100% 50%, rgba(59, 130, 246, 0.1), transparent),
    linear-gradient(180deg, #0f1629 0%, #1a1a2e 50%, #16213e 100%);
  overflow: hidden;
}

.hero-gradient::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-gradient::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-title {
  color: var(--primary-purple-light);
}

/* Header gradient (old header) */
.header-gradient {
  background: linear-gradient(135deg, var(--dark-card) 0%, #0f3460 100%);
  backdrop-filter: blur(10px);
}

/* Expiry counter (offer detail pages) */
.expiry-counter {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  transition: all 0.3s ease;
}

.expiry-counter-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 0.5rem;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.expiry-time {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f59e0b;
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.time-value {
  font-weight: 700;
  color: #f59e0b;
}

.expiry-label {
  font-size: 0.625rem;
  color: #f59e0b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  opacity: 0.8;
}

.expiry-counter.warning .expiry-counter-inner {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.2);
}

.expiry-counter.warning .expiry-time,
.expiry-counter.warning .time-value,
.expiry-counter.warning .expiry-label {
  color: #fbbf24;
}

.expiry-counter.urgent .expiry-counter-inner {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  animation: pulse-urgent 2s infinite;
}

@keyframes pulse-urgent {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}

.expiry-counter.urgent .expiry-time,
.expiry-counter.urgent .time-value,
.expiry-counter.urgent .expiry-label {
  color: #ef4444;
}

.expiry-counter.expired .expiry-counter-inner {
  background: rgba(107, 114, 128, 0.1);
  border-color: rgba(107, 114, 128, 0.2);
}

.expiry-counter.expired .expiry-time,
.expiry-counter.expired .time-value,
.expiry-counter.expired .expiry-label {
  color: #6b7280;
  opacity: 0.7;
}

/* Subtle glow animation */
@keyframes subtle-glow {
  0%, 100% { box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3); }
  50% { box-shadow: 0 2px 12px rgba(251, 191, 36, 0.5); }
}

/* Step Content Styling */
.prose p {
  color: #d1d5db;
  line-height: 1.75;
  margin-bottom: 1rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

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

.prose em {
  color: #c084fc;
  font-style: normal;
}

.prose a {
  color: #60a5fa;
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

.prose a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.prose ul {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}

.prose ul li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
  color: #d1d5db;
  line-height: 1.6;
}

.prose ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #8b5cf6;
  font-weight: bold;
  font-size: 1.1em;
}

.prose ul ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}

.prose ul ul li::before {
  content: "•";
  color: #a78bfa;
}

/* Step Notice Boxes */
.step-notice {
  display: flex;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  border-radius: 0.75rem;
  border: 1px solid rgba(139, 92, 246, 0.15);
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.step-notice-icon {
  display: inline;
  font-size: 1.25rem;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.step-notice-content {
  flex: 1;
  display: block;
  font-size: 0.875rem;
}

.step-notice-content .step-notice-icon {
  float: left;
  margin-right: 0.5rem;
  margin-top: 0.125rem;
  line-height: 1.5;
}

.step-notice-content p {
  margin-bottom: 0.5rem;
}

.step-notice-content p:last-child {
  margin-bottom: 0;
}

.step-notice-content strong {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Important Notice (Red/Orange) */
.step-notice-important {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.1);
}

.step-notice-important .step-notice-icon {
  color: #fbbf24;
}

.step-notice-important .step-notice-content strong {
  color: #fbbf24;
}

/* PESEL Main Notice - Enhanced visibility */
.pesel-main-notice {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.15);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15), 0 0 0 1px rgba(245, 158, 11, 0.2);
  padding: 1.25rem 1.5rem;
}

.pesel-main-notice .step-notice-icon {
  font-size: 1.5rem;
  color: #f59e0b;
  filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.3));
}

.pesel-main-notice .step-notice-content {
  font-weight: 500;
}

.pesel-main-notice .step-notice-content p {
  color: #fef3c7;
  font-size: 0.875rem;
  line-height: 1.7;
}

.pesel-main-notice .pesel-notice-content {
  font-size: 0.875rem;
}

.step-content-wrapper {
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out, overflow 0.3s ease-out;
  max-height: none;
  opacity: 1;
}

/* Example Notice (Blue) */
.step-notice-example {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.1);
}

.step-notice-example .step-notice-icon {
  color: #60a5fa;
}

.step-notice-example .step-notice-content strong {
  color: #60a5fa;
}

/* Example text styling */
.step-notice-example .example-text {
  font-size: 0.875rem;
  font-style: italic;
  color: #cbd5e1;
  line-height: 1.6;
}

.step-notice-example .example-text p {
  font-size: 0.875rem;
  font-style: italic;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
}

.step-notice-example .example-text p:last-child {
  margin-bottom: 0;
}

/* Info Notice (Purple) */
.step-notice-info {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.1);
}

.step-notice-info .step-notice-icon {
  color: #a78bfa;
}

.step-notice-info .step-notice-content strong {
  color: #a78bfa;
}

/* Mobile optimizations for step notices */
@media (max-width: 768px) {
  .step-notice {
    padding: 0.875rem 1rem;
    margin: 1rem 0;
  }

  .step-notice-icon {
    font-size: 1.125rem;
    margin-right: 0.5rem;
  }

  .step-notice-content strong {
    font-size: 0.8125rem;
  }

  .pesel-main-notice {
    padding: 1rem 1.25rem;
  }

  .pesel-main-notice .step-notice-icon {
    font-size: 1.25rem;
  }

  .pesel-main-notice .step-notice-content p {
    font-size: 0.9rem;
  }
}

/* Modern Timeline Styling with Flowing Effects */
.timeline-line {
  background: repeating-linear-gradient(to bottom,
      transparent,
      transparent 3px,
      rgba(139, 92, 246, 0.35) 3px,
      rgba(139, 92, 246, 0.35) 6px);
  background-size: 1px 10px;
  overflow: visible;
}

.timeline-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom,
      rgba(139, 92, 246, 0.4),
      rgba(59, 130, 246, 0.4));
  -webkit-mask: repeating-linear-gradient(to bottom,
      transparent,
      transparent 3px,
      black 3px,
      black 6px);
  mask: repeating-linear-gradient(to bottom,
      transparent,
      transparent 3px,
      black 3px,
      black 6px);
  -webkit-mask-size: 1px 10px;
  mask-size: 1px 10px;
  pointer-events: none;
}

/* Flowing gradient effect */
.timeline-flow {
  position: absolute;
  top: 0;
  left: -1px;
  right: -1px;
  height: 60px;
  background: linear-gradient(to bottom,
      transparent,
      rgba(139, 92, 246, 0.6),
      rgba(59, 130, 246, 0.6),
      transparent);
  animation: flow-down 3s ease-in-out infinite;
  pointer-events: none;
  border-radius: 2px;
}

@keyframes flow-down {
  0% {
    top: -60px;
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  100% {
    top: 100%;
    opacity: 0;
  }
}

/* Flowing arrows along the timeline */
.timeline-flow-arrows {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.flow-arrow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: rgba(139, 92, 246, 0.7);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  animation: flow-arrow-down 4s linear infinite;
}

.flow-arrow:nth-child(1) {
  animation-delay: 0s;
}

.flow-arrow:nth-child(2) {
  animation-delay: 1.33s;
}

.flow-arrow:nth-child(3) {
  animation-delay: 2.66s;
}

@keyframes flow-arrow-down {
  0% {
    top: -10px;
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    top: 100%;
    opacity: 0;
  }
}

.timeline-node {
  transform: translateY(0.5rem);
  transition: all 0.3s ease;
}

.timeline-node>div:last-child {
  transition: all 0.3s ease;
}

.step-timeline-item:hover .timeline-node>div:last-child {
  transform: scale(1.3);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.8), 0 0 24px rgba(59, 130, 246, 0.4);
}

@keyframes pulse-slow {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.animate-pulse-slow {
  animation: pulse-slow 3s ease-in-out infinite;
}

.animate-spin-slow {
  animation: spin-slow 3s linear infinite;
}

.timeline-arrow {
  transition: all 0.3s ease;
  transform: translateY(50%);
  display: flex;
  justify-content: center;
  width: 1rem;
  animation: bounce-arrow 2s ease-in-out infinite;
}

@media (min-width: 640px) {
  .timeline-arrow {
    width: 2rem;
  }
}

@keyframes bounce-arrow {

  0%,
  100% {
    opacity: 0.6;
    transform: translateY(50%) translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(50%) translateY(3px);
  }
}

.timeline-connector {
  transition: all 0.3s ease;
}

.timeline-connector::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(to right, rgba(139, 92, 246, 0.6), transparent);
  transition: width 0.3s ease;
}

.step-timeline-item:hover .timeline-connector {
  background: linear-gradient(to right, rgba(139, 92, 246, 0.6), transparent);
}

.step-timeline-item:hover .timeline-connector::after {
  width: 100%;
}

/* Step greyed-out state for non-relevant steps */
.step-greyed-out {
  opacity: 0.4;
  filter: grayscale(0.6);
  pointer-events: auto;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.step-greyed-out .step-content-wrapper {
  background-color: rgba(31, 41, 55, 0.5) !important;
  border-color: rgba(75, 85, 99, 0.5) !important;
}

.step-greyed-out .step-content-wrapper:hover {
  background-color: rgba(31, 41, 55, 0.6) !important;
  border-color: rgba(75, 85, 99, 0.6) !important;
}

.step-greyed-out .timeline-node>div:last-child {
  background: linear-gradient(to bottom right, rgba(107, 114, 128, 0.6), rgba(75, 85, 99, 0.6)) !important;
  border-color: rgba(75, 85, 99, 0.5) !important;
  box-shadow: none !important;
}

.step-greyed-out .timeline-node>div:first-child {
  background: rgba(107, 114, 128, 0.1) !important;
}

.step-greyed-out .timeline-arrow i {
  color: rgba(107, 114, 128, 0.4) !important;
}

.step-greyed-out .timeline-connector {
  background: linear-gradient(to right, rgba(107, 114, 128, 0.2), transparent) !important;
}

.step-greyed-out .timeline-connector::after {
  background: linear-gradient(to right, rgba(107, 114, 128, 0.2), transparent) !important;
}

.step-greyed-out h4,
.step-greyed-out .text-gray-300,
.step-greyed-out .text-white,
.step-greyed-out .text-gray-100 {
  color: rgba(156, 163, 175, 0.7) !important;
}

.step-greyed-out .text-green-400 {
  color: rgba(156, 163, 175, 0.5) !important;
}

/* Keep filtered info message visible and styled - not affected by grey-out */
.step-greyed-out .step-filtered-info {
  opacity: 1 !important;
  filter: none !important;
  border-color: rgba(75, 85, 99, 0.8) !important;
  background-color: rgba(31, 41, 55, 0.4) !important;
}

.step-greyed-out .step-filtered-info .text-gray-400 {
  color: rgba(156, 163, 175, 0.9) !important;
}

/* Keep filtered info button visible and styled - not affected by grey-out */
.step-greyed-out .filtered-info-btn {
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  background-color: #2563eb !important;
  /* blue-600 */
  color: rgba(255, 255, 255, 1) !important;
}

.step-greyed-out .filtered-info-btn:hover {
  background-color: #3b82f6 !important;
  /* blue-500 */
  color: rgba(255, 255, 255, 1) !important;
}

.step-greyed-out .filtered-info-btn i {
  opacity: 1 !important;
  filter: none !important;
  color: rgba(255, 255, 255, 1) !important;
}

/* Tooltip should not be affected by grey-out styling */
.step-greyed-out .filtered-info-tooltip {
  opacity: 1 !important;
  filter: none !important;
  background-color: rgba(31, 41, 55, 0.95) !important;
  /* dark-200 */
  border-color: rgba(75, 85, 99, 1) !important;
  /* gray-600 */
  color: rgba(243, 244, 246, 1) !important;
  /* gray-100 */
}

/* Target gradient backgrounds using attribute selector as fallback */
.step-greyed-out [class*="from-purple-500"][class*="to-blue-500"],
.step-greyed-out [class*="from-blue-500"][class*="to-cyan-500"] {
  background: linear-gradient(to bottom right, rgba(107, 114, 128, 0.5), rgba(75, 85, 99, 0.5)) !important;
}

.step-greyed-out [class*="from-purple-900"][class*="to-blue-900"] {
  background: linear-gradient(to right, rgba(55, 65, 81, 0.3), rgba(55, 65, 81, 0.3)) !important;
  border-color: rgba(75, 85, 99, 0.3) !important;
}

/* Disable hover effects for greyed-out steps */
.step-greyed-out:hover .timeline-node>div:last-child {
  transform: scale(1) !important;
  box-shadow: none !important;
}

.step-greyed-out:hover .timeline-connector {
  background: linear-gradient(to right, rgba(107, 114, 128, 0.2), transparent) !important;
}

.step-greyed-out:hover .timeline-connector::after {
  width: 0 !important;
}

.step-greyed-out:hover [class*="from-purple-500"][class*="to-blue-500"] {
  transform: scale(1) !important;
}

/* Conditional content within step descriptions - grayed out when doesn't match user preferences */
.step-conditional-content {
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.step-conditional-content.step-conditional-greyed-out {
  opacity: 0.3 !important;
  filter: grayscale(0.8) !important;
  pointer-events: none;
  position: relative;
}

.step-conditional-content.step-conditional-greyed-out::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(31, 41, 55, 0.3);
  z-index: 1;
  pointer-events: none;
}

/* Variant-based conditional content (positive/negative) */
.step-conditional-content[data-variant] {
  transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Filtered step info button and tooltip */
.filtered-info-btn {
  position: relative;
}

.filtered-info-tooltip {
  min-width: 200px;
  max-width: 280px;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.4;
  text-align: center;
}

.filtered-info-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f2937;
  /* dark-200 */
}

/* Tooltip visibility is controlled by JavaScript click handler */
.filtered-info-tooltip.visible {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Mobile adjustments for tooltip */
@media (max-width: 640px) {
  .filtered-info-tooltip {
    min-width: 180px;
    max-width: 240px;
    font-size: 0.7rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Mobile optimizations for timeline */
@media (max-width: 640px) {
  .timeline-node {
    transform: translateY(0.375rem);
  }

  .timeline-arrow {
    font-size: 0.625rem;
  }

  .flow-arrow {
    width: 6px;
    height: 6px;
  }

  .timeline-flow {
    height: 40px;
  }
}

/* Utility Classes */
.backdrop-blur {
  backdrop-filter: blur(10px);
}

/* Animation Delays */
.animate-delay-100 {
  animation-delay: 0.1s;
}

.animate-delay-200 {
  animation-delay: 0.2s;
}

.animate-delay-300 {
  animation-delay: 0.3s;
}

.animate-delay-400 {
  animation-delay: 0.4s;
}

.animate-delay-500 {
  animation-delay: 0.5s;
}

/* Floating CTA Button (Mobile Only) */
#floating-cta {
  /* Safe area padding for iOS devices with notches */
  padding-bottom: env(safe-area-inset-bottom, 0);
  will-change: transform;
  /* Ensure it's above everything else */
  z-index: 9999;
}

#floating-cta .bg-gradient-to-t {
  /* Add extra padding for safe area */
  padding-bottom: calc(env(safe-area-inset-bottom, 0) + 1rem);
}

/* Add subtle shadow for depth */
#floating-cta::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));
  pointer-events: none;
}

/* Prevent body scroll jump when button appears */
body {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Floating button animation */
@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

#floating-cta.show {
  animation: slideUp 0.3s ease-out forwards;
}

/* Add subtle pulse animation to grab attention */
#floating-cta a {
  animation: subtlePulse 3s ease-in-out infinite;
}

@keyframes subtlePulse {

  0%,
  100% {
    box-shadow: 0 25px 50px -12px rgba(16, 185, 129, 0.4);
  }

  50% {
    box-shadow: 0 25px 50px -12px rgba(16, 185, 129, 0.6);
  }
}

/* Prevent button from interfering with content */
@media (max-width: 1023px) {

  /* Add padding to bottom sections on mobile to prevent overlap */
  section:last-of-type {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0));
  }
}

/* Cookie Consent Modal Styles */
#cookieConsentModal {
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

#cookieConsentModal>div>div:nth-child(3) {
  animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Cookie settings button animation */
#cookieSettingsButton {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(100%);
  }

  60% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

#cookieSettingsButton:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

#cookieSettingsButton:active {
  transform: scale(0.95);
}

/* Toggle switch animation */
.peer:checked~div {
  background-color: var(--primary-purple);
}

.peer:focus~div {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3);
}

/* Cookie category cards */
#detailedSettings .bg-dark-200 {
  transition: all 0.3s ease;
}

#detailedSettings .bg-dark-200:hover {
  background: rgba(31, 41, 55, 0.8);
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateX(4px);
}

/* Smooth transitions for view switching */
#simpleConsent,
#detailedSettings {
  animation: fadeInContent 0.3s ease-out;
}

@keyframes fadeInContent {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cookie icon animation */
#cookieConsentModal .fa-cookie-bite {
  animation: cookieRotate 3s ease-in-out infinite;
}

@keyframes cookieRotate {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-10deg);
  }

  75% {
    transform: rotate(10deg);
  }
}

/* Button hover effects */
#cookieConsentModal button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#cookieConsentModal button:hover {
  transform: translateY(-1px);
}

#cookieConsentModal button:active {
  transform: translateY(0);
}

/* Mobile optimization for cookie consent */
@media (max-width: 640px) {
  #cookieConsentModal .sm\\:max-w-2xl {
    max-width: 95%;
    margin: 1rem;
  }

  #cookieConsentModal .sm\\:flex-row-reverse {
    flex-direction: column-reverse;
  }

  #cookieConsentModal button {
    width: 100%;
  }

  #cookieSettingsButton {
    bottom: 5rem;
    left: 1rem;
    padding: 0.75rem;
  }

  #cookieSettingsButton i {
    font-size: 1.125rem;
  }
}

/* Accessibility improvements */
#cookieConsentModal button:focus {
  outline: 2px solid var(--primary-purple);
  outline-offset: 2px;
}

#cookieConsentModal a:focus {
  outline: 2px solid var(--primary-purple);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Toggle switch accessibility */
input[type="checkbox"]:focus+div {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3);
}

/* Dark mode enhancements for cookie modal */
.dark #cookieConsentModal .bg-dark-100 {
  background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
}

.dark #cookieConsentModal .bg-dark-200 {
  background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
}

/* Glassmorphism effect for modal */
#cookieConsentModal>div>div:nth-child(3) {
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* User Survey Modal Styles - Blue Theme */
.bg-survey-modal {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a2e4a 50%, #152238 100%);
}

.bg-survey-card {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a2e4a 100%);
}

#userSurveyModal {
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

#userSurveyModal>div>div:nth-child(3) {
  animation: slideInUp 0.4s ease-out;
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 50px -12px rgba(59, 130, 246, 0.2);
}

/* Preferences button animation */
#preferencesButton {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: bounceIn 0.6s ease-out;
}

#preferencesButton:hover {
  transform: scale(1.1) rotate(-15deg);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

#preferencesButton:active {
  transform: scale(0.95);
}

/* Survey question cards */
#userSurveyModal .bg-survey-card {
  transition: all 0.3s ease;
}

#userSurveyModal .bg-survey-card:hover {
  background: linear-gradient(135deg, #234a6f 0%, #1f3d5f 100%);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateX(4px);
}

/* Button hover effects for survey */
#userSurveyModal button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#userSurveyModal button:hover {
  transform: translateY(-1px);
}

#userSurveyModal button:active {
  transform: translateY(0);
}

/* Survey icon animation */
#userSurveyModal .fa-user-cog {
  animation: userCogRotate 3s ease-in-out infinite;
}

@keyframes userCogRotate {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-10deg);
  }

  75% {
    transform: rotate(10deg);
  }
}

/* Mobile optimization for survey modal */
@media (max-width: 640px) {
  #userSurveyModal .sm\\:max-w-2xl {
    max-width: 95%;
    margin: 1rem;
  }

  #userSurveyModal button {
    width: 100%;
  }

  #preferencesButton {
    bottom: 5rem;
    right: 1rem;
    padding: 0.75rem;
  }

  #preferencesButton i {
    font-size: 1.125rem;
  }
}

/* Accessibility improvements for survey */
#userSurveyModal button:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

#userSurveyModal input[type="checkbox"]:focus+div {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Dark mode enhancements for survey modal */
.dark .bg-survey-modal {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a2e4a 50%, #152238 100%);
}

.dark .bg-survey-card {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a2e4a 100%);
}

/* Resources Section Styling */
#resources {
  animation: fadeInUp 0.6s ease-out;
}

#resources ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#resources li {
  margin-bottom: 0.5rem;
}

#resources a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

#resources a:hover {
  text-decoration: underline;
}

/* Mobile optimization for resources */
@media (max-width: 768px) {
  #resources {
    padding: 1rem;
  }

  #resources h2 {
    font-size: 1.125rem;
  }
}

/* TOC visual hierarchy */
.toc-item-key .toc-link-key {
  background: rgba(16, 185, 129, 0.06) !important;
  border: 1px solid rgba(16, 185, 129, 0.12) !important;
  border-radius: 0.5rem;
}

.toc-item-key .toc-link-key:hover {
  background: rgba(16, 185, 129, 0.12) !important;
}

/* Active state overrides green tint when section is in viewport */
.toc-item-key .toc-link-key.bg-primary-500\/15 {
  background: rgba(124, 58, 237, 0.15) !important;
  border-color: rgba(124, 58, 237, 0.2) !important;
}

.toc-item-muted .toc-link-muted {
  font-size: 0.8125rem;
  opacity: 0.6;
}

.toc-item-muted .toc-link-muted:hover {
  opacity: 1;
}
