/* ==========================================================================
   Evgenia Amurova — Doradca Kredytowy
   Design System & Styles (Modern, Airy, Mobile-First)
   ========================================================================== */

/* --- CSS Variables (Design Tokens) --- */
:root {
  /* Typography */
  --font-heading: "Source Serif 4", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Colors */
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-glass: rgba(255, 255, 255, 0.85);
  --color-surface-alt: #f1f5f9;
  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-accent: #4f46e5; /* Indigo */
  --color-accent-hover: #4338ca;
  --color-accent-light: #e0e7ff;
  --color-accent-glow: rgba(79, 70, 229, 0.15);
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 8rem;

  /* Layout */
  --container-max: 1200px;
  --container-padding: 1.5rem;
  --section-padding-y: 5rem;

  /* Borders */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 12px 32px -4px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 20px 40px -4px rgba(79, 70, 229, 0.12);
  --shadow-image: 0 24px 48px -12px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
  :root {
    --section-padding-y: 7rem;
  }
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem; /* 17px base for airiness */
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin-top: 0;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--color-text);
  margin-bottom: var(--space-md);
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  margin-top: 0;
  margin-bottom: var(--space-md);
}

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

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section {
  padding: var(--section-padding-y) 0;
  position: relative;
}

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

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  transition: background var(--transition-smooth);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--container-padding);
  max-width: var(--container-max);
  margin: 0 auto;
}

.header__logo {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

@media (min-width: 640px) {
  .header__logo {
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
  }
}

.header__logo-role {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-weight: 500;
}

@media (min-width: 640px) {
  .header__logo-role::before {
    content: "—";
    margin-right: 0.25rem;
  }
}

.header__logo:hover {
  color: var(--color-accent);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.header__menu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-lg);
}

@media (min-width: 992px) {
  .header__menu {
    display: flex;
  }
}

.header__menu a {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 0;
  position: relative;
}

.header__menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  transition: width var(--transition-fast);
}

.header__menu a:hover {
  color: var(--color-accent);
}

.header__menu a:hover::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  margin-bottom: 5px;
  transition: all var(--transition-fast);
}

.mobile-menu-btn span:last-child {
  margin-bottom: 0;
}

@media (max-width: 991px) {
  .mobile-menu-btn {
    display: block;
  }

  .header__nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background: var(--color-surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 6rem 2rem 2rem;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transition: right var(--transition-smooth);
    z-index: 100;
  }

  .header__nav.is-open {
    right: 0;
  }

  .header__menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
  }

  .header__menu a {
    font-size: 1.25rem;
    display: block;
    width: 100%;
  }

  .mobile-menu-btn.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  
  .mobile-menu-btn.is-active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-btn.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  
  /* Show CTA on mobile menu */
  .header__nav .btn {
    display: inline-flex;
    width: 100%;
    margin-top: auto;
  }
}

.header__lang {
  display: flex;
  gap: var(--space-xs);
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--color-bg);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
}

.header__lang a {
  color: var(--color-text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.header__lang a.active {
  color: var(--color-accent);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.header__lang a:not(.active):hover {
  color: var(--color-text);
}

/* Hide CTA on very small screens to keep header clean */
@media (max-width: 480px) {
  .header__nav .btn {
    display: none;
  }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background-color: var(--color-accent);
  border: none;
  border-radius: 100px; /* Pill shape for modern look */
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px var(--color-accent-glow);
}

.btn:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px var(--color-accent-glow);
  color: white;
}

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

/* --- Hero --- */
.hero {
  padding: var(--space-2xl) 0 var(--space-xl);
  background: radial-gradient(circle at top right, #e0e7ff 0%, var(--color-bg) 40%);
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero {
    padding: var(--space-3xl) 0 var(--space-2xl);
  }
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

@media (min-width: 768px) {
  .hero__grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-3xl);
  }
}

.hero__badge {
  display: inline-block;
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
  background-color: var(--color-surface);
  border: 1px solid var(--color-accent-light);
  border-radius: 100px;
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.hero__subtitle {
  font-size: clamp(1.125rem, 4vw, 1.25rem);
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: var(--space-md);
  font-family: var(--font-heading);
}

.hero__text {
  font-size: clamp(1rem, 3vw, 1.125rem);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
  max-width: 34rem;
  line-height: 1.6;
}

.hero__photo {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-image);
}

/* Decorative blob behind photo */
.hero__photo::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -10%;
  width: 120%;
  height: 120%;
  background: linear-gradient(135deg, var(--color-accent-light) 0%, transparent 100%);
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  z-index: -1;
  animation: blob 10s infinite alternate;
}

@keyframes blob {
  0% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
  100% { border-radius: 60% 40% 30% 70% / 60% 50% 40% 50%; }
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-xl);
  position: relative;
  z-index: 1;
}

/* --- Services --- */
.services__accent {
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: var(--space-2xl);
  background: var(--color-accent-light);
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border-radius: 100px;
  margin-left: auto;
  margin-right: auto;
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.services__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

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

@media (min-width: 992px) {
  .services__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
  }
}

.service-card {
  background: var(--color-surface);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-smooth);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card-hover);
  background: var(--color-surface);
  border-color: var(--color-accent-light);
}

