/**
 * TKPP Freebie Funnel — Modal styles
 */

.tkfb-modal {
    position: fixed; inset: 0; z-index: 999999;
    display: flex !important; align-items: center; justify-content: center;
    padding: 20px;
}

.tkfb-modal[style*="none"] { display: none !important; }

.tkfb-modal-overlay {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: tkfbFadeIn 0.25s ease;
}

.tkfb-modal-wrap {
    position: relative; width: 100%; max-width: 460px;
    background: #fff; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    animation: tkfbSlideUp 0.3s ease;
    max-height: 90vh; overflow-y: auto;
}

@keyframes tkfbFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes tkfbSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tkfb-modal-close {
    position: absolute; top: 12px; right: 12px;
    background: rgba(0,0,0,0.05); border: none;
    width: 32px; height: 32px; border-radius: 50%;
    font-size: 20px; cursor: pointer;
    color: #666; line-height: 1; padding: 0;
    z-index: 2; transition: all 0.2s;
}
.tkfb-modal-close:hover { background: rgba(0,0,0,0.1); color: #000; }

.tkfb-modal-header {
    text-align: center;
    padding: 32px 24px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-bottom: 1px solid #f0f0f0;
}

.tkfb-modal-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
    margin-bottom: 14px;
}

.tkfb-modal-icon.tkfb-success-icon {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.tkfb-modal-icon.tkfb-error-icon {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.3);
}

.tkfb-modal-header h3 {
    color: #2c2c2c !important; font-size: 20px !important;
    font-weight: 700 !important; margin: 0 0 6px !important;
}

.tkfb-modal-product-name {
    color: #FF6B35 !important; font-size: 14px !important;
    font-weight: 600 !important; margin: 0 !important;
    word-break: break-word;
}

/* Tabs */
.tkfb-tabs {
    display: flex; gap: 0;
    border-bottom: 2px solid #e5e5e5;
    margin: 0 24px;
}

.tkfb-tab {
    flex: 1; background: transparent; border: none;
    padding: 12px 8px; cursor: pointer;
    color: #888; font-weight: 600; font-size: 13px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.tkfb-tab:hover { color: #555; }
.tkfb-tab.active {
    color: #FF6B35;
    border-bottom-color: #FF6B35;
}

.tkfb-tab-content {
    display: none;
    padding: 24px;
}
.tkfb-tab-content.active { display: block; }

/* Form */
.tkfb-field { margin-bottom: 14px; }
.tkfb-field label {
    display: block; font-size: 13px;
    font-weight: 600; color: #2c2c2c;
    margin-bottom: 6px;
}
.tkfb-req { color: #dc3545; }

.tkfb-field input[type="text"],
.tkfb-field input[type="email"] {
    width: 100% !important; padding: 11px 14px !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 8px !important; font-size: 14px !important;
    transition: border-color 0.2s; box-sizing: border-box;
}
.tkfb-field input:focus {
    outline: none !important;
    border-color: #FF6B35 !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1) !important;
}

.tkfb-checkbox {
    display: flex !important; align-items: flex-start; gap: 8px;
    cursor: pointer; font-weight: 400 !important;
    font-size: 13px !important; color: #555 !important;
}
.tkfb-checkbox input[type="checkbox"] {
    margin-top: 2px; flex-shrink: 0;
}

.tkfb-submit-btn {
    display: flex !important; align-items: center; justify-content: center;
    width: 100%; padding: 14px 20px !important;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: #fff !important; border: none !important;
    border-radius: 8px !important;
    font-size: 14px !important; font-weight: 700 !important;
    cursor: pointer; transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(40, 167, 69, 0.3);
    margin-top: 6px;
}
.tkfb-submit-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(40, 167, 69, 0.4);
}
.tkfb-submit-btn:disabled {
    opacity: 0.6; cursor: not-allowed; transform: none !important;
}

.tkfb-disclaimer {
    text-align: center; font-size: 11px;
    color: #888 !important; margin: 12px 0 0 !important;
    line-height: 1.5;
}

/* Success view */
.tkfb-view[data-view="success"] {
    padding: 0 0 24px;
}
.tkfb-success-msg {
    padding: 20px 24px 0; font-size: 14px;
    line-height: 1.6; color: #555 !important;
    margin: 0 !important;
}
.tkfb-success-tips {
    background: #f8f9fa; margin: 16px 24px;
    padding: 14px 16px; border-radius: 8px;
    border-left: 3px solid #FF6B35;
}
.tkfb-success-tips p { margin: 0 0 6px !important; font-size: 13px !important; color: #2c2c2c !important; }
.tkfb-success-tips ul { margin: 0; padding-left: 18px; }
.tkfb-success-tips li { font-size: 12px !important; color: #555 !important; line-height: 1.7 !important; }
.tkfb-success-tips code { background: #fff; padding: 1px 6px; border-radius: 3px; font-size: 11px; color: #c7254e; }

.tkfb-close-btn,
.tkfb-back-btn {
    margin: 0 24px !important;
    width: calc(100% - 48px) !important;
}

.tkfb-error-msg {
    padding: 0 24px; text-align: center;
    color: #555; font-size: 14px;
    margin: 16px 0 20px !important;
}

/* Mobile */
@media (max-width: 480px) {
    .tkfb-modal { padding: 12px; }
    .tkfb-modal-wrap { max-width: 100%; }
    .tkfb-modal-header { padding: 24px 20px 16px; }
    .tkfb-tab-content { padding: 20px; }
}
