/**
 * Custom Multi-Step Form Styles
 * For CQT custom form (not Gravity Forms)
 */

/* Animations */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Form Container */
.cqt-form {
  margin-top: 40px;
  padding: 50px 0px;
}

/* Two Column Layout */
.cqt-form .form-step {
  display: none;
}

.cqt-form .form-step.active {
  display: block;
}

/* Two Column Layout - Only when has class */
.cqt-form .form-step.two-columns {
  display: none;
}

.cqt-form .form-step.two-columns.active {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

/* Single Column Layout */
.cqt-form .form-step.single-column.active {
  display: block;
  margin: 0 auto;
}

.cqt-form .form-step.single-column.active .form-content{
  display: block;
  margin: 0 auto;
  max-width: 800px;
}

/* Form Content Padding */
.cqt-form .form-step .form-content.with-padding {
  padding-left: 40px;
  padding-right: 40px;
}

/* Image Column */
.cqt-form .form-step .form-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Step Headings */
.cqt-form .form-step h2 {
  margin-bottom: 20px;
  color: #008644;
}

/* Icon Headings (h3 with icons) */
.cqt-form .form-step h3.icon-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 12px;
  color: #1442B8;
  font-size: 24px;
}

.cqt-form .form-step h3.icon-heading .heading-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  filter: invert(47%) sepia(97%) saturate(1844%) hue-rotate(162deg) brightness(98%) contrast(101%);
}


/* Fieldset Wrapper */
.cqt-form .form-step .form-field,
.cqt-form .form-step fieldset {
  border: none;
  padding: 0;
  margin: 0 0 20px 0;
  display: block;
}

/* Form Labels */
.cqt-form .form-step label,
.cqt-form .form-step .form-field label,
.cqt-form .form-step fieldset label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 16px;
}

/* Small Helper Text */
.cqt-form .form-step small,
.cqt-form .form-step .form-field small,
.cqt-form .form-step fieldset small {
  display: block;
  margin-top: -15px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #636B63;
  font-weight: normal;
  line-height: 1.4;
}

/* Small after label - no negative margin */
.cqt-form .form-step label + small,
.cqt-form .form-step .form-field label + small,
.cqt-form .form-step fieldset label + small {
  margin-top: 0;
}

/* Small text after input (when input doesn't have margin-bottom) */
.cqt-form .form-step .form-field input + small,
.cqt-form .form-step .form-field select + small,
.cqt-form .form-step .form-field textarea + small {
  margin-top: 5px;
  margin-bottom: 0;
}

/* Form Inputs */
.cqt-form .form-step input[type="text"],
.cqt-form .form-step input[type="email"],
.cqt-form .form-step input[type="tel"],
.cqt-form .form-step select,
.cqt-form .form-step textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
  display: block;
}

/* Inputs within fieldset or form-field wrapper */
.cqt-form .form-step .form-field input[type="text"],
.cqt-form .form-step .form-field input[type="email"],
.cqt-form .form-step .form-field input[type="tel"],
.cqt-form .form-step .form-field select,
.cqt-form .form-step .form-field textarea,
.cqt-form .form-step fieldset input[type="text"],
.cqt-form .form-step fieldset input[type="email"],
.cqt-form .form-step fieldset input[type="tel"],
.cqt-form .form-step fieldset select,
.cqt-form .form-step fieldset textarea {
  margin-bottom: 5px;
  width: 100%;
  box-sizing: border-box;
}

/* Input Focus State */
.cqt-form .form-step input:focus,
.cqt-form .form-step select:focus,
.cqt-form .form-step textarea:focus {
  outline: none;
  border-color: #008644;
  box-shadow: 0 0 0 2px rgba(0, 134, 68, 0.1);
}

/* Select with Calendar Icon */
.cqt-form .form-step select.calendar-icon {
  width: 50%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('../img/icons/Calendar.svg');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px 20px;
  padding-right: 40px;
}

/* Mobile: Full width on small screens */
@media (max-width: 768px) {
  .cqt-form .form-step select.calendar-icon {
    width: 100%;
  }
}

/* Loading State for Eircode Input */
.cqt-form .form-step input.loading {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23009FDA' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px 20px;
  padding-right: 40px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { 
    opacity: 1;
  }
  50% { 
    opacity: 0.7;
  }
}

