/* ==========================================================================
   LAYOUT
   Struktura strony, header, footer, sekcje
   ========================================================================== */

/* ------------------------------------------------------------------
   CONTAINER
   ------------------------------------------------------------------ */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

.container-narrow {
  max-width: var(--container-md);
}

.container-wide {
  max-width: var(--container-2xl);
}

/* ------------------------------------------------------------------
   HEADER
   ------------------------------------------------------------------ */

.header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background-color: var(--color-bg-white);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  gap: var(--space-4);
}

.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header-logo img {
  height: 50px;
  width: auto;
}

.header-nav {
  display: none;
}

@media (min-width: 1024px) {
  .header-nav {
    display: flex;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header-phone {
  display: none;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--font-semibold);
  color: var(--color-accent);
  text-decoration: none;
}

@media (min-width: 768px) {
  .header-phone {
    display: flex;
  }
}

.header-phone svg {
  width: 20px;
  height: 20px;
}

/* Mobile Menu Button */
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text);
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

@media (min-width: 1024px) {
  .menu-toggle {
    display: none;
  }
}

/* Mobile Navigation */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background-color: var(--color-bg-white);
  padding: var(--space-6);
  overflow-y: auto;
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.mobile-nav-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mobile-nav-link {
  display: block;
  padding: var(--space-4);
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: background-color var(--transition-fast);
}

.mobile-nav-link:hover {
  background-color: var(--color-bg-alt);
  color: var(--color-accent);
}

.mobile-nav-cta {
  margin-top: var(--space-8);
}

/* ------------------------------------------------------------------
   HERO SECTION
   ------------------------------------------------------------------ */

.hero {
  padding: var(--space-12) 0 var(--space-16);
  background-color: var(--color-bg);
  background-image: url('../images/hero-handshake.png');
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: 40% auto;
  background-blend-mode: soft-light;
  position: relative;
}

@media (max-width: 1024px) {
  .hero {
    background-image: none;
  }
}

.hero-inner {
  display: grid;
  gap: var(--space-10);
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
  }
}

.hero-content {
  text-align: center;
}

@media (min-width: 1024px) {
  .hero-content {
    text-align: left;
  }
}

.hero-badge {
  margin-bottom: var(--space-4);
}

.hero-title {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
  .hero-title {
    font-size: var(--text-4xl);
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: var(--text-5xl);
  }
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-light);
  margin-bottom: var(--space-8);
  line-height: var(--leading-relaxed);
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: var(--text-xl);
  }
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (min-width: 480px) {
  .hero-actions {
    flex-direction: row;
    justify-content: center;
  }
}

@media (min-width: 1024px) {
  .hero-actions {
    justify-content: flex-start;
  }
}

.hero-image {
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.hero-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ------------------------------------------------------------------
   SECTIONS
   ------------------------------------------------------------------ */

/* Hero Small Variant for subpages */
.hero.hero-small {
  padding: var(--space-12) 0;
  background-image: none;
}

.hero.hero-small h1 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
  .hero.hero-small h1 {
    font-size: var(--text-4xl);
  }
}

/* Hero About Variant */
.hero.hero-about {
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 1)), url('../images/hero-about.png');
  background-size: cover;
  background-position: center;
  padding: var(--space-16) 0;
}


.hero.hero-about .hero-title,
.hero.hero-faq .hero-title,
.hero.hero-contact .hero-title {
  text-shadow: 0 2px 15px rgba(255, 255, 255, 0.9);
  position: relative;
  /* Drobna poprawka dla z-index */
  z-index: 1;
}

/* Hero FAQ Variant */
.hero.hero-faq {
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)), url('../images/hero-faq-v2.png');
  background-size: cover;
  background-position: center;
  padding: var(--space-16) 0;
}

/* Hero Contact Variant */
.hero.hero-contact {
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)), url('../images/hero-contact-v2.png');
  background-size: cover;
  background-position: center;
  padding: var(--space-16) 0;
}

