/* ==========================================================================
   Services Contact Form Styles
   Matches dynaconnect.css design system for corporate sophistication
   ========================================================================== */

.magensa-contact-form-section {
  padding: 2rem 0;
  background: linear-gradient(180deg, #fafbfc 0%, #f8f9fa 100%);
  position: relative;
}

/* Subtle gradient transition at top */
.magensa-contact-form-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.6) 0%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

.magensa-contact-form-wrapper {
  max-width: 650px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.magensa-contact-form-header {
  text-align: center;
  margin-bottom: 5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 2rem;
  position: relative;
}

.magensa-form-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.4rem;
  border-radius: 999px;
  background: rgba(99, 97, 154, 0.18);
  color: #312d57;
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  border: 1px solid rgba(76, 74, 125, 0.36);
  margin-bottom: 2rem;
}

.magensa-contact-form-header .section-title {
  font-size: clamp(3.2rem, 5vw, 4rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: 3rem;
}

/* Red underline accent under title - matches page style */
.magensa-contact-form-header .section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(135deg, #d21242 0%, #b01035 100%);
  border-radius: 2px;
  opacity: 0.8;
}

.magensa-contact-form-header .section-subtitle {
  font-size: clamp(1.8rem, 3vw, 2.1rem);
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0 auto;
  font-weight: 400;
  text-align: center;
  max-width: 800px;
}

.magensa-contact-form-container {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem 2rem 3.2rem 2rem;
  box-shadow: 0 18px 45px rgba(76, 74, 125, 0.15);
  border: 1px solid rgba(76, 74, 125, 0.12);
  position: relative;
  overflow: hidden;
}

/* Subtle background pattern for sophistication */
.magensa-contact-form-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(99, 97, 154, 0.04) 0%,
      transparent 55%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(210, 18, 66, 0.03) 0%,
      transparent 60%
    );
  opacity: 0.6;
  pointer-events: none;
  z-index: 1;
}

.magensa-contact-form-container > * {
  position: relative;
  z-index: 2;
}

.magensa-contact-form {
  width: 100%;
}

