/**
 * 4tobefree Survey - WordPress Plugin Styles
 * Custom Color Scheme: #F3F8FC, #FE8916, #113057
 */

/* ============================================ */
/* RESET & BASE STYLES */
/* ============================================ */

:root {
    --primary-color: #113057;      /* Dark Blue - Primary */
    --secondary-color: #FE8916;    /* Orange - Accent/Sporty */
    --bg-light: #FFF8F0;           /* Light Orange Tint */
    --bg-white: #ffffff;
    --error-color: #dc3545;
    --success-color: #28a745;
    --text-primary: #113057;
    --text-secondary: #5a6c7d;
    --border-color: #FFD6A5;       /* Light Orange Border */
    --border-radius: 12px;
    --shadow-sm: 0 2px 4px 0 rgba(254, 137, 22, 0.1);
    --shadow-md: 0 4px 12px -1px rgba(254, 137, 22, 0.2);
    --shadow-lg: 0 12px 24px -3px rgba(254, 137, 22, 0.3);
}

.ftbf-survey-container {
    max-width: 900px;
    margin: 40px auto;
    background: #ffffff95;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(254, 137, 22, 0.15), 0 0 0 3px rgba(254, 137, 22, 0.1);
    padding: 40px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    border-top: 5px solid var(--secondary-color);
}

/* ============================================ */
/* PROGRESS BAR */
/* ============================================ */

.ftbf-progress-wrapper {
    margin-bottom: 30px;
}

.ftbf-progress-bar {
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg, #FFE5CC, #FFF0E0);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid var(--secondary-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.ftbf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF6B00, var(--secondary-color), #FFB800);
    background-size: 200% 100%;
    border-radius: 20px;
    transition: width 0.5s ease;
    animation: shimmer 2s infinite;
    box-shadow: 0 2px 8px rgba(254, 137, 22, 0.4);
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.ftbf-progress-text {
    text-align: center;
    color: var(--secondary-color);
    font-size: 15px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ============================================ */
/* TYPOGRAPHY */
/* ============================================ */

.ftbf-survey-container h1 {
    font-size: 36px;
    font-weight: 800;
    color:black;
    background-clip: text;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(254, 137, 22, 0.2);
}

.ftbf-survey-container h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 4px solid var(--secondary-color);
    position: relative;
}

.ftbf-survey-container h2::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--primary-color);
}

.ftbf-survey-container h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--secondary-color);
    margin-top: 20px;
    margin-bottom: 10px;
}

.ftbf-intro-text {
    font-size: 16px;
    color: black;
    margin-bottom: 20px;
    line-height: 1.8;
}

/* ============================================ */
/* NOTE BOX */
/* ============================================ */

.ftbf-note-box {
    background: linear-gradient(135deg, #FFF5E6, #FFE8CC);
    border-left: 6px solid var(--secondary-color);
    border-right: 6px solid var(--secondary-color);
    padding: 20px 25px;
    margin-bottom: 30px;
    border-radius: 15px;
    font-size: 14px;
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(254, 137, 22, 0.15);
    position: relative;
    overflow: hidden;
}

.ftbf-note-box::before {
    content: '⚡';
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 40px;
    opacity: 0.2;
}

.ftbf-note-box strong {
    color: var(--secondary-color);
    font-weight: 700;
}

/* ============================================ */
/* FORM STEPS */
/* ============================================ */

.ftbf-form-step {
    display: none;
    animation: ftbfSlideIn 0.3s ease-out;
}

.ftbf-form-step.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force thank you page to show when has inline style */
#ftbfThankYouStep[style*="display: block"],
#ftbfThankYouStep[style*="display:block"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

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

/* ============================================ */
/* FORM GROUPS */
/* ============================================ */

.ftbf-form-group {
    margin-bottom: 25px;
}

.ftbf-form-group.required > label:first-child::after {
    content: ' *';
    color: var(--error-color);
    font-weight: bold;
}

.ftbf-form-group label {
    display: flex;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 16rpx;
}

.ftbf-form-group.error {
    animation: ftbfShake 0.3s;
}

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

/* ============================================ */
/* INPUT FIELDS */
/* ============================================ */

.ftbf-survey-container input[type="email"],
.ftbf-survey-container input[type="text"],
.ftbf-survey-container select,
.ftbf-survey-container textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.3s ease;
    background: var(--bg-white);
}

.ftbf-survey-container input[type="email"]:focus,
.ftbf-survey-container input[type="text"]:focus,
.ftbf-survey-container select:focus,
.ftbf-survey-container textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    border-width: 3px;
    box-shadow: 0 0 0 4px rgba(254, 137, 22, 0.2), 0 4px 12px rgba(254, 137, 22, 0.3);
    background: #FFF9F5;
}