/* Error State */
.cqt-form .form-step input.error,
.cqt-form .form-step select.error,
.cqt-form .form-step textarea.error {
  border-color: #e74c3c !important;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1) !important;
  animation: shake 0.3s ease-in-out;
}

/* Field Error Message */
.cqt-form .form-step .field-error {
  color: #e74c3c;
  font-size: 12px;
  margin-top: 4px;
  display: block;
  font-weight: 500;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.cqt-form .form-step .error-message {
  color: #212121;
  font-size: 14px;
  margin-bottom: 15px;
  padding: 10px;
  background: rgba(181, 29, 29, 0.08);
  border-left: 3px solid #B51D1D;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
  clear: both;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Success Message */
.success-message {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  background: rgb(20, 66, 184);
  color: white;
  padding: 20px 30px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-width: 400px;
  animation: slideIn 0.3s ease-out;
}

.success-message-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Poppins", sans-serif;
}

/* Checkbox Inputs */
.cqt-form .form-step input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

/* Checkbox Label Wrapper */
.cqt-form .form-step .checkbox-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  font-weight: 400;
  gap: 12px;
}

.cqt-form .form-step .checkbox-label input[type="checkbox"] {
  margin-top: 4px;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.cqt-form .form-step .checkbox-label span {
  flex: 1;
  line-height: 1.5;
  color: #333D33;
  font-size: 14px;
  font-weight: 400;
}

/* Radio Button Group */
.cqt-form .form-step .radio-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}


/* Radio Label */
.cqt-form .form-step .radio-label {
  display: block;
  position: relative;
  cursor: pointer;
  padding: 0;
  border: 2px solid #A6AAA6;
  border-radius: 8px;
  background-color: #fff;
  transition: all 0.3s ease;
  text-align: center;
  font-weight: 400;
  overflow: hidden;
}

.cqt-form .form-step .radio-label:hover {
  border-color: #009FDA;
  background-color: #F0F8FF;
}

/* Hide default radio button */
.cqt-form .form-step .radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 0;
  height: 0;
}

/* Radio label text */
.cqt-form .form-step .radio-label span {
  display: block;
  font-size: 16px;
  color: #1442B8;
  font-weight: 600;
  text-align: left;
  padding: 20px;
}

/* Selected state */
.cqt-form .form-step .radio-label input[type="radio"]:checked ~ span {
  color: #1442B8;
  font-weight: 600;
  text-align: left;
}

.cqt-form .form-step .radio-label:has(input[type="radio"]:checked) {
  border: 3px solid #009FDA;
  background-color: #E6F4FF;
  box-shadow: 0 0 0 2px rgba(20, 66, 184, 0.1);
}

/* Radio with Image */
.cqt-form .form-step .radio-label .radio-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: cover;
  margin: 0;
  padding: 0;
}

/* Focus state for accessibility */
.cqt-form .form-step .radio-label input[type="radio"]:focus ~ span {
  outline: none;
}

/* Form Row - Two columns for inputs */
.cqt-form .form-step .form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 0;
}

/* Simple Radio Buttons (original style) */
.cqt-form .form-step .radio-group-simple {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.cqt-form .form-step .radio-label-simple {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 400;
  gap: 12px;
}

.cqt-form .form-step .radio-label-simple input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
  accent-color: #1442B8;
}

.cqt-form .form-step .radio-label-simple span {
  flex: 1;
  font-size: 16px;
  color: #333D33;
  font-weight: 400;
}

/* Mobile: Stack radio buttons in single column */
@media (max-width: 768px) {
  .cqt-form .form-step .radio-group {
    grid-template-columns: 1fr;
  }
}

/* Button Container */
.cqt-form .form-step .form-buttons {
  margin-top: 30px;
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
}

/* Full Width Button Container */
.cqt-form .form-step .form-buttons.full-width {
  flex-direction: column;
}

.cqt-form .form-step .form-buttons.full-width button {
  width: 100%;
}

/* Two Buttons Side by Side (default) */
.cqt-form .form-step .form-buttons button {
  flex: 1;
}

