:root {
  --color-primary: #1f3552;
  --color-secondary: #2c3e50;
  --color-text: #444;
  --color-muted: rgba(0, 0, 0, 0.65);

  --fs-h1: clamp(1.9rem, 4vw, 3.2rem);
  --fs-h2: clamp(1.4rem, 2.5vw, 2rem);
  --fs-body: clamp(1rem, 1.2vw, 1.15rem);

  --lh-tight: 1.15;
  --lh-normal: 1.6;
  --lh-loose: 1.8;

  --header-h: 44px;
}

.body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  height: 100dvh;
  overflow: hidden;
  font-family: Arial, sans-serif;
}

.stage {
  height: 100%;
  position: relative;
  overflow: visible;
}

.grid {
  height: 100%;
  z-index: 1;
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr;
  background-color: white;
}

.header {
  position: relative;
  grid-row: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 1;
  background-color: #0d3b66;
  color: white;
  padding: 0.75rem 1rem;
  padding-top: calc(6px + env(safe-area-inset-top));
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  line-height: 1.4;
}

.header p {
  margin: 0;
  max-width: 100%;
}

.header strong {
  font-weight: 600;
  color: white;
}

.header a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.header a:hover {
  text-decoration: underline;
}

.logo-overlay {
  position: absolute;
  z-index: 2;
  top: calc(env(safe-area-inset-top) + 8px);
  left: 12px;
  width: 140px;
  height: 140px;
  background: url("logo.png") left top / contain no-repeat;
  transform: none;
  pointer-events: none;
}

footer {
  grid-row: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: #0d3b66;
  color: white;
  padding: 0.75rem 1rem;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

h1 {
  margin: 0 0 1rem;
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  color: var(--color-secondary);
  font-weight: 600;
  text-align: center;
}

p,
li {
  margin: 0 0 0.75rem;
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--color-text);
}

ul {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  list-style-type: disc;
  text-align: left;
}

li {
  padding-left: 0.25rem;
}

form {
  display: grid;
  gap: 12px;
}

form h1 {
  margin-bottom: 0.5rem;
}

form h2 {
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  font-weight: 500;
  color: var(--color-muted);
}

input,
textarea {
  width: 100%;
  max-width: 560px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(13, 59, 102, 0.25);
  background: white;
  color: #1f1f1f;
  outline: none;
  box-sizing: border-box;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

input:focus,
textarea:focus {
  border-color: #0d3b66;
  box-shadow: 0 0 0 3px rgba(13, 59, 102, 0.15);
}

.content-wrapper {
  grid-column: 1 / -1;
  overflow-y: auto;
  height: 100%;
  max-height: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.content-wrapper::-webkit-scrollbar {
  display: none;
}

.stage,
.grid,
.content-wrapper {
  min-height: 0;
}

.content {
  min-height: 100%;
  padding: clamp(16px, 2vw, 24px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  scroll-margin-top: 0;
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 700ms ease,
    transform 700ms ease;
  will-change: opacity, transform;
}

.content.is-active {
  opacity: 1;
  transform: translateY(0);
}

.content.is-scrolling {
  transition-duration: 1000ms;
}

.content-4 form {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
}

.intro {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.intro h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #2c3e50;
  margin-bottom: 1.5rem;
}

.intro p {
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  line-height: var(--lh-loose);
  color: var(--color-text);
}

.logo-mobile {
  display: none;
}

.btn {
  border: 0;
  border-radius: 14px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: #007bff;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
  box-shadow: 0 10px 24px rgba(13, 59, 102, 0.22);
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn:focus-visible {
  outline: 3px solid rgba(13, 59, 102, 0.35);
  outline-offset: 3px;
}

#send-btn:disabled {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
  transform: none;
}

#send-btn:disabled:hover {
  background-color: #ccc;
  color: #666;
  transform: none;
}

/* ===== Consent checkbox ===== */
.consent {
  width: 100%;
  max-width: 560px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(13, 59, 102, 0.18);
  background: rgba(13, 59, 102, 0.04);
  font-size: 0.98rem;
  line-height: 1.35;
  color: var(--color-text);
  box-sizing: border-box;
}

.consent span {
  display: block;
  line-height: 1.35;
}

.consent input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  border: 2px solid rgba(13, 59, 102, 0.45);
  background: #fff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  flex: 0 0 16px;
  box-sizing: border-box;
}

.consent input[type="checkbox"]::after {
  content: "";
  width: 4px;
  height: 8px;
  border-right: 2px solid #0d3b66;
  border-bottom: 2px solid #0d3b66;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform 140ms ease;
}

.consent input[type="checkbox"]:checked::after {
  transform: rotate(45deg) scale(1);
}

.consent input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(13, 59, 102, 0.25);
  outline-offset: 3px;
}

.content-4 input,
.content-4 textarea,
.content-4 button {
  box-sizing: border-box;
}

.content-4 .consent,
.content-4 .btn {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

@media (max-width: 768px) {
  :root {
    --fs-body: 0.95rem;
  }

  h2 {
    margin-bottom: 0.4rem;
  }

  .logo-overlay {
    display: none;
  }

  .logo-mobile {
    width: 120px;
    height: 120px;
    display: block;
    margin: 14px auto 18px auto;
  }

  .content {
    align-items: center;
    text-align: center;
    padding: 18px 16px;
    min-height: 100%;
  }

  .content p {
    margin: 0 20px 12px 20px;
    line-height: 1.5;
    font-size: 1rem;
  }

  .content h1 {
    margin: 6px 0 14px 0;
    line-height: 1.15;
    font-size: 1.8rem;
    letter-spacing: -0.01em;
    text-wrap: balance;
  }

  .content-1 h1 {
    padding-left: 0;
    padding-right: 0;
    font-size: 1.5rem;
    text-align: center;
  }

  .content ul {
    margin-top: 0.5rem;
    padding-left: 18px;
  }

  .content ul li {
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 8px;
  }

  form {
    gap: 10px;
  }

  textarea {
    min-height: 120px;
  }

  .content-4 {
    height: 100%;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 24px;
    padding-bottom: 0;
  }

  .content-4 h1 {
    font-size: 1.6rem;
    margin-bottom: 6px;
    line-height: 1.2;
  }

  .content-4 h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    line-height: 1.3;
    color: var(--color-muted);
  }

  .content-4 input[type="text"],
  .content-4 input[type="email"],
  .content-4 input[type="tel"] {
    height: 44px;
    font-size: 1rem;
    padding: 10px 12px;
  }

  .content-4 textarea {
    min-height: 100px;
    font-size: 1rem;
    padding: 10px 12px;
  }

  .content-4 .consent {
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 10px;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
  }

  .content-4 .consent span {
    display: block;
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .content-4 .consent input[type="checkbox"] {
    margin-top: 0;
    flex-shrink: 0;
  }

  .content-4 .btn {
    min-height: 48px;
    font-size: 1rem;
  }

  #form-status {
    min-height: 20px;
    font-size: 0.9rem;
  }

  .content-4 form,
  .content-4 #contact-form {
    width: min(560px, 100%);
    max-height: 100%;
    overflow: auto;
    padding-bottom: 24px;
  }

  footer {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 390px) {
  .content ul li {
    font-size: 0.9rem;
  }
}
