/* ===========================
   Modal Background & Box
   =========================== */
.modal {
  display: none; /* hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0; 
  top: 0;
  width: 100%; 
  height: 100%;
  background-color: rgba(0,0,0,0.6);
}

.modal-content {
  background: #f4f4f4;
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  width: 600px;
  max-width: 90%;
  position: relative;
}

/* ===========================
   Header
   =========================== */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: #0099cc;
  text-align: center; /* corrected property */
}

.close {
  font-size: 34px;
  cursor: pointer;
  color: #0099cc; /* default color */
  transition: color 0.3s ease;
}

.close:hover {
  color: #ff3333; /* hover color */
}

/* ===========================
   Form Layout
   =========================== */
#sampleForm {
  display: grid;
  grid-template-columns: 1fr 1fr; /* two equal columns */
  grid-template-areas:
    "company   whatsapp"
    "name      details"
    "s_email   details"
    "phone     details"
    "submit    submit";
  gap: 20px;
  box-sizing: border-box;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.group-company  { grid-area: company; }
.group-whatsapp { grid-area: whatsapp; }
.group-name     { grid-area: name; }
.group-details  { grid-area: details; }
.group-email    { grid-area: s_email; }
.group-phone    { grid-area: phone; }

.group-details textarea {
  min-height: 148px; /* fixed height */
  resize: none;      /* prevent manual resize */
}


/* ===========================
   Inputs & Labels
   =========================== */
#sampleForm label {
  margin-top: 10px;
  color: #666666;
}

#sampleForm input,
#sampleForm textarea {
  padding: 8px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline: none; /* remove default black outline */
}

/* Focus state */
#sampleForm input:focus,
#sampleForm textarea:focus {
  border-color: #0099cc;   /* highlight color */
  box-shadow: 0 0 4px rgba(0,153,204,0.4);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ===========================
   Submit Button
   =========================== */
.form-submit {
  grid-area: submit;
  display: flex;
  justify-content: center;
}

#sampleForm button {
  padding: 10px 20px;
  background: #0099cc;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  width: 170px;
  transition: background 0.3s ease;
}

#sampleForm button:hover {
  background: #0077aa;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.modal.fade-out {
  animation: fadeOut 0.5s forwards;
}


/* ===========================
   Loading spinner
   =========================== */
.spinner {
  border: 6px solid #f3f3f3; /* light grey */
  border-top: 6px solid #0099cc; /* brand color */
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* ===========================
   Responsive
   =========================== */
@media (max-width: 640px) {
  #sampleForm {
    grid-template-columns: 1fr;
    grid-template-areas:
      "company"
      "whatsapp"
      "name"
      "details"
      "email"
      "phone"
      "submit";
  }
}