:root {
  --allty-blue-icn: #00197e;
}

body.theme-dark {
  --allty-blue-icn: #000000;
}
body.theme-yellow,
body.theme-cyan,
body.theme-red {
  --allty-blue-icn: #ffffff;
}
body.theme-dark .contact-form-card button {
  border: 1px solid #ffffff;
  background-color: #000000;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Roboto", sans-serif;
}

/* --- Wrapper & Section --- */
.form-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 100px; /* Light grey outside the wrapper */
}

.form-wrapper-container {
  width: 100%;
  max-width: 1240px;
  margin: 50px 50px;
  background-color: var(--blue-bg);
  display: flex;
  justify-content: center;
}

.contact-layout {
  display: flex;
  width: 88%;
  justify-content: space-between;
  align-items: flex-start;
  transform: translateY(100px);
}

/* --- Left Side: Contact Details --- */
.contact-info {
  flex: 1;
  color: var(--white-text);
}

.contact-info h2 {
  font-weight: 700;
  margin-bottom: 12px;
}

.contact-info .subtitle {
  margin-bottom: 36px;
  opacity: 0.9;
}

.info-item {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  font-size: 1.112rem;
}

.info-item .icon {
  background-color: var(--white-text);
  color: var(--allty-blue-icn);
  width: 50px;
  height: 50px;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 17px;
  flex-shrink: 0;
}

/* --- Right Side: The Form Card --- */
.contact-form-card {
  flex: 1.1;
  background: var(--standerd-white);
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--blue-border);
}

.contact-form-card h2 {
  margin-bottom: 18px;
}

.contact-form-card h2 span {
  color: var(--alltyDark-blue-yellow); /* Azure/Light blue for "Touch" */
}

.contact-form-card label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 18px;
}

.contact-form-card input,
.contact-form-card textarea {
  font-size: 18px;
  height: 56px;
  width: 100%;
  padding: 22px 12px;
  border: 1px solid #b3b3b3;
  border-radius: 8px;
  margin-bottom: 25px;
  outline: none;
  transition: border-color 0.2s;
}

.contact-form-card input:focus,
.contact-form-card textarea:focus {
  border-color: #041982;
}

/* Name row: Split fields */
.two-field {
  display: flex;
  gap: 20px;
}

.contact-form-card textarea {
  height: 130px;
  resize: none;
}

/* --- Dynamic Warning Message (Speech Bubble) --- */
.error-message {
  display: none; /* Controlled by JS */
  align-items: center;
  background-color: #fff1f1;
  color: #b00020;
  border: 1px solid #b00020;
  border-left: 4px solid #b00020;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 16px;
  width: fit-content;
  margin-top: -19px; /* Positioned right below input */
  margin-bottom: 18px;
  position: relative;
}

/* The Warning Icon (Red Circle) */
.error-message::before {
  content: "!";
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #b00020;
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-right: 5px;
  font-size: 16px;
  top: 1px;
  font-weight: bold;
}

/* The Speech Bubble Arrow pointing UP */
.error-message::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 18px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #b00020;
}

/* Input state for errors */
input.invalid {
  border: 1px solid #b00020 !important;
}

/* --- Submit Button --- */
.contact-form-card button {
  background-color: #041982;
  color: white;
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.1s,
    background 0.3s;
}

.contact-form-card button:active {
  transform: scale(0.98);
}

.popup-overlay {
  position: fixed; /* Stays in place even if scrolled */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 9999;

  /* Flexbox used to center the popup box perfectly */
  display: flex;
  justify-content: center;
  align-items: center;

  /* Initial state used for animation (hidden) */
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

/* The active class used by JS to show the popup */
.popup-overlay.active {
  opacity: 1 !important;
  visibility: visible;
}

/* 2. The Popup Box itself */
.popup-box {
  background-color: #ffffff;
  width: 80%; /* Responsive width */
  height: auto;
  max-width: 790px; /* Maximum width similar to image dimensions */
  border-radius: 20px; /* Rounded corners */
  padding: 38px 52px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  transform: scale(0.9); /* Start slightly smaller for animation */
  transition: transform 0.3s ease;
}

/* Animation for the box popping in */
.popup-overlay.active .popup-box {
  transform: scale(1);
}

/* 3. Image Placeholder Styling */
.image-container-div {
  display: flex;
  justify-content: center;
  margin-bottom: clamp(24px, 3.4vw, 50px);
}

.image-placeholder-circle {
  border-radius: 50%; /* Makes it a perfect circle */
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-placeholder-circle img {
  display: block;
  width: clamp(130px, 14.4vw, 208px);
  height: auto;
}

/* 4. Text Styling */
.content-div span {
  color: #00197e; /* Dark blue color */
  font-size: 3.556rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.paragraph-text-div {
  font-size: clamp(16px, 2.85vw, 18px);
  line-height: 32px;
  margin-bottom: 24px;
}

/* 5. Button Styling */
.button-container-div {
  display: flex;
  justify-content: center;
}

.continue-button {
  background-color: #00197e; /* Match heading color */
  color: white;
  border: none;
  padding: 15px 80px;
  font-size: 18px;
  font-weight: 500;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.continue-button:hover {
  background-color: #2a2a70; /* Slightly lighter on hover */
}

@media (max-width: 1200px) {
  .contact-layout {
    width: 92%;
  }
}

@media (max-width: 1024.98px) {
  .form-container {
    margin-bottom: 120px;
  }
  .form-wrapper-container {
    max-height: 955px;
  }
  .contact-layout {
    width: 100%;
    align-items: center;
    flex-direction: column;
    gap: 50px;
    transform: none;
  }
  .contact-info {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
  }
  .contact-form-card {
    width: 90%;
    max-width: 100%;
  }
}

@media (max-width: 1024.98px) {
  .form-wrapper-container {
    margin: 50px 40px;
    padding: 40px 36px;
  }
  .contact-form-card {
    width: 100%;
  }
  .heading-box h2 {
    font-size: 2.286rem;
  }
  .heading-box p {
    font-size: 1.286rem;
  }
  .popup-box {
    padding: 26px 36px;
  }
  .paragraph-text-div {
    max-width: 478px;
    margin: 0 auto;
    margin-bottom: 24px;
  }
}
/* --- Responsiveness (640px Screen) --- */
@media screen and (max-width: 767.98px) {
  .form-wrapper-container {
    margin: 36px 24px;
    padding: 30px 16px;
  }
  .form-container {
    margin-bottom: 210px;
  }
  .two-field {
    flex-direction: column;
    gap: 0;
  }
  .contact-info {
    align-items: center;
    flex-direction: column;
  }
  .heading-box h2 {
    font-size: 2.5rem;
  }
  .contact-info .subtitle {
    margin-bottom: 16px;
    font-size: 1.333rem;
  }
  .contact-form-card {
    padding: 14px;
  }
  .contact-layout {
    gap: 32px;
  }
  .popup-box {
    padding: 32px;
  }
  .info-item {
    font-size: 1.333rem;
  }
}

@media (max-width: 424px) {
  .popup-box {
    width: 90%;
  }
}

@media (max-width: 340px) {
  .form-container {
    margin-bottom: 340px;
  }
}

@media (max-width: 270px) {
  .form-container {
    margin-bottom: 380px;
  }
}