/* Hero Apartment Variant */
.hero.hero-apartment {
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)), url('../images/hero-apartment.png');
  background-size: cover;
  background-position: center;
  padding: var(--space-16) 0;
}

/* Hero House Variant */
.hero.hero-house {
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)), url('../images/hero-house.png');
  background-size: cover;
  background-position: center;
  padding: var(--space-16) 0;
}

/* Hero Land Variant */
.hero.hero-land {
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)), url('../images/hero-land.png');
  background-size: cover;
  background-position: center;
  padding: var(--space-16) 0;
}

/* Hero Debt Variant */
.hero.hero-debt {
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)), url('../images/hero-debt.png');
  background-size: cover;
  background-position: center;
  padding: var(--space-16) 0;
}

/* Hero Heritage Variant (Reuse House) */
.hero.hero-heritage {
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)), url('../images/hero-house.png');
  background-size: cover;
  background-position: center;
  padding: var(--space-16) 0;
}

/* Hero Tenant Variant (Reuse Apartment) */
.hero.hero-tenant {
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)), url('../images/hero-apartment.png');
  background-size: cover;
  background-position: center;
  padding: var(--space-16) 0;
}

/* Hero Cash Variant (Reuse Contact) */
.hero.hero-cash {
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)), url('../images/hero-contact-v2.png');
  background-size: cover;
  background-position: center;
  padding: var(--space-16) 0;
}

/* Hero Articles Variant */
.hero.hero-articles {
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)), url('../images/hero-bg.png');
  background-size: cover;
  background-position: center;
  padding: var(--space-16) 0;
}

.hero.hero-articles .hero-inner {
  display: block;
  text-align: center;
}

.hero.hero-articles .hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero.hero-articles .hero-actions {
  justify-content: center;
}


.hero.hero-apartment .hero-title,
.hero.hero-house .hero-title,
.hero.hero-land .hero-title,
.hero.hero-debt .hero-title,
.hero.hero-heritage .hero-title,
.hero.hero-tenant .hero-title,
.hero.hero-cash .hero-title,
.hero.hero-articles .hero-title {
  text-shadow: 0 2px 15px rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 1;
}

.section {
  padding: var(--space-16) 0;
}

.section-alt {
  background-color: var(--color-bg-white);
}

.section-header {
  text-align: center;
  max-width: var(--container-md);
  margin: 0 auto var(--space-12);
}

.section-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
  .section-title {
    font-size: var(--text-4xl);
  }
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-light);
  line-height: var(--leading-relaxed);
}

/* ------------------------------------------------------------------
   GRID LAYOUTS
   ------------------------------------------------------------------ */

.grid {
  display: grid;
  gap: var(--space-8);
}

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

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

