/* 
 * App MoneyHunt Quiz Styles
 * Integrated with Visual Styleguide
 * =====================================================
 * 
 * This stylesheet uses ID-based prefixing to ensure styles override generic ClickFunnels styles.
 * All selectors are prefixed with #app-prequiz-v1 to increase specificity.
 */

/* Reset and Base Styles */
body {
    margin: 0;
    padding: 0;
    background: var(--matte-black);
}

#app-prequiz-v1 * {
    box-sizing: border-box;
}

#app-prequiz-v1 {
    margin: 0 auto;
    padding: 0;
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--white);
    background-color: transparent;
    width: 100%;
    max-width: var(--max-width-wide);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: pan-y;
}

/* Module Wrapper Container */
#app-prequiz-v1 .module-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 0;
    background: transparent;
    position: relative;
    overflow: visible;
    z-index: 1;
}

@media (max-width: 768px) {
    #app-prequiz-v1 .module-wrapper {
        max-width: 100%;
    }
}

/* Quiz Container */
#app-prequiz-v1 .prequiz-container {
    width: 100%;
    padding: 0;
    overflow-y: auto;
    position: relative;
}

/* Add tire tread pattern to quiz container */
#app-prequiz-v1 .prequiz-container.tire-tread-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.08; /* Increased from 0.02 for better visibility */
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 20px,
        transparent 20px,
        transparent 30px,
        rgba(255, 255, 255, 0.03) 30px,
        rgba(255, 255, 255, 0.03) 40px
    ),
    repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 20px,
        transparent 20px,
        transparent 30px,
        rgba(255, 255, 255, 0.03) 30px,
        rgba(255, 255, 255, 0.03) 40px
    );
    z-index: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    #app-prequiz-v1 .prequiz-container {
        padding: 0;
    }
}

/* Checkout Container */
#app-prequiz-v1 .postquiz-container {
    width: 100%;
    padding: 0;
    overflow-y: auto;
    position: relative;
}

@media (max-width: 768px) {
    #app-prequiz-v1 .postquiz-container {
        padding: 0;
    }
}

/* ThankYou Container */
#app-prequiz-v1 .thankyou-container {
    width: 100%;
    padding: 0;
    overflow-y: auto;
    position: relative;
}

@media (max-width: 768px) {
    #app-prequiz-v1 .thankyou-container {
        padding: 0;
    }
}

/* Progress Bar */
#app-prequiz-v1 .progress-container {
    position: relative;
    width: 100%;
    height: 12px;
    background-color: var(--dark-grey);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#app-prequiz-v1 .progress-bar {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    direction: ltr;
    background-color: transparent;
    border-radius: var(--radius-full);
}

#app-prequiz-v1 .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ford-red), var(--progress-light-blue));
    transition: width var(--transition-premium);
    will-change: width;
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: left center;
    direction: ltr;
    box-shadow: 0 0 20px rgba(0, 102, 204, 0.5); /* Progress bar glow - intentional animation effect */
    border-radius: var(--radius-full);
}

/* Progress fill glow effect */
#app-prequiz-v1 .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    animation: progress-glow 2s ease-in-out infinite;
}

@keyframes progress-glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Quiz Questions */
#app-prequiz-v1 .prequiz-question {
    display: none;
}

#app-prequiz-v1 .prequiz-question.active {
    display: block;
}

/* Checkout Steps */
#app-prequiz-v1 .postquiz-step {
    display: none;
}

#app-prequiz-v1 .postquiz-step.active {
    display: block;
}

/* ThankYou Steps */
#app-prequiz-v1 .thankyou-step {
    display: none;
}

#app-prequiz-v1 .thankyou-step.active {
    display: block;
}

#app-prequiz-v1 .question-content {
    background: transparent;
    padding: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    #app-prequiz-v1 .question-content {
        /* min-height removed */
    }
}

/* Quiz Content Typography */
#app-prequiz-v1 .preheadline {
    font-family: var(--font-accent);
    font-size: var(--font-size-sm);
    color: var(--silver-metallic);
    margin-bottom: var(--spacing-md);
    text-align: center;
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wider);
    text-transform: uppercase;
}

#app-prequiz-v1 .headline {
    font-family: var(--font-headline);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    color: var(--matte-black);
    margin: 0 0 var(--spacing-xs) 0;
    text-align: center;
    line-height: var(--line-height-tight);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