.form-row {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 1rem;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-group-full {
  flex: 1 1 100%;
}

.form-label {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: block;
  line-height: 1.3;
}

.form-label .required {
  color: #d21242;
  margin-left: 0.4rem;
  font-weight: 700;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1.2rem;
  font-size: 1.3rem;
  border: 2px solid rgba(38, 60, 80, 0.15);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text-primary);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.form-control:hover {
  border-color: rgba(38, 60, 80, 0.25);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.form-control:focus {
  outline: none;
  border-color: #d21242;
  box-shadow:
    0 0 0 3px rgba(210, 18, 66, 0.12),
    0 4px 12px rgba(210, 18, 66, 0.08);
  background: #ffffff;
}

.form-control.error {
  border-color: #d21242;
  box-shadow: 0 0 0 3px rgba(210, 18, 66, 0.12);
}

/* Error state for selects - maintain single arrow */
select.form-control.error {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23d21242' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 14px 14px;
  background-position: right 1.2rem center;
  background-color: #ffffff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.form-control::placeholder {
  color: rgba(38, 60, 80, 0.4);
  font-weight: 400;
}

select.form-control {
  cursor: pointer;
  /* Remove native arrow completely */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  /* Custom arrow - single instance, no repeat */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23263c50' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 14px 14px;
  background-position: right 1.2rem center;
  padding-right: 3.5rem;
  background-color: #ffffff;
}

select.form-control:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23d21242' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 14px 14px;
  background-position: right 1.2rem center;
}

/* Focus state - maintain single arrow, prevent duplication */
select.form-control:focus {
  /* Maintain custom arrow in focus state */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23d21242' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 14px 14px;
  background-position: right 1.2rem center;
  background-color: #ffffff;
  /* Ensure native arrow stays hidden */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  /* Override any inherited background shorthand from .form-control:focus */
  background-clip: padding-box;
}

.field-error {
  font-size: 1.1rem;
  color: #d21242;
  margin-top: 0.4rem;
  min-height: 1.2rem;
  font-weight: 500;
  line-height: 1.3;
}

.field-error .text-danger {
  color: #d21242;
  font-size: 1.3rem;
  font-weight: 500;
}

/* Bottom Section Container */
.form-bottom-section {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Checkbox Section */
.form-checkbox-section {
  margin-bottom: 2.2rem;
  text-align: left;
  padding-left: 0;
  margin-left: 0;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 0;
  margin: 0;
  text-align: left;
  width: 100%;
}

.checkbox-text {
  flex: 1;
  line-height: 1.5;
}

.checkbox-label:hover {
  color: var(--text-primary);
}

.checkbox-microcopy {
  font-size: 1.1rem;
  color: rgba(38, 60, 80, 0.6);
  margin: 0.5rem 0 0 2.2rem;
  line-height: 1.4;
  font-weight: 400;
}

.subscribe-checkbox {
  width: 1.4rem;
  height: 1.4rem;
  cursor: pointer;
  accent-color: #d21242;
  border-radius: 4px;
  flex-shrink: 0;
}

/* reCAPTCHA Section */
.form-recaptcha-section {
  margin-bottom: 1.9rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.92;
}

.recaptcha-container {
  display: inline-block;
  text-align: center;
  margin: 0 auto;
  filter: contrast(0.95);
}

.recaptcha-container .g-recaptcha {
  display: inline-block;
  margin: 0 auto;
}

.field-error#services-recaptcha-error {
  margin-top: 0.8rem;
  text-align: center;
}

.form-message {
  margin-bottom: 0;
  min-height: 0;
  display: none;
}

.form-message.form-success,
.form-message.form-error {
  display: block;
  margin-bottom: 1.5rem;
  min-height: auto;
}

.form-success {
  padding: 1.8rem 2.2rem;
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 2px solid #c3e6cb;
  border-radius: 12px;
  color: #155724;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(21, 87, 36, 0.1);
}

.form-success i {
  font-size: 2rem;
  color: #155724;
  flex-shrink: 0;
}

.form-error {
  padding: 1.8rem 2.2rem;
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border: 2px solid #f5c6cb;
  border-radius: 12px;
  color: #721c24;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(114, 28, 36, 0.1);
}

.form-error i {
  font-size: 2rem;
  color: #721c24;
  flex-shrink: 0;
}

.validation-summary {
  padding: 1.8rem 2.2rem;
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border: 2px solid #f5c6cb;
  border-radius: 12px;
  color: #721c24;
  margin-bottom: 2.4rem;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(114, 28, 36, 0.1);
}

/* Form Actions Section */
.form-actions {
  margin-top: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

/* Form submit button uses the standardized button system from magtek-buttons.css */
/* Uses .btn-primary .btn-sm - constrained width for better UX */
.form-submit-button {
  width: auto !important;
  min-width: 200px !important;
  max-width: 100% !important;
  margin: 0 auto !important;
}

.form-reassurance-text {
  font-size: 1.1rem;
  color: rgba(38, 60, 80, 0.6);
  margin: 1rem 0 0 0;
  text-align: center;
  line-height: 1.5;
  font-weight: 400;
}

/* Disabled state - button system handles this, but ensure it works in form context */
.form-submit-button:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.button-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.4rem; /* Matches btn-sm font size */
}

/* ==========================================================================
     Responsive Design - Matches dynaconnect.css breakpoints
     ========================================================================== */

/* Tablet Portrait (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .magensa-contact-form-section {
    padding: 2rem 0;
  }

  .magensa-contact-form-header {
    margin-bottom: 4rem;
    padding: 0 1.5rem;
  }

  .magensa-contact-form-wrapper {
    max-width: 600px;
  }

  .magensa-contact-form-container {
    padding: 1.5rem 1.5rem 3.2rem 1.5rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .form-checkbox-section {
    margin-bottom: 2rem;
  }

  .form-recaptcha-section {
    margin-bottom: 1.8rem;
    opacity: 0.92;
  }

  .checkbox-microcopy {
    margin-left: 2rem;
  }
}

/* Mobile Landscape (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
  .magensa-contact-form-section {
    padding: 2rem 0;
  }

  .magensa-contact-form-header {
    margin-bottom: 3rem;
    padding: 0 1rem;
  }

  .magensa-contact-form-wrapper {
    max-width: 100%;
    padding: 0 1rem;
  }

  .magensa-form-eyebrow {
    font-size: 1rem;
    padding: 0.4rem 1rem;
  }

  .magensa-contact-form-header .section-title {
    font-size: clamp(2.5rem, 6vw, 3rem);
    margin-bottom: 1.2rem;
    padding-bottom: 2rem;
  }

  .magensa-contact-form-header .section-subtitle {
    font-size: clamp(1.5rem, 3.5vw, 1.8rem);
  }

  .magensa-contact-form-container {
    padding: 1.5rem 1.5rem 3.2rem 1.5rem;
    border-radius: 16px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .form-label {
    font-size: 1.2rem;
  }

  .form-control {
    font-size: 1.3rem;
    padding: 0.9rem 1.1rem;
  }

  .form-bottom-section {
    margin-top: 1rem;
  }

  .form-checkbox-section {
    margin-bottom: 2rem;
    text-align: left;
  }

  .form-recaptcha-section {
    margin-bottom: 1.8rem;
    opacity: 0.92;
  }

  .checkbox-microcopy {
    margin-left: 2rem;
    font-size: 1rem;
  }

  .form-submit-button {
    width: auto !important;
    min-width: 180px !important;
    max-width: 100% !important;
  }

  .form-reassurance-text {
    font-size: 1rem;
  }
}

/* Mobile Portrait (320px - 479px) */
@media (max-width: 479px) {
  .magensa-contact-form-section {
    padding: 2rem 0;
  }

  .magensa-contact-form-header {
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
  }

  .magensa-contact-form-wrapper {
    max-width: 100%;
    padding: 0 0.5rem;
  }

  .magensa-form-eyebrow {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    margin-bottom: 1.5rem;
  }

  .magensa-contact-form-header .section-title {
    font-size: clamp(2.2rem, 7vw, 2.8rem);
    margin-bottom: 1rem;
    padding-bottom: 1.5rem;
  }

  .magensa-contact-form-header .section-title::after {
    width: 60px;
    height: 3px;
  }

  .magensa-contact-form-header .section-subtitle {
    font-size: clamp(1.4rem, 4vw, 1.6rem);
  }

  .magensa-contact-form-container {
    padding: 1.5rem 1.2rem 3.2rem 1.2rem;
    border-radius: 16px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .form-label {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  .form-control {
    font-size: 1.2rem;
    padding: 0.8rem 1rem;
  }

  .field-error {
    font-size: 1rem;
    margin-top: 0.4rem;
  }

  .form-bottom-section {
    margin-top: 1rem;
  }

  .form-checkbox-section {
    margin-bottom: 2rem;
    text-align: left;
  }

  .checkbox-label {
    font-size: 1.1rem;
  }

  .checkbox-microcopy {
    margin-left: 1.9rem;
    font-size: 1rem;
  }

  .form-recaptcha-section {
    margin-bottom: 1.8rem;
    opacity: 0.92;
  }

  .recaptcha-container {
    overflow-x: auto;
    max-width: 100%;
  }

  .recaptcha-container .g-recaptcha {
    transform: scale(0.85);
    transform-origin: center center;
  }

  .form-actions {
    margin-top: 0;
  }

  .form-submit-button {
    width: auto !important;
    min-width: 180px !important;
    max-width: 100% !important;
  }

  .form-reassurance-text {
    font-size: 1rem;
    margin-top: 0.8rem;
  }

  .form-success,
  .form-error {
    padding: 1.2rem 1.5rem;
    font-size: 1.2rem;
  }

  .form-success i,
  .form-error i {
    font-size: 1.6rem;
  }
}
