/**
 * Test Result Retrieval Form & Data Collection Form Styles
 *
 * @package TestBuilderPro
 * @subpackage Assets\CSS
 * @since 2.0.0
 */

h1.entry-title {
  display: none;
}

/* ===== LEGACY RESULT RETRIEVAL FORM ===== */
/* access prior results form */
.yct-check-test-result-form-wrap {
  margin: 0 0 var(--tbp-space-sm);
  text-align: center;
}

.yct-check-test-result-form-wrap h3,
#primary .yct-check-test-result-form-wrap h3 {
  font-size: var(--tbp-font-size-xl);
  color: var(--tbp-text);
  font-weight: bold;
  margin-bottom: var(--tbp-space-sm);
}

form#yct-check-test-result-form {
  display: flex;
  flex-direction: column;
}

.yct-check-test-result-form-wrap input {
  margin-bottom: var(--tbp-space-sm);
  width: 100%;
  text-align: center;
}

#yct-check-test-result-form .yct-test-code-check {
  width: 100%;
}

.yct-check-test-result-form-wrap .ytc-error {
  color: var(--tbp-message-error);
  font-size: var(--tbp-font-size-xs);
  margin-bottom: var(--tbp-space-xs);
}

.yct-check-test-result-form-wrap button[disabled] {
  background: #cecece;
  border: none;
  color: var(--tbp-text-white);
}

/* ===== ENHANCED DATA COLLECTION FORM ===== */

/* Main wrapper and container */
.tbp-data-collection-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.tbp-test-container {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin: 20px 0;
}

/* Enhanced intro section */
.tbp-form-intro {
  background: #f9f9fa;
  padding: 40px 30px;
  text-align: center;
  position: relative;
}

.form-intro-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 12px 0;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.form-intro-subtitle {
  font-size: 16px;
  margin: 0;
  opacity: 0.95;
  line-height: 1.5;
  position: relative;
  z-index: 1;
  font-weight: 400;
}

/* Form sections */
.tbp-form-section {
  padding: 0;
  margin-bottom: 0;
  margin-top: 4em;
}

.tbp-section-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 30px;
  text-align: center;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 0;
  border-radius: 0;
}

.tbp-section-header h3 {
  margin: 0 0 10px 0;
  color: #2c3e50;
  font-size: 22px;
  font-weight: 600;
}

.tbp-section-header p {
  margin: 0;
  color: #6c757d;
  font-size: 15px;
  line-height: 1.5;
}

/* Question styling */
.tbp-page-questions {
  padding: 30px;
}

.tbp-question {
  margin-bottom: 35px;
  position: relative;
  background: #f4f4f4;
  border: 1px solid #c8c8c8;
  overflow: hidden;
  transition: all 0.3s ease;
  padding-top: 0;
}

.tbp-question:last-child {
  margin-bottom: 0;
}

.tbp-question-text {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5em;
  position: relative;
  padding: 10px 10px 10px 70px;
  height: 90px;
  line-height: 1.4;
  background: white;
  flex-direction: column;
  justify-content: flex-start;
}

/* Enhanced question numbers */
.tbp-question-number {
  background: #efc717;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  width: 60px;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--tbp-font-size-lg);
  font-weight: 500;
}

.tbp-question-text strong {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  line-height: 1.4;
  margin-top: 8px;
}

.tbp-question-text small {
  display: block;
  margin-top: 8px;
  color: #6c757d;
  font-size: 14px;
  font-weight: 400;
}

/* Options styling */
.tbp-options {
  background: #f4f4f4;
  padding: 20px;
}

.tbp-option {
  margin-bottom: 12px;
  padding: 0;
  display: flex;
  align-items: center;
}

/* Radio and checkbox inputs */
.tbp-option input[type="radio"],
.tbp-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  accent-color: #667eea;
  transform: scale(1.1);
}

.tbp-option label {
  font-size: 15px;
  cursor: pointer;
  align-items: center;
  font-weight: 500;
}

.tbp-checkbox-option:hover {
  transform: translateY(-1px);
}

/* Checkbox grid layout */
.tbp-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.tbp-checkbox-option {
  margin-bottom: 0;
}

.tbp-checkbox-option label {
  margin-bottom: 0;
  height: 100%;
  min-height: 35px;
}

/* Form inputs */
.tbp-profile-form select,
.tbp-profile-form input[type="text"],
.tbp-profile-form input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
  background: #ffffff;
  margin-bottom: 16px;
  height: 52px;
  box-sizing: border-box;
}

.tbp-profile-form select:focus,
.tbp-profile-form input[type="text"]:focus,
.tbp-profile-form input[type="email"]:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  background: #ffffff;
}

/* Special styling for form fields in options */
.tbp-option > div {
  transition: all 0.3s ease;
}

