/* KM Contact Form basic styling */
.kmcf-form {
  max-width: 900px;
  margin: 0 auto 4rem;
  padding: 2.5rem 2rem 3rem;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 40px 80px rgba(0,0,0,0.04);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

.kmcf-field {
  margin-bottom: 1.4rem;
}

.kmcf-field label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
  color: #555;
}

.kmcf-form input[type="text"],
.kmcf-form input[type="email"],
.kmcf-form input[type="number"],
.kmcf-form textarea {
  width: 100%;
  border-radius: 999px;
  border: 1px solid #eaecf0;
  padding: 0.9rem 1.3rem;
  font-size: 0.95rem;
  background: #f7f8fa;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
}

.kmcf-form textarea {
  border-radius: 24px;
  min-height: 160px;
  resize: vertical;
}

.kmcf-form input:focus,
.kmcf-form textarea:focus {
  border-color: #111827;
  background: #ffffff;
  box-shadow: 0 0 0 1px #1118271a;
}

/* Email confirm status dot + check / cross */
.kmcf-field--email-confirm .kmcf-email-confirm-wrapper {
  position: relative;
}

.kmcf-email-status {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* states via JS */
.kmcf-email-status--match {
  background: #16a34a;
  color: #fff;
}

.kmcf-email-status--mismatch {
  background: #dc2626;
  color: #fff;
}

/* simple icons using pseudo check / cross */
.kmcf-email-status--match::before {
  content: "✓";
}
.kmcf-email-status--mismatch::before {
  content: "✕";
}

/* Spam field */
.kmcf-field--spam .kmcf-spam-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kmcf-spam-question {
  font-size: 0.95rem;
  color: #374151;
}

/* Alerts */
.kmcf-alert {
  max-width: 900px;
  margin: 1rem auto 2rem;
  padding: 0.9rem 1.4rem;
  border-radius: 16px;
  font-size: 0.95rem;
}

.kmcf-alert-error {
  background: #fee2e2;
  color: #7f1d1d;
}

.kmcf-alert-error ul {
  margin: 0;
  padding-left: 1.1rem;
}

.kmcf-alert-success {
  background: #dcfce7;
  color: #14532d;
}

/* Floating success like booking popup */
.kmcf-alert-success--floating {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

/* icon circle */
.kmcf-alert-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #16a34a;
  display: inline-block;
  position: relative;
}

.kmcf-alert-icon::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
}

/* Submit button + spinner */
.kmcf-actions {
  margin-top: 2rem;
}

.kmcf-submit {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  background: #020617;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.kmcf-submit:hover {
  background: #020617;
  box-shadow: 0 18px 35px rgba(15,23,42,0.35);
  transform: translateY(-1px);
}

.kmcf-submit:active {
  transform: translateY(0);
  box-shadow: none;
}

/* spinner */
.kmcf-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  animation: kmcf-spin 0.8s linear infinite;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.kmcf-submit--loading .kmcf-spinner {
  opacity: 1;
  transform: scale(1);
}

.kmcf-submit--loading .kmcf-submit-label {
  opacity: 0.7;
}

@keyframes kmcf-spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .kmcf-form {
    margin: 1.5rem 1rem 3rem;
    padding: 1.7rem 1.4rem 2.5rem;
    border-radius: 22px;
  }
  .kmcf-alert, .kmcf-alert-success--floating {
    max-width: calc(100% - 2rem);
  }
}
/* === km-contact-form 1.4.3 – layout fixes === */

/* Wrapper: se till att allt är centrerat och inte sticker ut till höger */
.kmcf-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}
/* Se till att alla inputs följer kortets bredd */
.kmcf-field input,
.kmcf-field textarea {
    width: 100%;
    box-sizing: border-box;
}
/* Layout för spamkontroll-raden */
.kmcf-field--spam .kmcf-spam-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 260px;   /* totalt utrymme för fråga + input */
}

/* Själva spam-inputen blir smal */
.kmcf-field--spam .kmcf-spam-row input {
    flex: 0 0 120px;    /* justera till 100–140px efter smak */
}
/* Begränsa bredden på spamkontrollen på desktop */
@media (min-width: 768px) {
    .kmcf-form input[name="kmcf_spam_answer"] {
        max-width: 220px;
        width: 100%;
        margin-left: 0;
    }
}
