/* Individual Pledge Form - Typeform Style */

/* Hide the form initially and show loading */
#gform_68 {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#gform_68.typeform-ready {
    opacity: 1;
}

/* Container for typeform style */
.typeform-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 70vh;
    position: relative;
}

/* Override Gravity Forms grid layout */
.typeform-container .gform_fields {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
}

/* Hide all fields initially */
.typeform-container .gfield {
    display: none !important;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.4s ease;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Show active field */
.typeform-container .gfield.active {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
    animation: slideIn 0.4s ease;
    margin-bottom: 2rem !important;
}

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

/* Progress bar */
.typeform-progress {
    position: relative;
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    margin-top: 2rem;
    overflow: hidden;
}

@media (max-width: 768px) {
    .typeform-progress {
        margin-top: 1.5rem;
    }
}

.typeform-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #567EC0, #618dd4);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* Question image container */
.typeform-question-image {
    width: 100%;
    max-width: 100%;
    height: 200px;
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.typeform-question-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.typeform-question-image.no-image {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
}

.typeform-question-image.no-image::before {
    content: "📋";
    font-size: 3rem;
    opacity: 0.3;
}

/* Question styling */
.typeform-question {
    font-size: 2.5rem;
    font-weight: 400;
    color: #567EC0;
    margin-bottom: 2rem;
    line-height: 1.2;
    width: 100%;
    word-wrap: break-word;
}

/* For longer questions that do need to wrap */
.typeform-question.wrap-text {
    white-space: normal;
    width: 100%;
}

.typeform-question .question-number {
    color: #567EC0;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Input styling */
.typeform-container input[type="text"],
.typeform-container input[type="email"],
.typeform-container select,
.typeform-container textarea {
    font-size: 1.5rem !important;
    padding: 1rem 0 !important;
    border: none !important;
    border-bottom: 3px solid #ddd !important;
    background: transparent !important;
    border-radius: 0 !important;
    width: 100% !important;
    max-width: 500px;
    transition: border-color 0.3s ease !important;
    margin-top: 0 !important;
}

.typeform-container input:focus,
.typeform-container select:focus,
.typeform-container textarea:focus {
    border-bottom-color: #567EC0 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Special styling for textarea to reduce top spacing */
.typeform-container textarea {
    margin-top: -0.5rem !important;
    padding-top: 0.5rem !important;
    height: 60px !important;
}

/* Remove extra spacing from ginput containers */
.typeform-container .ginput_container {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Checkbox and Radio styling */
.typeform-container .gfield_checkbox,
.typeform-container .gfield_radio {
    margin-top: 1rem;
}

.typeform-container .gfield_checkbox li,
.typeform-container .gfield_radio li {
    margin: 1rem 0;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.typeform-container .gfield_checkbox li:hover,
.typeform-container .gfield_radio li:hover {
    background: #f0f7ff;
    border-color: #567EC0;
}

.typeform-container .gfield_checkbox li input:checked + label,
.typeform-container .gfield_radio li input:checked + label {
    background: #567EC0;
    color: white;
}

/* Contact fields styling - simplified for single column */
.typeform-container .gfield.active {
    width: 100% !important;
    display: block !important;
}

/* description styles */
.typeform-container .gfield_description {
    font-size: 1.5rem !important;
    font-style: italic;
}

/* Section headers for pledge actions */
.typeform-section-header {
    font-size: 1.8rem;
    font-weight: 600;
    color: #567EC0;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.typeform-section-header:first-of-type {
    margin-top: 0;
}

/* Navigation buttons */
.typeform-navigation {
    margin-top: 3rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    padding: 0;
}

.typeform-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.typeform-btn-back {
    background: #f0f0f0;
    color: #666;
}

.typeform-btn-back:hover {
    background: #e0e0e0;
}

.typeform-btn-continue {
    background: #567EC0;
    color: white;
    box-shadow: 0 4px 15px rgba(86, 126, 192, 0.3);
}

.typeform-btn-continue:hover {
    background: #618dd4;
    box-shadow: 0 6px 20px rgba(86, 126, 192, 0.4);
    transform: translateY(-2px);
}

.typeform-btn-continue:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Add "or press ENTER" text */
.typeform-navigation::after {
    content: "or press ENTER";
    color: #999;
    font-size: 0.85rem;
    font-style: italic;
    margin-left: 1rem;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
}

/* Spanish: "o presiona ENTER" */
:lang(es) .typeform-navigation::after,
body.typeform-spanish .typeform-navigation::after {
    content: "o presiona ENTER";
}

/* Error styling */
.typeform-error {
    color: #e74c3c;
    font-size: 1rem;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.typeform-error.show {
    opacity: 1;
}

/* Hide original form elements */
.typeform-container .gform_footer {
    display: none;
}

.typeform-container .gfield_label {
    display: none;
}

/* Question counter */
.typeform-counter {
    display: block;
    text-align: center;
    background: transparent;
    color: #567EC0;
    padding: 1rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .typeform-counter {
        padding: 0.75rem 0;
        font-size: 0.85rem;
        margin-top: 0.75rem;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .typeform-container {
        max-width: 100%;
        padding: 40px 15px;
    }
    
    .typeform-question {
        font-size: 1.8rem;
        white-space: normal;
        width: 100%;
        min-width: auto;
    }
    
    .typeform-container input[type="text"],
    .typeform-container input[type="email"],
    .typeform-container select {
        font-size: 1.2rem !important;
    }
    
    .typeform-navigation {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 0;
    }
    
    .typeform-navigation::after {
        display: none;
    }
    
    .typeform-btn {
        width: 100%;
        max-width: none;
    }
    
    .typeform-question-image {
        height: 150px;
        margin-bottom: 1.5rem;
    }
    
    .typeform-question-image.no-image::before {
        font-size: 2rem;
    }
}

/* Loading animation */
.typeform-loading {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    min-height: 200px;
}

.typeform-loading p {
    margin: 0.25rem 0;
}

.typeform-spinner {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #567EC0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success screen */
.typeform-success {
    text-align: center;
    padding: 4rem 2rem;
}

.typeform-success h2 {
    color: #567EC0;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.typeform-success p {
    font-size: 1.2rem;
    color: #666;
    max-width: 500px;
    margin: 0 auto;
}

/* RESET GLOBAL CHECKBOX STYLES FOR TYPEFORM - REMOVE TOP POSITIONING */
.typeform-container input[type=checkbox] + label::before,
.typeform-container input[type=radio] + label::before {
  top: unset !important;
  position: relative !important;
  vertical-align: middle !important;
  margin-left: 10px !important;
  margin-right: 10px !important;
}

.typeform-container input[type=checkbox] + label,
.typeform-container input[type=radio] + label {
  padding-left: 0 !important;
  display: flex !important;
  align-items: center !important;
}

/* Share checkbox - long sentence needs wider, wrapping layout (all forms) */
.ccad-share-field .gfield_description {
  margin-bottom: 1.5rem !important;
}

.ccad-share-field .gfield_checkbox {
  margin-top: 1.5rem !important;
}

.ccad-share-field .gfield_checkbox li {
  max-width: 100% !important;
  padding: 1.2rem 1.5rem !important;
}

.typeform-container .ccad-share-field input[type=checkbox] + label,
.ccad-share-field .gfield_checkbox li label,
.ccad-share-field .gchoice label {
  display: inline !important;
  white-space: normal !important;
  line-height: 1.6 !important;
  font-size: 1.25rem !important;
}

.typeform-container .ccad-share-field input[type=checkbox] + label::before,
.ccad-share-field .gfield_checkbox li label::before,
.ccad-share-field .gchoice label::before {
  display: inline-block !important;
  flex-shrink: 0;
  vertical-align: middle !important;
  margin-right: 12px !important;
}

/* Override in all media queries too */
@media (max-width: 1199px) {
  .typeform-container input[type=checkbox] + label::before,
  .typeform-container input[type=radio] + label::before {
    top: unset !important;
    position: relative !important;
    vertical-align: middle !important;
  }
}

@media (max-width: 767px) {
  .typeform-container input[type=checkbox] + label::before,
  .typeform-container input[type=radio] + label::before {
    top: unset !important;
    position: relative !important;
    vertical-align: middle !important;
  }
  
  .typeform-container input[type=checkbox] + label,
  .typeform-container input[type=radio] + label {
    padding-left: 0 !important;
  }
}