/* Form navigation */
.tbp-form-navigation {
  text-align: center;
  padding: 40px 30px;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

.tbp-btn {
  padding: 16px 32px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  min-width: 200px;
  height: 56px;
  box-sizing: border-box;
}

.tbp-btn-inactive {
  background: #e9ecef;
  color: #6c757d;
  cursor: not-allowed;
}

.tbp-btn-ready {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
  transform: translateY(-2px);
}

.tbp-btn-ready:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.tbp-btn-secondary {
  background: transparent;
  color: #667eea;
  border: 2px solid #667eea;
  margin-top: 16px;
  min-width: 160px;
  height: 48px;
  font-size: 14px;
}

.tbp-btn-secondary:hover {
  background: #667eea;
  color: white;
  transform: translateY(-1px);
}

/* Loading state */
#tbp-profile-loading {
  color: #667eea;
  font-style: italic;
  font-size: 16px;
  margin-top: 20px;
}

#tbp-profile-loading::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid #667eea;
  border-radius: 50%;
  border-top-color: transparent;
  animation: tbp-spin 1s linear infinite;
}

/* Error messages */
.tbp-error-message {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  padding: 16px 20px;
  border-radius: 10px;
  margin: 20px 0;
  font-weight: 500;
}

/* Conditional sections */
#section-opportunities {
  transition: all 0.4s ease-in-out;
  transform-origin: top;
}

#section-opportunities.show {
  animation: tbp-slideDown 0.4s ease-out;
}

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

@keyframes tbp-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Custom segment other field */
#segment-other-container {
  margin-top: 12px;
}

#segment-other-container input {
  background: #ffffff;
}

/* State container styling */
#state-container {
  width: 100%;
}

/* Responsive design */
@media screen and (max-width: 768px) {
  .tbp-data-collection-wrapper {
    padding: 0 15px;
  }

  .tbp-test-container {
    border-radius: 12px;
    margin: 15px 0;
  }

  .tbp-form-intro {
    padding: 30px 20px;
  }

  .form-intro-title {
    font-size: 24px;
  }

  .form-intro-subtitle {
    font-size: 15px;
  }

  .tbp-page-questions {
    padding: 20px;
  }

  .tbp-section-header {
    padding: 25px 20px;
  }

  .tbp-question-text {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .tbp-question-number {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .tbp-options {
    margin-left: 0;
  }

  .tbp-checkbox-grid {
    grid-template-columns: 1fr;
    margin-left: 0;
  }

  .tbp-option > div {
    margin-left: 0;
    padding: 16px;
  }

  .tbp-form-navigation {
    padding: 30px 20px;
  }

  .tbp-btn {
    width: 100%;
    max-width: 280px;
  }

  .tbp-btn-secondary {
    width: 100%;
    max-width: 200px;
  }
}

@media screen and (max-width: 480px) {
  .tbp-question-text strong {
    font-size: 16px;
  }

  .tbp-option label {
    font-size: 15px;
    padding: 10px 14px;
  }

  .tbp-profile-form select,
  .tbp-profile-form input[type="text"],
  .tbp-profile-form input[type="email"] {
    padding: 12px 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

.tbp-option.email-form,
.tbp-option.country-select {
  flex-direction: column;
  align-items: flex-start;
}

/* Progress bar enhancements */
.tbp-progress-bar-fill {
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tbp-progress-text {
  color: #667eea !important;
  font-weight: 600 !important;
}

/* Additional form elements and cleanup styles */
.tbp-form-select,
.tbp-form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
  background: #ffffff;
  margin-bottom: 16px;
  height: 52px;
  box-sizing: border-box;
}

.tbp-form-select:focus,
.tbp-form-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  background: #ffffff;
}

.tbp-form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
  font-size: 15px;
}

.tbp-question-helper {
  display: block;
  margin-top: 5px;
  color: #666;
  font-size: 14px;
  font-weight: 400;
}

/* Hidden elements by default */
#segment-other-container,
#state-container,
#section-opportunities {
  display: none;
}

.email-form {
  padding: 15px;
}

.country-select,
.state-select {
  padding: 15px;
}

.tbp-form-navigation-secondary {
  margin-top: 15px;
}

.tbp-profile-loading {
  display: none;
  margin-top: 15px;
}

/* Enhanced Consent Styling */
.enhanced-consent {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 10px;
  background: #fafafa;
  transition: border-color 0.2s ease;
}

.enhanced-consent:hover {
  border-color: #d0d0d0;
}

.enhanced-consent input[type="checkbox"]:checked + label {
  font-weight: 500;
  color: var(--tbp-primary);
}

.consent-details {
  margin-top: 8px;
  padding-left: 25px;
}

.consent-details small {
  color: #666;
  font-size: 0.85em;
  line-height: 1.4;
  font-style: italic;
}

/* Combined contact consent section */
#question-contact-consent .tbp-options {
  display: flex;
  flex-direction: column;
  gap: 15px; /* Reduced from 20px for more compact layout */
}

/* More compact section for contact information & consent */
#section-contact {
  margin-top: 20px;
  padding: 20px 0; /* Reduced padding for compactness */
}

#section-contact .tbp-section-header {
  margin-bottom: 15px; /* Reduced margin */
}

#section-contact .tbp-section-header h3 {
  font-size: 1.3rem; /* Slightly smaller title */
  margin-bottom: 8px;
}