/* Button Spacing */
.cqt-form .form-step button {
  margin-right: 0;
}

/* Loading State */
.cqt-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Button Style Variations */

/* Default Button (from theme - blue with white arrow on right) */
.cqt-form button.btn,
.cqt-form button {
  min-height: 40px;
  height: auto;
  border: 2px solid #1442B8;
  border-radius: 20px;
  background: #1442B8;
  color: #fff;
  line-height: 1.4;
  padding: 8px 36px 8px 24px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  font-weight: 400;
  transition: all 0.2s;
  white-space: normal;
  word-wrap: break-word;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cqt-form button.btn:hover,
.cqt-form button:hover {
  background: #000;
  border-color: #000;
  color: #fff;
}

/* Default: Arrow on Right (default behavior) */
.cqt-form button.btn::after,
.cqt-form button.btn-arrow-right::after,
.cqt-form button::after {
  content: '';
  background-image: url("../img/right-w.svg");
  background-size: contain;
  background-repeat: no-repeat;
  position: absolute;
  top: 50%;
  margin-top: -6px;
  right: 16px;
  width: 8px;
  height: 12px;
  background-color: transparent;
  transition: all 0.2s;
}

/* Arrow on Left */
.cqt-form button.btn-arrow-left {
  padding: 8px 24px 8px 36px; /* Swap padding for left arrow */
}

.cqt-form button.btn-arrow-left::after {
  content: '';
  background-image: url("../img/left.svg");
  background-size: contain;
  background-repeat: no-repeat;
  position: absolute;
  top: 50%;
  margin-top: -8px;
  left: 16px; /* Position on left */
  right: auto;
  width: 18px;
  height: 18px;
  background-color: transparent;
  transition: all 0.2s;
}

/* No Arrow */
.cqt-form button.btn-no-arrow {
  padding: 8px 24px; /* Equal padding when no arrow */
}

.cqt-form button.btn-no-arrow::after {
  display: none; /* Hide arrow */
}

/* Button with Icon */
.cqt-form button .btn-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  vertical-align: middle;
  transition: filter 0.2s;
}

/* Blue buttons - icons should be white */
.cqt-form button.btn-primary .btn-icon {
  filter: brightness(0) invert(1);
}

/* Outline buttons - icons should be blue initially */
/* This filter works for both white and blue SVG icons */
.cqt-form button.btn-outline .btn-icon {
  filter: brightness(0) saturate(100%) invert(22%) sepia(97%) saturate(2447%) hue-rotate(217deg) brightness(91%) contrast(90%);
}

/* Outline buttons on hover - icons should be white */
.cqt-form button.btn-outline:hover .btn-icon {
  filter: brightness(0) invert(1);
}

/* Outline Button Style */
.cqt-form button.btn-outline {
  background: transparent;
  border: 2px solid #1442B8;
  color: #1442B8;
}

.cqt-form button.btn-outline::after {
  background-image: url("../img/right.svg"); /* Blue arrow for outline */
}

.cqt-form button.btn-outline:hover {
  background: #1442B8;
  border-color: #1442B8;
  color: #fff;
}

.cqt-form button.btn-outline:hover::after {
  background-image: url("../img/right-w.svg"); /* White arrow on hover */
}

/* Outline with Left Arrow */
.cqt-form button.btn-outline.btn-arrow-left::after {
  background-image: url("../img/left.svg"); /* Blue left arrow */
}

.cqt-form button.btn-outline.btn-arrow-left:hover::after {
  background-image: url("../img/left.svg"); /* Keep blue on hover - adjust if needed */
}

/* White Button Style */
.cqt-form button.btn-white {
  background-color: #fff;
  border: 2px solid #fff;
  color: #000;
}

.cqt-form button.btn-white::after {
  background-image: url("../img/right.svg"); /* Dark arrow for white button */
}

.cqt-form button.btn-white:hover {
  background-color: #fff;
  border-color: #fff;
  color: #1442B8;
}

/* File Upload Component */
.cqt-form .file-upload-wrapper {
  width: 100%;
}

.cqt-form .file-input {
  display: none;
}

.cqt-form .file-upload-area {
  border: 2px dashed #009FDA;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  background-color: #F9F9F9;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cqt-form .file-upload-area:hover {
  border-color: #009FDA;
  background-color: #F0F8FF;
}