@media (min-width: 640px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

@media (min-width: 640px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ------------------------------------------------------------------
   CTA SECTION
   ------------------------------------------------------------------ */

.cta-section {
  padding: var(--space-16) 0;
  background-color: var(--color-accent);
  color: white;
  text-align: center;
}

.cta-title {
  font-size: var(--text-3xl);
  color: white;
  margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
  .cta-title {
    font-size: var(--text-4xl);
  }
}

.cta-subtitle {
  font-size: var(--text-lg);
  opacity: 0.9;
  margin-bottom: var(--space-8);
}

.cta-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

@media (min-width: 480px) {
  .cta-actions {
    flex-direction: row;
    justify-content: center;
  }
}

.cta-section .btn-primary {
  background-color: white;
  color: var(--color-accent);
  border-color: white;
}

.cta-section .btn-primary:hover {
  background-color: var(--color-bg);
  border-color: var(--color-bg);
}

.cta-section .btn-secondary {
  color: white;
  border-color: white;
}

.cta-section .btn-secondary:hover {
  background-color: white;
  color: var(--color-accent);
}

/* ------------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------------ */

.footer {
  background-color: var(--color-primary);
  color: white;
  padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  height: 40px;
  width: auto;
  margin-bottom: var(--space-4);
}

.footer-description {
  font-size: var(--text-sm);
  opacity: 0.8;
  line-height: var(--leading-relaxed);
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: white;
  margin-bottom: var(--space-4);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: var(--space-2);
}

.footer-links a {
  color: white;
  opacity: 0.8;
  text-decoration: none;
  font-size: var(--text-sm);
  transition: opacity var(--transition-fast);
}

.footer-links a:hover {
  opacity: 1;
  color: white;
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.footer-contact-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.footer-bottom {
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-copyright {
  font-size: var(--text-sm);
  opacity: 0.7;
}

.footer-legal {
  display: flex;
  gap: var(--space-4);
}

.footer-legal a {
  font-size: var(--text-sm);
  color: white;
  opacity: 0.7;
  text-decoration: none;
}

.footer-legal a:hover {
  opacity: 1;
  color: white;
}

/* ------------------------------------------------------------------
   PAGE LAYOUTS
   ------------------------------------------------------------------ */

.page-header {
  padding: var(--space-12) 0;
  background-color: var(--color-bg-white);
  text-align: center;
}

.page-title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
  .page-title {
    font-size: var(--text-5xl);
  }
}

.page-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-light);
  max-width: var(--container-md);
  margin: 0 auto;
}

.page-content {
  padding: var(--space-12) 0 var(--space-16);
}

/* ------------------------------------------------------------------
   TWO COLUMN LAYOUT
   ------------------------------------------------------------------ */

.two-col {
  display: grid;
  gap: var(--space-10);
  align-items: center;
}

@media (min-width: 1024px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
  }
}

.two-col-reverse {
  direction: ltr;
}

@media (min-width: 1024px) {
  .two-col-reverse> :first-child {
    order: 2;
  }

  .two-col-reverse> :last-child {
    order: 1;
  }
}

/* ------------------------------------------------------------------
   BACKGROUND IMAGE SECTIONS
   ------------------------------------------------------------------ */

.section-bg-image {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
}

.section-bg-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(26, 95, 78, 0.9);
  /* Strong Teal Overlay */
  z-index: 1;
}

.section-bg-image>.container {
  position: relative;
  z-index: 2;
}

.section-bg-image .section-title,
.section-bg-image h2 {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-bg-image .section-subtitle {
  color: rgba(255, 255, 255, 0.9);
}

/* Fix colors for cards inside bg sections */
.section-bg-image .card,
.section-bg-image .step-with-image,
.section-bg-image .property-card,
.section-bg-image .accordion-button,
.section-bg-image .accordion-content {
  color: var(--color-text);
}

.section-bg-image .accordion-button {
  background-color: rgba(255, 255, 255, 0.95);
}

.section-bg-image .accordion-content {
  background-color: rgba(255, 255, 255, 0.95);
}

/* Specific Backgrounds */
.bg-steps {
  background-image: url('../images/process-handshake.png');
}

.bg-process {
  background-image: url('../images/hero-bg.png');
}

.bg-faq {
  background-image: url('../images/happy-family.png');
  background-position: top center;
}

/* ------------------------------------------------------------------
   CITY LINKS GRID (HOMEPAGE)
   ------------------------------------------------------------------ */

.city-links-section {
  background-color: #1f2937;
  padding: var(--space-12) 0;
  color: white;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}


.city-links-section .container {
  max-width: 100%;
}

.city-links-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  /* Tighter gap */
  margin-top: var(--space-8);
  max-width: 100%;
  padding: 0 var(--space-4);
}

.btn-city {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  /* Smaller padding */
  font-size: 13px;
  font-weight: var(--font-medium);
  color: rgba(255, 255, 255, 0.85);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  white-space: nowrap;
  flex: 1 1 auto;
  /* Allow growing to fill space */
  min-width: 80px;
  /* Allow shrinking */
  max-width: 200px;
  /* Prevent being too wide on last distinct row item */
}

.btn-city:hover {
  background-color: white;
  color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: white;
}