.service-card__icon {
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  color: var(--color-accent);
  border-radius: var(--radius-md);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

.service-card__title {
  margin-bottom: var(--space-sm);
}

.service-card__desc {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.6;
}

/* --- Process (Jak to działa) --- */
.process {
  counter-reset: process-step;
  max-width: 48rem;
  margin: 0 auto;
}

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

.process__item {
  position: relative;
  padding-left: 4.5rem;
  padding-bottom: var(--space-2xl);
  counter-increment: process-step;
}

.process__item:last-child {
  padding-bottom: 0;
}

.process__item::before {
  content: counter(process-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-surface);
  background: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 4px 12px var(--color-accent-glow);
  z-index: 2;
}

.process__item::after {
  content: "";
  position: absolute;
  left: 1.45rem;
  top: 3.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: repeating-linear-gradient(to bottom, var(--color-accent-light) 0, var(--color-accent-light) 4px, transparent 4px, transparent 8px);
  z-index: 1;
}

.process__item:last-child::after {
  display: none;
}

.process__title {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
  padding-top: 0.25rem;
}

.process__desc {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* --- Why Me --- */
.why__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .why__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
  }
}

.why-card {
  padding: var(--space-xl);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.why-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-accent-light);
}

.why-card__icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-light);
  color: var(--color-accent);
  border-radius: 50%;
  font-size: 1.5rem;
}

.why-card__title {
  margin-bottom: var(--space-sm);
}

.why-card__desc {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* --- Contact --- */
.contact-wrapper {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
}

.contact__subtitle {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
}

.contact__list {
  list-style: none;
  padding: 0;
  margin: 0 auto var(--space-xl);
  max-width: 24rem;
  text-align: left;
}

.contact__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.contact__item:last-child {
  border-bottom: none;
}

.contact__label {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.contact__value a {
  font-weight: 600;
  font-size: 1.0625rem;
}

.tg-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-2xl) var(--space-xl);
}

.tg-icon {
  color: #2AABEE;
  margin-bottom: var(--space-lg);
  background: rgba(42, 171, 238, 0.1);
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn--telegram {
  background-color: #2AABEE;
  box-shadow: 0 4px 12px rgba(42, 171, 238, 0.3);
  font-size: 1.125rem;
  padding: 1rem 2.5rem;
  gap: 0.75rem;
}

.btn--telegram:hover {
  background-color: #229ED9;
  box-shadow: 0 8px 16px rgba(42, 171, 238, 0.4);
}

/* --- Calculator (lead magnet) --- */
.calc { max-width: 560px; margin: 0 auto; }
.calc-section { margin-bottom: 1.5rem; }
.calc-section h3 { font-size: 1rem; margin-bottom: 0.5rem; color: var(--color-text-muted); }
#calcForm { position: relative; }

.calc .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .calc .form-row { grid-template-columns: 1fr; } }
.calc label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; }
.calc input, .calc select {
  width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 1rem;
}
.calc input:focus, .calc select:focus {
  outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-glow);
}
.calc .btn { width: 100%; margin-top: 0.5rem; padding: 1rem; font-size: 1.0625rem; }
.calc-error { background: #fef2f2; color: #b91c1c; padding: 0.75rem; border-radius: var(--radius-sm); margin-top: 0.5rem; display: none; }
.calc-error.visible { display: block; }
.calc-success { background: #d1fae5; color: #065f46; padding: 1rem; border-radius: var(--radius-md); margin-top: 1rem; display: none; font-weight: 500; }
.calc-success.visible { display: block; }
.calc-success__msg { margin: 0 0 0.5rem; font-weight: 600; }
.calc-success__hint { margin: 0 0 0.75rem; font-size: 0.9375rem; font-weight: 400; line-height: 1.45; opacity: 0.95; }
.calc-success .calc-success__bot { margin-top: 0.25rem; width: 100%; justify-content: center; display: inline-flex; align-items: center; gap: 0.5rem; }

.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-field .field-msg {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: #b91c1c;
  min-height: 1.25em;
}

input.field-invalid,
select.field-invalid {
  border-color: #b91c1c !important;
  box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.25);
}

.wa-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-2xl) var(--space-xl);
}

.wa-icon {
  color: #25D366;
  margin-bottom: var(--space-lg);
  background: rgba(37, 211, 102, 0.1);
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn--whatsapp {
  background-color: #25D366;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  font-size: 1.125rem;
  padding: 1rem 2.5rem;
  gap: 0.75rem;
}

.btn--whatsapp:hover {
  background-color: #128C7E;
  box-shadow: 0 8px 16px rgba(37, 211, 102, 0.4);
}

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

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

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  visibility: hidden;
}

.animate-on-scroll.is-visible {
  visibility: visible;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-on-scroll--left.is-visible {
  visibility: visible;
  animation: fadeInLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-on-scroll--right.is-visible {
  visibility: visible;
  animation: fadeInRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Delay classes for staggered animations */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* --- Footer --- */
.footer {
  padding: var(--space-xl) 0;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

@media (min-width: 640px) {
  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer__copy {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0;
}

.footer__link {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.footer__link:hover {
  color: var(--color-accent);
}
