/* ============================================================
   IMB Digital — Contact Form Plugin
   style.css
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=DM+Sans:wght@300;400;500&display=swap');

/* ---- WRAPPER ---- */
#imb-contact-wrap {
  font-family: 'DM Sans', system-ui, sans-serif;
  max-width: 1000px;
  margin: 2rem auto;
}

.imb-cf__inner {
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(11,27,61,0.14);
}

/* ---- FORM HEADER ---- */
.imb-cf__form-header {
  background: linear-gradient(135deg, #0b1b3d 0%, #1550d4 60%, #0d9a8a 100%);
  padding: 2.5rem 3rem;
  text-align: center;
}

.imb-cf__title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: white;
  margin: 0 0 0.6rem;
  line-height: 1.15;
}

.imb-cf__sub {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
  margin: 0;
  max-width: 500px;
  margin: 0 auto;
}

/* ---- FORM PANEL (full width) ---- */
.imb-cf__form-panel {
  padding: 2.8rem 3rem;
}

.imb-cf__form-panel form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
}

.imb-cf__form-panel .imb-cf__field:nth-child(5),
.imb-cf__form-panel .imb-cf__field:nth-child(6) {
  grid-column: span 2;
}

.imb-cf__form-panel button[type="submit"] {
  grid-column: span 2;
}

/* ---- FIELDS ---- */
.imb-cf__field {
  margin-bottom: 1.4rem;
}

.imb-cf__field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.45rem;
  letter-spacing: 0.02em;
}

.imb-req { color: #1550d4; }

.imb-cf__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.imb-cf__input-icon {
  position: absolute;
  left: 13px;
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
  line-height: 1;
}

.imb-cf__input-wrap input,
.imb-cf__input-wrap select {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.7rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  color: #1e293b;
  background: #f8fafc;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.imb-cf__input-wrap input:focus,
.imb-cf__input-wrap select:focus {
  outline: none;
  border-color: #1550d4;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(21,80,212,0.08);
}

.imb-cf__input-wrap input.imb-invalid,
.imb-cf__input-wrap select.imb-invalid,
textarea.imb-invalid {
  border-color: #ef4444;
  background: #fef2f2;
}

.imb-cf__select-wrap .imb-cf__chevron {
  position: absolute;
  right: 14px;
  font-size: 0.75rem;
  color: #94a3b8;
  pointer-events: none;
}

/* TEXTAREA */
.imb-cf__field textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  color: #1e293b;
  background: #f8fafc;
  resize: vertical;
  min-height: 110px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.imb-cf__field textarea:focus {
  outline: none;
  border-color: #1550d4;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(21,80,212,0.08);
}

.imb-cf__char-count {
  display: block;
  text-align: right;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.3rem;
}

/* ERRORS */
.imb-cf__error {
  display: block;
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 0.3rem;
  min-height: 1em;
  font-weight: 500;
}

/* ---- SUBMIT BUTTON ---- */
.imb-cf__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #1550d4, #0d9a8a);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(21,80,212,0.28);
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
}

.imb-cf__btn:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(21,80,212,0.32);
}

.imb-cf__btn:active { transform: none; }

.imb-cf__btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.imb-cf__btn-arrow {
  transition: transform 0.2s;
  font-size: 1.1rem;
}

.imb-cf__btn:hover .imb-cf__btn-arrow { transform: translateX(4px); }

/* Loading spinner inside button */
.imb-cf__btn.loading .imb-cf__btn-text::after {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: white;
  border-radius: 50%;
  animation: imb-spin 0.7s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

.imb-cf__btn.loading .imb-cf__btn-arrow { display: none; }

@keyframes imb-spin { to { transform: rotate(360deg); } }

/* ---- SUCCESS ---- */
.imb-cf__success {
  text-align: center;
  padding: 3rem 2rem;
  animation: imb-fadeUp 0.5s ease both;
}

@keyframes imb-fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

.imb-cf__success-icon { font-size: 3.5rem; margin-bottom: 1rem; }

.imb-cf__success h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0b1b3d;
  margin-bottom: 0.5rem;
}

.imb-cf__success p {
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.imb-cf__btn-again {
  background: transparent;
  border: 2px solid #1550d4;
  color: #1550d4;
  padding: 0.65rem 1.8rem;
  border-radius: 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}

.imb-cf__btn-again:hover { background: #1550d4; color: white; }

/* ---- SERVER ERROR ---- */
.imb-cf__server-error {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  color: #dc2626;
  font-size: 0.88rem;
  margin-top: 1rem;
  text-align: center;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 700px) {
  .imb-cf__inner { border-radius: 16px; }
  .imb-cf__form-header { padding: 2rem 1.5rem; }
  .imb-cf__form-panel { padding: 1.8rem 1.5rem; }
  .imb-cf__form-panel form { grid-template-columns: 1fr; }
  .imb-cf__form-panel .imb-cf__field:nth-child(5),
  .imb-cf__form-panel .imb-cf__field:nth-child(6) { grid-column: span 1; }
  .imb-cf__form-panel button[type="submit"] { grid-column: span 1; }
}