#app-prequiz-v1 #prequiz_q11_headline {
    text-align: left;
}

@media (max-width: 768px) {
    #app-prequiz-v1 .headline {
        font-size: var(--font-size-2xl);
        margin-bottom: var(--spacing-md);
    }
}

#app-prequiz-v1 .subheadline {
    font-family: var(--font-primary);
    font-size: var(--font-size-xl);
    color: var(--silver-metallic);
    margin-bottom: var(--spacing-md);
    text-align: center;
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-relaxed);
}

@media (max-width: 768px) {
    #app-prequiz-v1 .subheadline {
        font-size: var(--font-size-base);
    }
}

/* Special styling for step 3 */
#app-prequiz-v1 #prequiz-q3 .headline {
    font-size: var(--font-size-5xl);
    text-transform: uppercase;
    margin-bottom: var(--spacing-md);
}

#app-prequiz-v1 #prequiz-q3 .subheadline:first-of-type {
    font-size: var(--font-size-2xl);
    color: var(--white);
    margin-bottom: var(--spacing-md);
    font-weight: var(--font-weight-semibold);
}

#app-prequiz-v1 #prequiz-q3 .subheadline:first-of-type s {
    color: var(--medium-grey);
    text-decoration: line-through;
    opacity: 0.7;
}

#app-prequiz-v1 #prequiz-q3 .subheadline:nth-of-type(2) {
    background: var(--warning-orange);
    color: var(--white);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    display: inline-block;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

#app-prequiz-v1 #prequiz-q3 .subheadline:last-of-type {
    font-size: var(--font-size-base);
    color: var(--silver-metallic);
    font-style: italic;
}

/* Button Container */
#app-prequiz-v1 .button-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

/* Button Styling - Raptor Theme */
#app-prequiz-v1 .btn {
    width: 100%;
    margin-bottom: var(--spacing-md);
    font-family: var(--font-headline);
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    background-color: var(--warning-orange) !important;
    color: var(--white) !important;
    font-size: var(--font-size-xl) !important;
    font-weight: var(--font-weight-bold) !important;
    border: none !important;
    text-transform: uppercase;
    padding: var(--spacing-lg) var(--spacing-xl) !important;
    border-radius: var(--radius-lg) !important;
}

/* Premium hover effect */
#app-prequiz-v1 .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

#app-prequiz-v1 .btn:hover {
    background-color: var(--warning-orange) !important;
    filter: brightness(1.1);
}

#app-prequiz-v1 .btn:hover::before {
    left: 100%;
}

#app-prequiz-v1 .btn:active {
}

/* Large button variant */
#app-prequiz-v1 .btn-large {
    width: 100%;
    padding: 20px 40px !important;
}

/* Form submit button - Ford blue variant */
#app-prequiz-v1 #form_button_signup {
    width: 100%;
    background-color: var(--warning-orange) !important;
}

#app-prequiz-v1 #form_button_signup:hover {
    background-color: var(--warning-orange) !important;
    filter: brightness(1.1);
}

/* Disabled state */
#app-prequiz-v1 .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Registration Form Styles */
#app-prequiz-v1 .registration-form {
    margin-top: var(--spacing-md);
}

#app-prequiz-v1 .form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

@media (max-width: 768px) {
    #app-prequiz-v1 .form-row {
        grid-template-columns: 1fr;
    }
}

#app-prequiz-v1 .form-group {
    margin-bottom: var(--spacing-md);
}


/* International Tel Input - Full Width */
#app-prequiz-v1 .iti {
    width: 100%;
    display: block;
}

/* International Tel Input - Override inherited white color */
#app-prequiz-v1 .iti__flag-container {
    background: var(--light-gray);
    color: var(--text-primary);
}

#app-prequiz-v1 .iti__selected-flag {
    background-color: var(--light-gray);
    color: var(--text-primary);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

#app-prequiz-v1 .iti__selected-dial-code {
    color: var(--text-primary);
}

/* International Tel Input - Country List Styling */
#app-prequiz-v1 .iti__country-list {
    background: var(--light-gray);
    border: 1px solid var(--medium-gray);
    box-shadow: var(--shadow-sm);
}

