/* ============================================================
   Roszada — roszada.com.pl
   Minimalistyczna, czarno-biała stylistyka z akcentami
   szachownicy i efektem glassmorphism.
   ============================================================ */

:root {
  --ink: #111111;
  --ink-soft: #3d3d3d;
  --ink-muted: #6b6b6b;
  --paper: #f7f7f5;
  --white: #ffffff;
  --line: rgba(17, 17, 17, 0.12);

  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-shadow: 0 8px 32px rgba(17, 17, 17, 0.08);

  --radius: 18px;
  --radius-small: 10px;

  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1140px;
  --checker-size: 44px;
}

/* ---------- Reset / bazowe ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background-color: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.container--narrow {
  max-width: 640px;
}

/* ---------- Tło: akcenty szachownicy ---------- */

.board-accent {
  position: fixed;
  z-index: -1;
  width: min(60vw, 620px);
  aspect-ratio: 1;
  pointer-events: none;
  background-image:
    repeating-conic-gradient(
      var(--ink) 0% 25%,
      transparent 0% 50%
    );
  background-size: calc(var(--checker-size) * 2) calc(var(--checker-size) * 2);
  opacity: 0.045;
}

.board-accent--top {
  top: -12%;
  right: -18%;
  transform: rotate(8deg);
  -webkit-mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 68%);
  mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 68%);
}

