/* === Base Styles === */
body {
  font-family: 'Merriweather', serif;
  font-size: 18px;
  line-height: 1.7;
  background: #f4e6d7;
  color: #333;
}

h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: 32px;
  margin-bottom: 30px;
}

a {
  color: #f5f0ec;
}

/* === Fields Section === */
.modal-form input[type="text"],
.modal-form input[type="tel"],
.modal-form input[type="email"],
.modal-form input[type="number"],
.modal-form input[type="date"] {
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  margin-top: 0.25rem;
}

.fieldset {
  border: none;
  margin-bottom: 1rem;
}

.radio-group {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.checkbox-label input {
  margin-right: 0.5rem;
}

/* === Header Section === */
.header {
  position: relative;
  height: 100vh;

  background: url('../media/img/background.png') center/cover no-repeat;
  background-color: #f7d8a4;
  overflow: hidden;
}

.header-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  z-index: 2;

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logo {
  max-width: calc(600px - (1900px - 100vw) / 10);
  height: auto;
  margin-bottom: 1rem;
}

.button {
  position: relative;
  z-index: 10;
}

.d-man, .d-woman { 
  position: absolute;
  bottom: 0;
  max-height: 95vh;
  height: 95vh;
}

.d-man {
  right: calc(-5vw + 20px);
}

.d-woman {
  left: calc(-5vw + 20px);
}

.d-man,
.d-woman {
  max-height: calc(80vh - (1500px - 100vw) / 10);
}

.d-man {
  right: calc(-4vw - (1500px - 100vw) / 5);
}

.d-woman {
  left: calc(-4vw - (1500px - 100vw) / 5);
}

/* === Buttons === */
.button,
.pay-button {
  background-color: #224066;
  color: white;
  font-size: 16px;
  padding: 14px 28px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.button:hover,
.pay-button:hover {
  background-color: #274db3;
  transform: scale(1.05);
}

.button-group {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

/* === Sections === */
.section {
  padding: 60px 20px;
  background-color: #f0f0f0;
  text-align: center;
}

.section h2 {
  font-size: 28px;
  margin-bottom: 40px;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  color: #333;
  margin: 0 auto 40px;
  text-align: center;
}

.pay-section,
.rights-section,
.features-section {
  padding: 40px 20px;
  text-align: center;
}

.features-section {
  background-color: #faeddb;
}

.rights-section {
  background-color: #224066;
}

.pay-section-text,
.features-text {
  max-width: 600px;
  margin: 0 auto 2rem;
  font-size: 1.125rem;
  line-height: 1.5;
}

/* === Features === */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  max-width: 900px;
  margin: 0 auto 50px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 20px;
}

.feature-icon {
  width: 32px;
  height: 32px;
  margin-top: 5px;
}

.feature-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.feature-title {
  font-size: 24px;
  font-weight: 700;
  color: #222;
}

.feature-subtitle {
  text-align: left;
  font-size: 18px;
  color: #666;
}

/* === Social Buttons === */
.social-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal {
  background: #f7f2e7;
  border-radius: 8px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-title {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 9995;
}

.modal-close:hover {
  transform: scale(1.1);
}

.modal-form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.modal-ref {
    color: black;
}

.modal-form input[type="text"],
.modal-form input[type="tel"],
.modal-form input[type="email"],
.modal-form input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  margin-top: 1rem;
}

.checkbox-label {
  font-size: 0.9rem;
  margin-top: 10px;
}

.checkbox-label input {
  margin-right: 8px;
}

.pay-button {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  margin-top: 1.5rem;
}

/* QR-code */

.qr-wrapper {
  position: fixed; /* фиксируем по экрану */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 350px;
  height: 325px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  overflow: hidden;
  transition: height 0.8s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 25px; /* фиксируем верхний отступ для QR */
  z-index: 9990; /* поверх всего остального контента */
}

.qr-code {
  max-width: 300px;
  transition: filter 0.8s ease, transform 0.8s ease;
}

.status-text {
  margin-top: auto; /* прижимается к низу блока */
  margin-bottom: 20px;
  opacity: 0;
  font-size: 22px;
  font-weight: bold;
  transform: translateY(20px);
  transition: opacity 1s ease, transform 1s ease;
}

/* Анимации */
.qr-wrapper.animate {
  height: 375px;
}

.qr-wrapper.animate .qr-code {
  filter: blur(6px);
}

.qr-wrapper.animate .status-text {
  opacity: 1;
  transform: translateY(0);
}


/* === Footer === */
footer {
  position: relative;
  padding: 20px 40px;
  background: #f7f7f7;
  font-size: 14px;
  height: 120px; /* или нужная высота */
}

footer .left {
  position: absolute;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 30px;
  font-weight: 700;
  color: #f5f0ec;
}

footer .center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 15px;
  font-weight: 700;
  color: #f5f0ec;
  text-align: center;
  white-space: nowrap;
}

footer .icons {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 10px;
}

footer .icons img {
  width: 34px;
  height: 34px;
  cursor: pointer;
  transition: transform 0.2s;
}

footer .icons img:hover {
  transform: scale(1.2);
}

footer .icons img:hover {
  transform: scale(1.2);
}

/* === Loader Overlay === */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loader-message {
  background: white;
  padding: 20px 30px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

@media (max-width: 1024px) {
  .features {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 600px;
  }

  .logo,
  .footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .section h2,
  .section p,
  .form-group input,
  .form-group label {
    font-size: 1rem;
  }

  .modal-content {
    width: 90%;
    padding: 1rem;
  }

  .pay-button {
    font-size: 1rem;
    padding: 12px 24px;
  }
}

@media (max-width: 768px) {
  .features {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .feature-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
  }

  body {
    font-size: 14px;
  }

  .header {
    background-position: right;
  }

  .header-content {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);

    z-index: 2;

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .logo {
    max-width: 450px;
    width: 90vw;
    height: auto;
    margin-bottom: 1;
    display: block;
  }


  .d-man, .d-woman { 
    position: absolute;
    left: 50%; /* центрируем по горизонтали */
    transform: translateX(-50%); /* сдвигаем ровно на половину ширины влево, чтобы центрировать элемент */
    bottom: 0;
    max-height: calc(73vh - (1500px - 100vw) / 10);
    height: 95vh;
  }

  .d-man {
    transform: translateX(calc(-50% + 150vh / 10 + 30vw / 10));
  }

  .d-woman {
    transform: translateX(calc(-50% - 150vh / 10 - 30vw / 10)); /* влево */
  }

  .section h2 {
    font-size: 1.25rem;
  }

  .footer p {
    font-size: 0.9rem;
  }

  footer {
    height: auto;
    padding: 20px;
  }

  footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  footer .left,
  footer .center,
  footer .icons {
    position: static;
    transform: none;
    text-align: center;
    white-space: normal;
  }
}

.error-message {
    max-width: 600px;
    text-align: left;
}

#errorDetails {
    margin: 15px 0;
    padding: 10px;
  
    font-family: monospace;
    font-size: 12px;

    white-space: pre-wrap;
    word-break: break-word;

    max-height: 300px;
    overflow-y: auto;

    background: rgba(0,0,0,0.05);
    border-radius: 8px;
}