.ftbf-survey-container input.error,
.ftbf-survey-container select.error,
.ftbf-survey-container textarea.error {
    border-color: var(--error-color);
}

.ftbf-survey-container textarea {
    resize: vertical;
    min-height: 100px;
}

.ftbf-survey-container select {
    cursor: pointer;
}

/* ============================================ */
/* RADIO BUTTONS & CHECKBOXES */
/* ============================================ */

.ftbf-radio-label,
.ftbf-checkbox-label {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    margin-bottom: 10px;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    background: var(--bg-white);
    position: relative;
}

.ftbf-radio-label:hover,
.ftbf-checkbox-label:hover {
    background: linear-gradient(135deg, #FFF8F0, #FFEDD5);
    border-color: var(--secondary-color);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(254, 137, 22, 0.2);
}

.ftbf-radio-label input[type="radio"],
.ftbf-checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    accent-color: var(--secondary-color);
}

.ftbf-radio-label:has(input:checked),
.ftbf-checkbox-label:has(input:checked) {
    background: linear-gradient(135deg, #FFE8CC, #FFD6A5);
    border-color: var(--secondary-color);
    border-width: 3px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(254, 137, 22, 0.3);
    color: var(--primary-color);
}

.ftbf-radio-label:has(input:checked)::before,
.ftbf-checkbox-label:has(input:checked)::before {
    content: '✓';
    position: absolute;
    right: 15px;
    color: var(--secondary-color);
    font-weight: 900;
    font-size: 20px;
}

/* ============================================ */
/* SPORT CATEGORIES */
/* ============================================ */

.ftbf-sport-category {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #FFF9F0, #FFF0E0);
    border-radius: 15px;
    border: 3px solid var(--secondary-color);
    box-shadow: 0 4px 15px rgba(254, 137, 22, 0.1);
    position: relative;
}

.ftbf-sport-category::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(135deg, var(--secondary-color), #FFB800);
    border-radius: 15px;
    z-index: -1;
    opacity: 0.3;
}

.ftbf-sport-category h4 {
    margin-top: 0;
    padding: 8px 15px;
    background: var(--secondary-color);
    color: white;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(254, 137, 22, 0.3);
}

.ftbf-sport-category .ftbf-checkbox-label {
    background: var(--bg-white);
    margin-bottom: 6px;
}

/* ============================================ */
/* BUTTONS */
/* ============================================ */

.ftbf-btn {
    padding: 14px 10px;
    font-size: 16px;
    font-weight: 600;
    border: none !important;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
    outline: none !important;
	width: 100% !important;
}

.ftbf-btn-next,
.ftbf-btn-submit {
    background: linear-gradient(135deg, var(--primary-color), #1a5090) !important;
    color: white !important;
    margin-right: 10px;
    box-shadow: 0 4px 15px rgba(17, 48, 87, 0.25);
    border: none !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    outline: none !important;
	font-size: 15px;
}

.ftbf-btn-next::before,
.ftbf-btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.6s ease;
}

.ftbf-btn-next:hover::before,
.ftbf-btn-submit:hover::before {
    left: 100%;
}

.ftbf-btn-next:hover,
.ftbf-btn-submit:hover {
    background: linear-gradient(135deg, var(--primary-color), #1a5090, #2563a8);
    color: white !important;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(17, 48, 87, 0.4), 0 0 0 2px var(--secondary-color);
    border: none !important;
}

.ftbf-btn-next:active,
.ftbf-btn-submit:active {
    transform: translateY(-1px) scale(0.98);
}

.ftbf-btn-back {
    background: linear-gradient(135deg, var(--primary-color), #1a5090) !important;
    color: white !important;
    border: none !important;
    margin-right: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-sizing: border-box;
    outline: none !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 4px 15px rgba(17, 48, 87, 0.25);
    opacity: 0.9;
}

.ftbf-btn-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.6s ease;
}

.ftbf-btn-back:hover::before {
    left: 100%;
}

.ftbf-btn-back:hover {
    background: linear-gradient(135deg, var(--primary-color), #1a5090, #2563a8) !important;
    color: white !important;
    border: none !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(17, 48, 87, 0.4);
    opacity: 1;
}

.ftbf-btn-back:active {
    transform: translateY(0) scale(0.98);
}

.ftbf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================ */
/* LOADING SPINNER */
/* ============================================ */

#ftbfLoadingSpinner {
    text-align: center;
    padding: 40px;
    display: none;
}

.ftbf-spinner {
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: ftbfSpin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* ============================================ */
/* ERROR & SUCCESS MESSAGES */
/* ============================================ */

.ftbf-error-box {
    background: #fee;
    border-left: 4px solid var(--error-color);
    padding: 15px 20px;
    margin-top: 20px;
    border-radius: var(--border-radius);
    color: #991b1b;
    font-weight: 500;
}

.ftbf-success-box {
    background: #d4edda;
    border-left: 4px solid var(--success-color);
    padding: 15px 20px;
    margin-top: 20px;
    border-radius: var(--border-radius);
    color: #155724;
    font-weight: 500;
}

.ftbf-info-box {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    border-left: 4px solid var(--primary-color);
    border-right: 4px solid var(--primary-color);
    padding: 15px 20px;
    margin-top: 20px;
    border-radius: var(--border-radius);
    color: var(--primary-color);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(17, 48, 87, 0.15);
}

.ftbf-info-box strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* ============================================ */
/* THANK YOU PAGE */
/* ============================================ */

.ftbf-thank-you-message {
    text-align: center;
    padding: 60px 20px;
    min-height: 400px;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    visibility: visible !important;
    opacity: 1 !important;
}

.ftbf-thank-you-message * {
    visibility: visible !important;
    opacity: 1 !important;
}

.ftbf-thank-you-message h1 {
    font-size: 56px;
    background: linear-gradient(135deg, var(--secondary-color), #FFB800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    font-weight: 900;
    animation: pulse 2s infinite;
    display: block !important;
    visibility: visible !important;
}

.ftbf-thank-you-message p {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.ftbf-thank-you-text {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.8;
}

.ftbf-thank-you-message p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ============================================ */
/* CONDITIONAL FIELDS */
/* ============================================ */

.ftbf-conditional {
    animation: ftbfFadeIn 0.3s ease-in;
}

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

/* ============================================ */
/* RESPONSIVE DESIGN */
/* ============================================ */

@media (max-width: 768px) {
    .ftbf-survey-container {
        padding: 25px 20px;
        margin: 20px 10px;
        border-radius: 8px;
    }
    
    .ftbf-survey-container h1 {
        font-size: 26px;
    }
    
    .ftbf-survey-container h2 {
        font-size: 20px;
    }
    
    .ftbf-btn {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .ftbf-sport-category {
        padding: 15px;
    }
    
    .ftbf-radio-label,
    .ftbf-checkbox-label {
        padding: 10px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .ftbf-survey-container {
        padding: 20px 15px;
    }
    
    .ftbf-survey-container h1 {
        font-size: 22px;
    }
    
    .ftbf-survey-container h2 {
        font-size: 18px;
    }
    
    .ftbf-intro-text {
        font-size: 14px;
    }
    
    .ftbf-note-box {
        font-size: 13px;
        padding: 12px 15px;
    }
}

/* ============================================ */
/* ACCESSIBILITY */
/* ============================================ */

.ftbf-survey-container :focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #113057;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ftbf-survey-container * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================ */
/* WORDPRESS INTEGRATION FIXES */
/* ============================================ */

.ftbf-survey-container * {
    box-sizing: border-box;
}

.ftbf-survey-container input[type="checkbox"],
.ftbf-survey-container input[type="radio"] {
    margin: 0;
    margin-right: 12px;
}

/* ============================================ */
/* THANK YOU MODAL POPUP */
/* ============================================ */

.ftbf-modal {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
}

.ftbf-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 48, 87, 0.85);
    backdrop-filter: blur(5px);
}

.ftbf-modal-content {
    position: relative;
    max-width: 500px;
    margin: 100px auto;
    background: white;
    padding: 50px 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 3px solid var(--secondary-color);
    animation: modalSlideIn 0.5s ease-out;
    z-index: 100000;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ftbf-modal-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--secondary-color), #FFB800);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    margin: 0 auto 30px;
    animation: checkPop 0.6s ease-out 0.3s both;
    box-shadow: 0 10px 30px rgba(254, 137, 22, 0.4);
}

@keyframes checkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.ftbf-modal-content h2 {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 800;
    border: none !important;
    padding: 0 !important;
}

.ftbf-modal-content h2::after {
    display: none !important;
}

.ftbf-modal-content p {
    font-size: 18px;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.ftbf-modal-content button {
    margin-top: 30px !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ftbf-modal-content {
        margin: 50px 10px;
        padding: 40px 10px;
    }
    
    .ftbf-modal-icon {
        width: 60px;
        height: 60px;
        font-size: 36px;
    }
    
    .ftbf-modal-content h2 {
        font-size: 24px;
    }
    
    .ftbf-modal-content p {
        font-size: 16px;
    }
}