#app-prequiz-v1 .iti__country {
    background: var(--light-gray);
    color: var(--text-primary);
}

#app-prequiz-v1 .iti__country:hover {
    background: var(--medium-gray);
}

#app-prequiz-v1 .iti__country.iti__highlight {
    background: var(--medium-gray);
}

#app-prequiz-v1 .iti__flag-box,
#app-prequiz-v1 .iti__country-name,
#app-prequiz-v1 .iti__dial-code {
    color: var(--text-primary);
}


#app-prequiz-v1 .form-group label {
    display: none;
    font-family: var(--font-accent);
}

#app-prequiz-v1 .form-group input[type="text"],
#app-prequiz-v1 .form-group input[type="email"],
#app-prequiz-v1 .form-group input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    font-size: var(--font-size-base);
    border: 1px solid var(--medium-gray);
    border-radius: var(--radius-lg);
    background: var(--light-gray);
    transition: none;
    font-family: var(--font-headline);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}

#app-prequiz-v1 .form-group input:focus {
    outline: none;
    border-color: var(--dark-gray);
    box-shadow: none;
    background: var(--light-gray);
}

#app-prequiz-v1 .form-group input::placeholder {
    color: var(--dark-gray);
    font-style: normal;
}

/* Error States */
#app-prequiz-v1 .error-message {
    color: var(--warning-orange);
    font-size: var(--font-size-xs);
    margin-top: 4px;
    display: none;
    font-weight: var(--font-weight-medium);
    text-align: left;
}

#app-prequiz-v1 .error-message.show {
    display: block;
}

/* Tier error messages in postquiz */
.tier-error-message {
    background-color: #fee;
    color: #c33;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #fcc;
    display: none;
}

.tier-error-message.show {
    display: block;
}

#app-prequiz-v1 input.error {
    border-color: var(--warning-orange);
    box-shadow: var(--glow-warning-subtle);
}

/* Registration loading animation */
#app-prequiz-v1 .registration-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    min-height: 300px;
}

#app-prequiz-v1 .loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: var(--spacing-xl);
}

#app-prequiz-v1 .spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

#app-prequiz-v1 .loading-text {
    font-size: var(--font-size-lg);
    color: var(--white);
    text-align: center;
    margin: 0;
    font-weight: var(--font-weight-medium);
}

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

/* Checkbox Styles */
#app-prequiz-v1 .checkbox-group {
}

#app-prequiz-v1 .checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

#app-prequiz-v1 .checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: var(--light-gray);
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    position: relative;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

#app-prequiz-v1 .checkbox-container input[type="checkbox"]:checked {
    background: var(--ford-red);
    border-color: var(--ford-red);
}

#app-prequiz-v1 .checkbox-container input[type="checkbox"]:checked::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 14px;
    font-weight: bold;
}

#app-prequiz-v1 .checkbox-container input[type="checkbox"]:hover {
    border-color: var(--ford-red);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1); /* Lighter checkbox hover glow */
}

#app-prequiz-v1 .checkbox-container label {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1.5;
    text-align: left;
}

#app-prequiz-v1 .checkbox-text {
    font-family: var(--font-primary);
}

/* Premium visual enhancements */

/* Card glow effect on hover */
#app-prequiz-v1 .module-wrapper {
    transition: none;
}

/* Tire tread pattern for module wrapper sections */
#app-prequiz-v1 .module-wrapper.tire-tread-pattern {
    position: relative;
}

#app-prequiz-v1 .module-wrapper.tire-tread-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.06; /* Subtle on module sections */
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 20px,
        transparent 20px,
        transparent 30px,
        rgba(255, 255, 255, 0.03) 30px,
        rgba(255, 255, 255, 0.03) 40px
    ),
    repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 20px,
        transparent 20px,
        transparent 30px,
        rgba(255, 255, 255, 0.03) 30px,
        rgba(255, 255, 255, 0.03) 40px
    );
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
}

/* Upsell Content Styles */
#app-prequiz-v1 .upsell-content {
    text-align: center;
}

/* Tier Selection Styles */
#app-prequiz-v1 .tier-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

#app-prequiz-v1 .tier-option {
    background: var(--white);
    border: 2px solid var(--medium-gray);
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    transition: all var(--transition-slow);
}

