/* ========================================
   Core Engine — Isolated Form Styles
   Префикс: core-
   ======================================== */

/* --- Modal --- */
.core-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  box-sizing: border-box;
}

.core-modal-window {
  background-color: #ffffff;
  padding: 32px;
  border-radius: 12px;
  max-width: 440px;
  width: 100%;
  position: relative;
  box-sizing: border-box;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.core-modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.core-modal-close-btn:hover { color: #374151; }

/* --- Form layout --- */
.core-form-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.core-form-title {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.core-form-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 8px 0;
}

.core-form-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  
}

.core-form-label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.core-form-input,
.core-form-textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.4;
  box-sizing: border-box;
  background-color: #ffffff;
  color: #111827;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#profiles input,
#cottage-phone,
#loggia-phone,
#balcony-phone {
  padding: 15px 14px;
}




.core-form-input:focus,
.core-form-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.core-form-input.core-field-has-error,
.core-form-textarea.core-field-has-error {
  border-color: #dc2626 !important;
}

.core-form-input.core-field-has-error:focus,
.core-form-textarea.core-field-has-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* --- Error message --- */
.core-field-error-msg {
  position: absolute;
  bottom: -20px;
  left: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #dc2626;
  animation: coreFormSlideUp 0.2s ease forwards;
  white-space: nowrap;
}

/* --- Submit button --- */
.core-form-submit-btn {
  background-color: #ff6b35;
  color: #ffffff;
  padding: 16px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.core-form-submit-btn:hover:not(:disabled) { background-color: #e55a2b; }

.core-form-submit-btn:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

/* --- Success screen --- */
.core-form-success-screen {
  text-align: center;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background-color: #f0fdf4;
  border-radius: 12px;
  border: 1px solid #bbf7d0;
  animation: coreFormSlideUp 0.3s ease forwards;
}

.core-form-success-icon {
  width: 64px;
  height: 64px;
  background-color: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: coreFormCheckBounce 0.5s ease forwards;
}

.core-form-success-icon svg {
  width: 32px;
  height: 32px;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  animation: coreFormCheckDraw 0.4s ease 0.2s forwards;
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
}

.core-form-success-screen h3 {
  font-size: 22px;
  font-weight: 700;
  color: #166534;
  margin: 0;
}

.core-form-success-screen p {
  font-size: 15px;
  color: #15803d;
  margin: 0;
}

/* --- Error screen --- */
.core-form-error-screen {
  text-align: center;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background-color: #fef2f2;
  border-radius: 12px;
  border: 1px solid #fecaca;
  animation: coreFormSlideUp 0.3s ease forwards;
}

.core-form-error-icon {
  width: 64px;
  height: 64px;
  background-color: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.core-form-error-icon svg {
  width: 32px;
  height: 32px;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.core-form-error-screen h3 {
  font-size: 22px;
  font-weight: 700;
  color: #991b1b;
  margin: 0;
}

.core-form-error-screen p {
  font-size: 15px;
  color: #b91c1c;
  margin: 0;
}

.core-form-error-screen button {
  margin-top: 8px;
  padding: 10px 20px;
  background-color: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.core-form-error-screen button:hover {
  background-color: #dc2626;
}

/* --- Animations --- */
@keyframes coreFormCheckBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes coreFormCheckDraw {
  to { stroke-dashoffset: 0; }
}

/* --- Privacy Modal --- */
.privacy-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  box-sizing: border-box;
}

.privacy-modal-window {
  background-color: #ffffff;
  padding: 32px;
  border-radius: 12px;
  max-width: 680px;
  width: 100%;
  position: relative;
  box-sizing: border-box;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  max-height: 90vh;
  overflow-y: auto;
}

.privacy-modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.privacy-modal-close-btn:hover { color: #374151; }

.privacy-modal-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.privacy-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0;
  padding-right: 30px;
}

.privacy-modal-body {
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
}

.privacy-modal-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin-top: 12px;
  margin-bottom: 6px;
}

.privacy-modal-overlay.hidden {
  display: none;
}

/* --- Utility --- */
.core-utility-hidden {
  display: none !important;
}

/* --- Animation --- */
@keyframes coreFormSlideUp {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Promo Popup --- */
.promo-popup-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  box-sizing: border-box;
}

.promo-popup-window {
  background-color: #ffffff;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  position: relative;
  box-sizing: border-box;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.promo-popup-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  color: #374151;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 8px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background-color 0.15s ease;
}
.promo-popup-close-btn:hover { background-color: #ffffff; color: #111827; }

.promo-popup-image {
  width: 100%;
  height: auto;
  display: block;
}

.promo-popup-content {
  padding: 24px;
}

.promo-popup-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px 0;
}

.promo-popup-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 16px 0;
}

.promo-popup-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.promo-popup-overlay.hidden {
  display: none;
}