.board-accent--bottom {
  bottom: -15%;
  left: -20%;
  transform: rotate(-6deg);
  -webkit-mask-image: radial-gradient(circle at 30% 70%, #000 0%, transparent 68%);
  mask-image: radial-gradient(circle at 30% 70%, #000 0%, transparent 68%);
}

/* ---------- Glassmorphism ---------- */

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

/* ---------- Nagłówek / nawigacja ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  grid-template-columns: repeat(2, 11px);
  grid-template-rows: repeat(2, 11px);
  border: 1.5px solid var(--ink);
}

.brand__mark span:nth-child(1),
.brand__mark span:nth-child(4) {
  background: var(--ink);
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--ink);
}

/* Przycisk w nawigacji dziedziczyłby kolor linków (.site-nav a jest
   bardziej szczegółowe niż .btn--primary) — wymuszamy poprawny kontrast. */
.site-nav a.btn--primary {
  color: var(--white);
}

.site-nav a.btn--primary:hover {
  color: var(--ink);
}

/* ---------- Przyciski ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn--primary {
  background: var(--ink);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 6px 24px rgba(17, 17, 17, 0.18);
  transform: translateY(-1px);
}

.btn--small {
  padding: 9px 20px;
  font-size: 0.88rem;
}

.btn--block {
  width: 100%;
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(56px, 9vw, 120px) clamp(48px, 7vw, 96px);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 8vw, 5.6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.hero__slogan {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: 500;
  font-style: italic;
  color: var(--ink-soft);
}

.hero__lead {
  margin-top: 24px;
  max-width: 34em;
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--ink-soft);
}

/* ---------- Karta rejestracji ---------- */

.signup-card {
  padding: clamp(24px, 4vw, 36px);
  border-radius: var(--radius);
}

.signup-card__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.field {
  position: relative;
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.field input {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder {
  color: var(--ink-muted);
  opacity: 0.7;
}

.field input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.field input.is-invalid {
  border-color: #b00020;
}

/* ---------- Podpowiedzi adresów ---------- */

.autocomplete {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.14);
}

.autocomplete li {
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.autocomplete li.is-active,
.autocomplete li:hover {
  background: rgba(17, 17, 17, 0.07);
  color: var(--ink);
}

/* ---------- Mockup wyliczenia dojazdu ---------- */

.commute {
  margin: -2px 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.6);
  animation: field-reveal 0.25s ease;
}

.commute__loading {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.commute__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.commute__distance {
  font-size: 0.9rem;
  font-weight: 600;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.commute__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.commute__item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.commute__note {
  margin-top: 9px;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* Pole odsłaniane po zaznaczeniu checkboxa pracy sieciowej */
.field--conditional {
  margin-top: 2px;
  padding-left: 32px;
  animation: field-reveal 0.25s ease;
}

@keyframes field-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Pola wyboru ---------- */

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.checkbox__box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  background: var(--white);
  position: relative;
  transition: background 0.15s ease;
}

.checkbox__box::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--white);
  clip-path: polygon(14% 46%, 38% 70%, 86% 18%, 96% 30%, 38% 90%, 4% 58%);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.checkbox input:checked + .checkbox__box {
  background: var(--ink);
}

.checkbox input:checked + .checkbox__box::after {
  opacity: 1;
}

.checkbox input:focus-visible + .checkbox__box {
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.15);
}

.checkbox__label {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.signup-card .btn--block {
  margin-top: 8px;
}

.signup-card__note {
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-align: center;
}

.signup-card__success {
  margin-top: 14px;
  padding: 12px 16px;
  font-size: 0.9rem;
  text-align: center;
  border: 1px solid var(--ink);
  border-radius: var(--radius-small);
  background: var(--white);
}

/* ---------- Sekcje ---------- */

.section {
  padding-block: clamp(56px, 8vw, 110px);
}

.section--alt {
  background:
    linear-gradient(rgba(247, 247, 245, 0.92), rgba(247, 247, 245, 0.92)),
    repeating-conic-gradient(var(--ink) 0% 25%, transparent 0% 50%);
  background-size: auto, calc(var(--checker-size) * 2) calc(var(--checker-size) * 2);
  border-block: 1px solid var(--line);
}

.section--cta {
  text-align: center;
}

.section--cta .signup-card {
  margin-top: 36px;
  text-align: left;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.section__intro {
  max-width: 46em;
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--ink-soft);
}

.section--cta .section__intro {
  margin-inline: auto;
}

/* ---------- Kroki (jak to działa) ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.step {
  padding: 28px;
  border-radius: var(--radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.step:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(17, 17, 17, 0.12);
}

.step__number {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px var(--ink);
  margin-bottom: 14px;
}

.step h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.step p {
  font-size: 0.93rem;
  color: var(--ink-soft);
}

/* ---------- Dwie ścieżki ---------- */

.paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 48px;
}

.path {
  padding: clamp(28px, 4vw, 40px);
  border-radius: var(--radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.path:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(17, 17, 17, 0.12);
}

.path__icon {
  width: 56px;
  height: 56px;
  padding: 13px;
  margin-bottom: 20px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-small);
  background: var(--white);
  color: var(--ink);
}

.path h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.path p {
  font-size: 0.98rem;
  font-weight: 300;
  color: var(--ink-soft);
}

/* ---------- Strony auth i panel ---------- */

.auth-page {
  padding-block: clamp(48px, 7vw, 96px);
}

.auth-page .section__title {
  text-align: center;
}

.auth-page .section__intro {
  text-align: center;
  margin-inline: auto;
  margin-bottom: 32px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-error {
  margin-bottom: 14px;
  padding: 11px 14px;
  font-size: 0.88rem;
  color: #b00020;
  border: 1px solid rgba(176, 0, 32, 0.35);
  border-radius: var(--radius-small);
  background: rgba(176, 0, 32, 0.05);
}

.form-success {
  margin-bottom: 14px;
  padding: 11px 14px;
  font-size: 0.88rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius-small);
  background: var(--white);
}

.draft-summary {
  margin-bottom: 20px;
  padding: 16px 20px;
  border-radius: var(--radius-small);
}

.draft-summary__title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.draft-summary__row {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.container--panel {
  max-width: 720px;
  display: grid;
  gap: 20px;
}

.panel-card {
  padding: clamp(22px, 3.5vw, 32px);
  border-radius: var(--radius);
}

.panel-card--identity {
  display: flex;
  align-items: center;
  gap: 20px;
}

.panel-card__name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.2;
}

.panel-card__meta {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.panel-card__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.avatar {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: var(--white) center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}

.avatar--small {
  width: 52px;
  height: 52px;
  font-size: 1.1rem;
}

.photo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.photo-row input[type="file"] {
  font-size: 0.85rem;
  max-width: 100%;
}

.btn-link {
  border: 0;
  background: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-decoration: underline;
  cursor: pointer;
}

.btn-link:hover {
  color: var(--ink);
}

.route-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 14px;
}

.route-line__arrow {
  font-size: 1.2rem;
  color: var(--ink-muted);
}

.match-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.5);
}

.match-status__dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.match-group__title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 18px 0 10px;
}

.match-item {
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.65);
}

.match-item__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.match-item__name {
  font-size: 0.95rem;
  font-weight: 600;
}

.match-item__score {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 2px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
}

.match-item__route {
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.match-item__route--muted {
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.panel-card--danger {
  border-color: rgba(176, 0, 32, 0.3);
}

.panel-card--danger .panel-card__meta {
  margin-bottom: 16px;
}

.btn--danger {
  background: transparent;
  border-color: #b00020;
  color: #b00020;
}

.btn--danger:hover {
  background: #b00020;
  color: var(--white);
  transform: translateY(-1px);
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .panel-card--identity {
    flex-direction: column;
    text-align: center;
  }
}

/* ---------- Stopka ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 28px;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.site-footer__slogan {
  font-family: var(--font-display);
  font-style: italic;
}

/* ---------- Responsywność ---------- */

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

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

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

@media (max-width: 560px) {
  .site-nav {
    gap: 18px;
  }

  .site-nav a:not(.btn) {
    display: none;
  }

  .site-footer__inner {
    flex-direction: column;
    text-align: center;
  }

  :root {
    --checker-size: 32px;
  }
}

/* ---------- Preferencje dostępności ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
