:root {
  --bg: #f4f3ef;
  --ink: #0b0d15;
  --muted: #546075;
  --navy: #0a1a5e;
  --blue: #1d3dbb;
  --teal: #0fa3b1;
  --gold: #f6c453;
  --tile-border: #111321;
  --tile-shadow: 0 18px 30px rgba(10, 14, 30, 0.18);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% 0%, #e7e9f5 0%, transparent 60%),
    radial-gradient(1000px 800px at 90% 10%, #f7efe1 0%, transparent 55%),
    var(--bg);
  font-family: "Archivo", system-ui, -apple-system, sans-serif;
}

.page {
  max-width: 1140px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px 22px 34px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0e1e67, #1e48d8);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-family: "Sora", sans-serif;
}

.brand-title {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.2px;
  font-family: "Sora", sans-serif;
}

.brand-sub {
  color: var(--muted);
  font-size: 13px;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid var(--tile-border);
  font-weight: 600;
  background: white;
}

.hero {
  position: relative;
  border-radius: 18px;
  border: 3px solid var(--tile-border);
  overflow: hidden;
  min-height: 250px;
  box-shadow: var(--tile-shadow);
  background: #0f1434;
}

.hero-image {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(10, 16, 42, 0.75) 0%, rgba(10, 16, 42, 0.25) 45%, rgba(10, 16, 42, 0.1) 100%),
    url("https://images.unsplash.com/photo-1469474968028-56623f02e42e?q=80&w=1600&auto=format&fit=crop");
  background-size: cover;
  background-position: center;
}

.hero-login {
  position: relative;
  z-index: 2;
  width: 260px;
  height: 100%;
  min-height: 250px;
  padding: 22px 18px;
  color: white;
  background: linear-gradient(180deg, #0a0f3c, #0a1a70);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: slideIn 0.6s ease-out both;
}

.hero-login h2 {
  margin: 0;
  font-size: 20px;
  font-family: "Sora", sans-serif;
}

.hero-login p {
  margin: 0;
  font-size: 13px;
  opacity: 0.85;
}

.pin-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-weight: 600;
  letter-spacing: 6px;
  text-align: center;
}

.pin-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 2px;
}

.login-error {
  min-height: 16px;
  font-size: 12px;
  color: #ffd6d6;
}

.cta {
  margin-top: 4px;
  background: #f6c453;
  border: none;
  color: #111319;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: "Sora", sans-serif;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.hero-greeting {
  position: absolute;
  right: 26px;
  top: 28px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero-greeting.show {
  opacity: 1;
  transform: translateY(0);
}

.greet-btn {
  background: transparent;
  border: none;
  color: #f6f3ff;
  font-size: 22px;
  font-weight: 700;
  font-family: "Sora", sans-serif;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.logout-btn {
  display: none;
  background: #f6c453;
  border: none;
  color: #111319;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Sora", sans-serif;
}

.hero-greeting.expanded .logout-btn {
  display: inline-flex;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.show {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 24, 0.6);
}

.modal-card {
  position: relative;
  background: white;
  color: var(--ink);
  padding: 24px 26px;
  border-radius: 18px;
  width: min(420px, 90vw);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  z-index: 2;
  display: grid;
  gap: 12px;
  font-family: "Archivo", sans-serif;
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 12px;
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.modal-step {
  display: none;
  gap: 12px;
}

.modal-step.active {
  display: grid;
}

.modal-step h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.modal-step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.modal-grid {
  display: grid;
  gap: 10px;
}

.modal-grid label,
.modal-step label {
  font-size: 12px;
  font-weight: 600;
  display: grid;
  gap: 6px;
}

.modal-grid input,
.modal-step input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d6dbe7;
  font-size: 14px;
}

.modal-error {
  min-height: 16px;
  font-size: 12px;
  color: #bf1d1d;
}

.modal-cta {
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.ghost-link {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  text-decoration: none;
}

.tiles {
  margin-top: 18px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tile {
  position: relative;
  border-radius: var(--radius);
  border: 2px solid var(--tile-border);
  min-height: 140px;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  color: white;
  text-decoration: none;
  overflow: hidden;
  box-shadow: var(--tile-shadow);
  background-size: cover;
  background-position: center;
  transform: translateY(8px);
  opacity: 0;
  animation: rise 0.6s ease-out forwards;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.6) 100%);
}

.tile-coming::after {
  content: "W przyszlosci";
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(17, 19, 33, 0.4);
  background: rgba(255, 255, 255, 0.9);
  color: #0b0d15;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  pointer-events: none;
}

.tile-locked {
  cursor: default;
  filter: saturate(0.55) brightness(0.85);
  pointer-events: none;
}

.tile-locked::after {
  content: "Zaloguj sie";
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(17, 19, 33, 0.4);
  background: rgba(255, 255, 255, 0.92);
  color: #0b0d15;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  pointer-events: none;
}

.tile-disabled {
  cursor: default;
  filter: saturate(0.6) brightness(0.9);
  pointer-events: none;
}

.tile-disabled::after {
  content: attr(data-event-label);
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(17, 19, 33, 0.4);
  background: rgba(255, 255, 255, 0.92);
  color: #0b0d15;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  pointer-events: none;
}

.tile-text {
  position: relative;
  z-index: 2;
}

.tile-title {
  font-family: "Sora", sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.tile-sub {
  font-size: 12px;
  opacity: 0.9;
}

.tile-shop {
  background-image:
    linear-gradient(135deg, rgba(30, 61, 187, 0.6), rgba(8, 24, 64, 0.6)),
    url("https://images.unsplash.com/photo-1522202176988-66273c2fd55f?q=80&w=800&auto=format&fit=crop");
  animation-delay: 0.05s;
}

.tile-eventy {
  background-image:
    linear-gradient(135deg, rgba(16, 140, 155, 0.65), rgba(10, 30, 60, 0.7)),
    url("https://images.unsplash.com/photo-1451187580459-43490279c0fa?q=80&w=800&auto=format&fit=crop");
  animation-delay: 0.1s;
}

.tile-msg {
  background-image:
    linear-gradient(135deg, rgba(140, 85, 30, 0.7), rgba(40, 18, 12, 0.7)),
    url("https://images.unsplash.com/photo-1455390582262-044cdead277a?q=80&w=800&auto=format&fit=crop");
  animation-delay: 0.15s;
}

.tile-wallet {
  background-image:
    linear-gradient(135deg, rgba(24, 82, 160, 0.6), rgba(9, 17, 44, 0.8)),
    url("https://images.unsplash.com/photo-1520607162513-77705c0f0d4a?q=80&w=800&auto=format&fit=crop");
  animation-delay: 0.2s;
}

.tile-share {
  background-image:
    linear-gradient(135deg, rgba(52, 158, 106, 0.6), rgba(11, 40, 30, 0.8)),
    url("https://images.unsplash.com/photo-1521737604893-d14cc237f11d?q=80&w=800&auto=format&fit=crop");
  animation-delay: 0.25s;
}

.tile-fin {
  background-image:
    linear-gradient(135deg, rgba(155, 24, 24, 0.6), rgba(42, 6, 6, 0.8)),
    url("https://images.unsplash.com/photo-1567427017947-545c5f8d16ad?q=80&w=800&auto=format&fit=crop");
  animation-delay: 0.3s;
}

.footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@keyframes slideIn {
  from {
    transform: translateX(-12px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

@media (max-width: 980px) {
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .hero {
    min-height: 320px;
  }

  .hero-login {
    width: 100%;
    min-height: auto;
  }

  .hero-image {
    opacity: 0.8;
  }

  .tiles {
    grid-template-columns: 1fr;
  }
}
