/* =========================================================
   WildMagPro — Built-in Contact Form Styles  v6
   Light-first defaults matching the white-card theme shown
   in screenshots. Dark mode handled via body class.
   ========================================================= */

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

/* --- CSS Custom Properties — Light defaults --- */
:root {
  --wmp-cf-accent:      #e84118;
  --wmp-cf-accent-dark: #c0330f;
  --wmp-cf-bg:          #f8f8f8;      /* input field bg  */
  --wmp-cf-surface:     #ffffff;      /* card bg          */
  --wmp-cf-border:      #e0e0e0;
  --wmp-cf-text:        #1a1a1a;
  --wmp-cf-muted:       #888;
  --wmp-cf-label:       #444444;
  --wmp-cf-radius:      6px;
  --wmp-cf-font:        'Outfit', -apple-system, sans-serif;
  --wmp-cf-transition:  all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode override via WordPress body class */
body.dark-mode .wmp-cf-wrapper,
.dark-mode .wmp-cf-wrapper {
  --wmp-cf-bg:      #111111;
  --wmp-cf-surface: #1e1e1e;
  --wmp-cf-border:  #2e2e2e;
  --wmp-cf-text:    #e0e0e0;
  --wmp-cf-muted:   #888;
  --wmp-cf-label:   #cccccc;
}

/* =========================================================
   WRAPPER
   ========================================================= */
.wmp-cf-wrapper {
  font-family: var(--wmp-cf-font);
  margin: 0 0 2.5rem;
  scroll-margin-top: 80px;
}

/* =========================================================
   HEADER (optional title/subtitle via shortcode attrs)
   ========================================================= */
.wmp-cf-header {
  margin-bottom: 2rem;
}
.wmp-cf-title {
  font-family: var(--wmp-cf-font);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--wmp-cf-text);
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}
.wmp-cf-subtitle {
  font-size: 0.95rem;
  color: var(--wmp-cf-muted);
  margin: 0;
  line-height: 1.6;
}

/* =========================================================
   CONTAINER
   ========================================================= */
.wmp-cf-container {
  background: var(--wmp-cf-surface);
  border: 1px solid var(--wmp-cf-border);
  border-radius: 10px;
  padding: 1.4rem 1.6rem 1.4rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 30px rgba(0,0,0,.08), 0 1px 6px rgba(0,0,0,.04);
}

/* Top decorative accent bar */
.wmp-cf-decorative-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--wmp-cf-accent) 0%, var(--wmp-cf-accent-dark) 60%, transparent 100%);
}

/* Subtle texture overlay */
.wmp-cf-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.015'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}
.wmp-cf-form {
  position: relative;
  z-index: 1;
}

/* =========================================================
   ROWS
   ========================================================= */
.wmp-cf-row {
  margin-bottom: 0.9rem;
}
.wmp-cf-row--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.wmp-cf-row--submit {
  margin-top: 1rem;
  margin-bottom: 0;
}

@media (max-width: 560px) {
  .wmp-cf-row--split {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }
  .wmp-cf-container {
    padding: 1.8rem 1.2rem 1.6rem;
  }
}

/* =========================================================
   FIELD + LABELS
   ========================================================= */
.wmp-cf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wmp-cf-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wmp-cf-label);
  display: flex;
  align-items: center;
  gap: 4px;
}
.wmp-required {
  color: var(--wmp-cf-accent);
  font-size: 1em;
  line-height: 1;
}
.wmp-optional {
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--wmp-cf-muted);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 2px;
}

/* =========================================================
   INPUT WRAP + ICON
   ========================================================= */
.wmp-cf-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.wmp-cf-icon {
  position: absolute;
  left: 14px;
  color: var(--wmp-cf-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: var(--wmp-cf-transition);
  z-index: 1;
}
.wmp-cf-icon--top {
  top: 14px;
  align-items: flex-start;
}

/* =========================================================
   INPUTS
   ========================================================= */
.wmp-cf-input {
  width: 100%;
  background: var(--wmp-cf-bg);
  border: 1px solid var(--wmp-cf-border);
  border-radius: var(--wmp-cf-radius);
  color: var(--wmp-cf-text);
  font-family: var(--wmp-cf-font);
  font-size: 0.9rem;
  font-weight: 400;
  padding: 12px 14px 12px 42px;
  outline: none;
  transition: var(--wmp-cf-transition);
  -webkit-appearance: none;
  appearance: none;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.06);
}
.wmp-cf-input::placeholder {
  color: var(--wmp-cf-muted);
  opacity: 0.7;
}
.wmp-cf-input:hover {
  border-color: #bbb;
}
.wmp-cf-input:focus {
  border-color: var(--wmp-cf-accent);
  box-shadow: 0 0 0 3px rgba(232, 65, 24, 0.10), inset 0 1px 3px rgba(0,0,0,.06);
  background: var(--wmp-cf-bg);
}
.wmp-cf-input:focus + .wmp-cf-line,
.wmp-cf-input:focus ~ .wmp-cf-line {
  transform: scaleX(1);
  opacity: 1;
}
.wmp-cf-field:focus-within .wmp-cf-icon {
  color: var(--wmp-cf-accent);
}

/* Animated focus underline */
.wmp-cf-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--wmp-cf-accent);
  border-radius: 0 0 var(--wmp-cf-radius) var(--wmp-cf-radius);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}

/* Error state */
.wmp-cf-input.wmp-has-error {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.10);
}

/* =========================================================
   TEXTAREA
   ========================================================= */