#app-prequiz-v1 .tier-option:hover {
    /* Minimal hover for content cards */
    box-shadow: var(--shadow-lg);
}

#app-prequiz-v1 .tier-option.featured {
    border-color: var(--primary-orange);
    transform: scale(1.05);
}

#app-prequiz-v1 .tier-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--warning-orange);
    color: var(--text-primary);
    padding: 6px 20px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 1;
}

#app-prequiz-v1 .tier-header {
    padding: 32px 24px 24px;
    text-align: center;
    color: var(--text-primary);
    position: relative;
}

#app-prequiz-v1 .tier-name {
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    margin: 0 0 16px 0;
}

#app-prequiz-v1 .tier-price {
    font-size: 36px;
    font-weight: 800;
}

#app-prequiz-v1 .price-period {
    font-size: 18px;
    font-weight: 400;
    opacity: 0.9;
}

#app-prequiz-v1 .tier-body {
    padding: var(--spacing-lg);
}

#app-prequiz-v1 .tier-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

#app-prequiz-v1 .tier-features li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

#app-prequiz-v1 .tier-features i {
    color: var(--success-green);
}

/* Skip Button - now uses primary button style */
#app-prequiz-v1 .skip-button {
    /* All skip buttons now use btn-primary styling */
}

/* Loading State */
#app-prequiz-v1 .button-loading {
    position: relative;
    color: transparent;
}

#app-prequiz-v1 .button-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 767px) {
    #app-prequiz-v1 * {
        -webkit-backface-visibility: hidden;
    }
    
    #app-prequiz-v1 .tier-comparison {
        grid-template-columns: 1fr;
    }
    
    #app-prequiz-v1 .tier-option.featured {
        transform: none;
    }
}

/* Text Color Overrides - Raptor Theme */

#app-prequiz-v1 .prequiz-question .subheadline {
    color: var(--silver-metallic);
}

#app-prequiz-v1 .prequiz-question .preheadline {
    color: var(--silver-metallic);
}


#app-prequiz-v1 #postquiz_step1_headline {
    text-align: left;
    margin-bottom: var(--spacing-md);
}

#app-prequiz-v1 .postquiz-step .subheadline,
#app-prequiz-v1 .postquiz-step .preheadline,
#app-prequiz-v1 .postquiz-step p {
    color: var(--silver-metallic);
}

#app-prequiz-v1 .postquiz-step .tier-option .tier-name,
#app-prequiz-v1 .postquiz-step .tier-option .tier-price {
    color: var(--white);
}

#app-prequiz-v1 .postquiz-step .tier-option .tier-description,
#app-prequiz-v1 .postquiz-step .feature-list,
#app-prequiz-v1 .postquiz-step .feature-list li {
    color: var(--silver-metallic);
}

#app-prequiz-v1 .thankyou-step .headline {
    color: var(--white);
}

#app-prequiz-v1 .thankyou-step .subheadline,
#app-prequiz-v1 .thankyou-step .preheadline,
#app-prequiz-v1 .thankyou-step p {
    color: var(--silver-metallic);
}

/* Mobile-specific enhancements for Raptor theme */
@media (max-width: 768px) {
    /* Progress bar mobile adjustments */
    #app-prequiz-v1 .progress-container {
        height: 10px;
        margin-bottom: var(--spacing-lg);
    }
    
    /* Button mobile adjustments */
    #app-prequiz-v1 .btn {
        font-size: var(--font-size-lg) !important;
        padding: var(--spacing-md) var(--spacing-lg) !important;
    }
    
    /* Form mobile adjustments */
    #app-prequiz-v1 .form-group input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Special step 3 mobile adjustments */
    #app-prequiz-v1 #prequiz-q3 .subheadline:nth-of-type(2) {
        font-size: var(--font-size-base);
        padding: var(--spacing-xs) var(--spacing-md);
    }
    
    /* Ensure proper spacing on mobile */
    #app-prequiz-v1 .module-wrapper {
        padding: 0 var(--spacing-sm);
    }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    #app-prequiz-v1 .progress-container {
        margin-bottom: var(--spacing-md);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #app-prequiz-v1 .btn {
        border: 2px solid var(--white) !important;
    }
    
    #app-prequiz-v1 .form-group input {
        border-width: 3px;
    }
}