.cqt-form .file-upload-area.drag-over {
  border-color: #009FDA;
  background-color: #E6F4FF;
  border-style: solid;
}

.cqt-form .file-upload-area .upload-icon {
  display: block;
  margin: 0 auto 16px;
  background: #009FDA;
  border-radius: 10px;
  padding: 6px;
}

.cqt-form .file-upload-area .upload-text {
  color: #333D33;
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}

.cqt-form .file-upload-area .upload-text span {
  color: #1442B8;
  text-decoration: underline;
}

.cqt-form .file-upload-info {
  margin-top: 16px;
}

.cqt-form .file-upload-info p {
  margin: 0 0 4px 0;
  font-size: 14px;
  line-height: 1.4;
}

.cqt-form .file-upload-info .file-status {
  color: #636B63;
  font-weight: 500;
  margin-bottom: 8px;
}

.cqt-form .file-upload-info .file-status.file-added {
  color: #008644;
  font-weight: 600;
}

.cqt-form .file-upload-info .file-requirements {
  color: #636B63;
  font-size: 13px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .cqt-form .form-step.two-columns.active {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .cqt-form .form-step .form-image {
    order: -1; /* Image on top on mobile */
  }
  
  /* Remove horizontal padding on mobile */
  .cqt-form .form-step .form-content.with-padding {
    padding-left: 0;
    padding-right: 0;
  }
  
  .cqt-form .file-upload-area {
    padding: 30px 15px;
  }
  
  /* Stack form-row inputs on mobile */
  .cqt-form .form-step .form-row {
    grid-template-columns: 1fr;
  }
  
  /* Stack potential-info boxes on mobile */
  .cqt-form .potential-info {
    grid-template-columns: 1fr !important;
  }
  
  /* Button responsive styles */
  .cqt-form button.btn,
  .cqt-form button {
    font-size: 14px;
    padding: 8px 32px 8px 16px;
  }
  
  .cqt-form button.btn-arrow-left {
    padding: 8px 16px 8px 32px;
  }
  
  .cqt-form button.btn-no-arrow {
    padding: 8px 16px;
  }
  
  .cqt-form button .btn-icon {
    width: 18px;
    height: 18px;
    margin-right: 6px;
  }
}

/* Potential Info Boxes (Step 8) */
.cqt-form .potential-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.cqt-form .potential-info .potential-grant,
.cqt-form .potential-info .potential-costs {
  padding: 20px;
  border-radius: 8px;
}

.cqt-form .potential-info .potential-grant {
  background-color: #1442B8;
}

.cqt-form .potential-info .potential-costs {
  background-color: #00082B;
}

.cqt-form .potential-info p {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-style: normal;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: -0.24px;
  color: white;
}

.cqt-form .potential-info span {
  font-size: 24px;
  font-style: normal;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: -0.48px;
  color: white;
  display: block;
}

/* Phone Number with Icon */
.cqt-form p.phone-number {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.cqt-form p.phone-number .phone-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Step 9 - Proceed Heading */
.cqt-form .proceed-heading {
  font-family: 'St Ryde', sans-serif;
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: -0.48px;
  color: #008644;
  margin-top: 32px;
  margin-bottom: 8px;
}

/* Text-only Button (Back to previous screen link) */
.cqt-form button.btn-text {
  background: none;
  border: none;
  color: #212121;
  text-decoration: underline;
  padding: 12px 24px;
  font-size: 18px;
  line-height: 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cqt-form button.btn-text::after {
  display: none;
}

.cqt-form button.btn-text:hover {
  background: none;
  border: none;
  color: #1442B8;
}

/* Additional Contact Section */
.cqt-form .additional-contact-toggle {
  margin-top: 16px;
  margin-bottom: 16px;
}

.cqt-form .additional-contact-fields {
  margin-top: 16px;
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid #cecece;
  border-radius: 8px;
  background: #f9f9f9;
}

.cqt-form .additional-contact-fields h4 {
  margin-top: 0;
  margin-bottom: 16px;
}

.cqt-form .remove-contact-btn {
  margin-top: 12px;
  font-size: 14px;
}