.wmp-cf-textarea-wrap {
  align-items: flex-start;
}
.wmp-cf-textarea {
  resize: vertical;
  min-height: 90px;
  padding-top: 14px;
  padding-bottom: 32px;
  line-height: 1.6;
}
.wmp-cf-char-count {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 0.72rem;
  color: var(--wmp-cf-muted);
  pointer-events: none;
  font-family: var(--wmp-cf-font);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.wmp-cf-char-count.wmp-over {
  color: #e74c3c;
  font-weight: 600;
}

/* =========================================================
   SELECT
   ========================================================= */
.wmp-cf-select-wrap {
  position: relative;
}
.wmp-cf-select {
  cursor: pointer;
  padding-right: 40px;
}
.wmp-cf-select option {
  background: var(--wmp-cf-surface);
  color: var(--wmp-cf-text);
}
.wmp-cf-select-arrow {
  position: absolute;
  right: 14px;
  color: var(--wmp-cf-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  transition: var(--wmp-cf-transition);
}
.wmp-cf-field:focus-within .wmp-cf-select-arrow {
  color: var(--wmp-cf-accent);
  transform: rotate(180deg);
}

/* =========================================================
   ERROR MESSAGE
   ========================================================= */
.wmp-cf-error {
  font-size: 0.78rem;
  color: #e74c3c;
  font-weight: 500;
  display: block;
  min-height: 1em;
  animation: wmpSlideDown 0.2s ease;
}
@keyframes wmpSlideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   HONEYPOT
   ========================================================= */
.wmp-cf-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* =========================================================
   SUBMIT BUTTON
   ========================================================= */
.wmp-cf-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--wmp-cf-accent);
  color: #fff;
  border: none;
  border-radius: var(--wmp-cf-radius);
  font-family: var(--wmp-cf-font);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 14px 28px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--wmp-cf-transition);
  box-shadow: 0 4px 14px rgba(232, 65, 24, 0.30);
  min-width: 180px;
  justify-content: center;
}
.wmp-cf-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.10) 0%, transparent 60%);
  pointer-events: none;
}
.wmp-cf-submit:hover {
  background: var(--wmp-cf-accent-dark);
  box-shadow: 0 6px 20px rgba(232, 65, 24, 0.38);
  transform: translateY(-1px);
}
.wmp-cf-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(232, 65, 24, 0.25);
}
.wmp-cf-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
.wmp-cf-submit-icon {
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}
.wmp-cf-submit:hover .wmp-cf-submit-icon {
  transform: translateX(3px) rotate(-5deg);
}

/* Spinner */
.wmp-cf-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wmpSpin 0.7s linear infinite;
}
.wmp-cf-submit.wmp-loading .wmp-cf-spinner { display: block; }
.wmp-cf-submit.wmp-loading .wmp-cf-submit-icon { display: none; }
@keyframes wmpSpin {
  to { transform: rotate(360deg); }
}

/* =========================================================
   RESPONSE AREA
   ========================================================= */
.wmp-cf-response {
  margin-top: 1.2rem;
  border-radius: var(--wmp-cf-radius);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease, opacity 0.3s;
  opacity: 0;
}
.wmp-cf-response.wmp-show {
  max-height: 120px;
  padding: 14px 18px;
  opacity: 1;
}
.wmp-cf-response.wmp-success {
  background: rgba(39, 174, 96, 0.10);
  border: 1px solid rgba(39, 174, 96, 0.28);
  color: #219150;
}
.wmp-cf-response.wmp-error {
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.25);
  color: #c0392b;
}

/* Success glow animation */
@keyframes wmpSuccessGlow {
  0%   { box-shadow: 0 0 0 rgba(39,174,96,0); }
  50%  { box-shadow: 0 0 24px rgba(39,174,96,0.18); }
  100% { box-shadow: 0 0 0 rgba(39,174,96,0); }
}
.wmp-cf-container.wmp-sent {
  animation: wmpSuccessGlow 1s ease 0.1s both;
}

/* =========================================================
   BUG FIX v7.1 — Icon/placeholder overlap
   Some themes reset position on all wrappers globally.
   Force the correct layout so icon never overlaps text.
   ========================================================= */

/* Guarantee the wrap stays relative so the absolute icon positions correctly */
.wmp-cf-input-wrap,
.wmp-cf-select-wrap,
.wmp-cf-textarea-wrap {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
}

.wmp-cf-textarea-wrap {
  align-items: flex-start !important;
}

/* Icon must sit at left:14px inside the wrap — never shift with text */
.wmp-cf-icon {
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 2 !important;
  pointer-events: none !important;
  line-height: 0 !important;
  width: 16px !important;
  flex-shrink: 0 !important;
}

/* Textarea icon stays pinned to top, not vertically centered */
.wmp-cf-textarea-wrap .wmp-cf-icon,
.wmp-cf-icon--top {
  top: 14px !important;
  transform: none !important;
}

/* Inputs: left padding = icon width (16px) + left offset (14px) + breathing room (12px) = 42px */
.wmp-cf-input {
  padding-left: 42px !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

/* Select arrow stays pinned to right */
.wmp-cf-select-arrow {
  position: absolute !important;
  right: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  pointer-events: none !important;
  z-index: 2 !important;
}

.wmp-cf-field:focus-within .wmp-cf-select-arrow {
  color: var(--wmp-cf-accent) !important;
  transform: translateY(-50%) rotate(180deg) !important;
}

/* Prevent any inherited float/flex from the theme pushing icons around */
.wmp-cf-icon svg,
.wmp-cf-select-arrow svg {
  display: block !important;
  flex-shrink: 0 !important;
}

/* =========================================================
   BUG FIX v7.2 — Icons completely removed from HTML
   Reset all icon-related padding so inputs are clean
   ========================================================= */

/* Remove left padding that was reserved for the icon */
.wmp-cf-input {
  padding-left: 14px !important;
}

/* Hide any icon spans that may still exist in cached HTML */
.wmp-cf-icon,
.wmp-cf-select-arrow {
  display: none !important;
}