#section-contact .tbp-section-header p {
  font-size: 0.95rem; /* Smaller description text */
  margin-bottom: 10px;
}

div#personal-data-consent-option label,
div#email-consent-option label,
.tbp-option.tbp-checkbox-option.comm-pref label {
  font-weight: 600;
}

/* Contact form fields - more compact */
.email-form {
  padding: 12px; /* Reduced from 15px */
  background-color: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  margin-bottom: 10px; /* Added margin for separation */
}

.email-form label {
  margin-bottom: 5px; /* Reduced margin */
  display: block;
  font-size: 0.9rem;
}

.email-form input {
  margin-bottom: 10px; /* Reduced from default */
}

/* Progressive consent options - more compact */
#personal-data-consent-option,
#email-consent-option {
  transition: opacity 0.3s ease, max-height 0.3s ease;
  margin-top: 8px; /* Reduced from 10px */
  padding: 12px; /* Reduced padding */
}

#email-consent-option {
  margin-left: 15px; /* Reduced from 20px */
  padding: 12px; /* Reduced from 15px */
  border-left: 3px solid #007cba;
  background-color: #f9f9f9;
  border-radius: 0 6px 6px 0;
}

/* Compact consent details */
.consent-details {
  margin-top: 5px; /* Reduced margin */
  padding-left: 0;
}

.consent-details small {
  font-size: 0.8rem; /* Slightly smaller text */
  line-height: 1.3; /* Tighter line height */
  color: #666;
}

.gdpr-consent,
.email-consent {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px; /* Reduced from 15px */
  background-color: #fafafa;
  transition: border-color 0.2s ease;
  margin-bottom: 8px; /* Added margin for separation */
}

.gdpr-consent:hover,
.email-consent:hover {
  border-color: #d0d0d0;
}

/* Error message - ensure it's hidden by default */
#tbp-profile-errors.tbp-error-message {
  display: none;
}

/* ===== COMMUNICATION PREFERENCES FIRST FLOW ===== */

/* Communication preferences section - always visible, more prominent */
#question-communication-preferences {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

#question-communication-preferences .tbp-question-text {
  margin-bottom: 15px;
}

#question-communication-preferences .tbp-question-helper {
  font-size: 0.9rem;
  color: #666;
  margin-top: 5px;
}

/* Communication preference options */
.tbp-option.comm-pref {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 12px;
  background-color: #fff;
  transition: all 0.2s ease;
}

.tbp-option.comm-pref:hover {
  border-color: #007cba;
  box-shadow: 0 2px 4px rgba(0, 123, 186, 0.1);
}

.tbp-option.comm-pref input[type="checkbox"]:checked + label {
  color: #007cba;
  font-weight: 600;
}

/* Contact section when conditionally shown */
#section-contact {
  border-top: 2px solid #007cba;
  margin-top: 25px;
  padding-top: 20px;
  background-color: #fdfdfd;
  border-radius: 0 0 8px 8px;
}

/* ===== EXISTING COMPACT STYLES ===== */
.required-asterisk {
  color: #dc3545;
  font-weight: bold;
  margin-left: 3px;
  font-size: 1.1em;
  display: inline-block;
}

/* Conditional sections hidden by default */
.tbp-conditional-section {
  display: none;
}

.tbp-conditional-section.visible {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

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

/* Privacy Notice Styling */
.tbp-privacy-notice {
  margin: 30px 0;
  padding: 0;
}

.tbp-privacy-content {
  background-color: #f8f9fa;
  border-left: 4px solid #007cba;
  padding: 20px 25px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tbp-privacy-content h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: #0073aa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tbp-privacy-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Responsive adjustments for privacy notice */
@media (max-width: 768px) {
  .tbp-privacy-content {
    padding: 15px 18px;
  }
  
  .tbp-privacy-content h4 {
    font-size: 15px;
  }
  
  .tbp-privacy-content p {
    font-size: 13px;
  }
}

/* State dropdown styling - ensure it matches other form elements */
#location_state_us {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  background-color: white;
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#location_state_us:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* ===== FORM VALIDATION HIGHLIGHTING (similar to test questions) ===== */

/* Error States for Missing Fields */
.unanswered-highlight {
  border: 1px solid var(--tbp-error-color) !important;
  box-shadow: 0 0 5px rgba(255, 68, 68, 0.4) !important;
}

/* Enhanced Pulse Animation for Missing Fields */
.pulse-animation {
  animation: pulse-border 1.8s infinite;
  position: relative;
  z-index: 2;
}

@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.8);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(255, 68, 68, 0.4);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
  }
}

/* Extra highlight for current focused field */
.current-focus {
  border: 1px solid var(--tbp-error-color) !important;
  box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.9) !important;
  z-index: 5;
  position: relative;
  transform: scale(1.02);
  transition: transform 0.3s ease;
}

/* The current focus should also have a more prominent highlight */
.current-focus.pulse-animation {
  animation: pulse-border-focus 1.5s infinite;
}

@keyframes pulse-border-focus {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.9);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(255, 68, 68, 0.5);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
  }
}
