/* =========================================
   1. VARIABLES & FONTS
   ========================================= */
:root {
    --fpp-font-head: 'Libre Baskerville', serif;
    --fpp-font-body: 'DM Sans', sans-serif;
    --fpp-radius: 12px;
    --fpp-shadow: 0 10px 40px -10px rgba(0,0,0,0.08);
    --fpp-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Default fallback colors (will be overridden by settings) */
    --fpp-accent: #111111;
    --fpp-accent-text: #ffffff;
}

/* =========================================
   2. ADMIN DASHBOARD STYLES
   ========================================= */
.fpp-admin-wrapper {
    font-family: var(--fpp-font-body);
    max-width: 900px;
    margin: 40px auto;
    color: #333;
}
.fpp-header-section { margin-bottom: 40px; text-align: center; }
.fpp-heading {
    font-family: var(--fpp-font-head);
    font-size: 32px;
    font-weight: 700;
    color: #111;
    margin: 0 0 10px 0;
}
.fpp-subtext { font-size: 16px; color: #666; margin: 0; }

.fpp-admin-card {
    background: #fff;
    border-radius: var(--fpp-radius);
    padding: 30px;
    box-shadow: var(--fpp-shadow);
    margin-bottom: 30px;
    border: 1px solid rgba(0,0,0,0.04);
}
.fpp-card-title {
    font-family: var(--fpp-font-head);
    font-size: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-top: 0;
    margin-bottom: 25px;
}

/* Premium Table */
.fpp-premium-table { width: 100%; border-collapse: collapse; }
.fpp-premium-table th { text-align: left; color: #888; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; padding-bottom: 15px; border-bottom: 1px solid #eee; }
.fpp-premium-table td { padding: 20px 0; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
.fpp-premium-table tr:last-child td { border-bottom: none; }
.fpp-id { font-family: monospace; color: #999; }
.fpp-email { font-weight: 500; color: #111; font-size: 15px; }
.fpp-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em; }
.fpp-badge.pending { background: #fff4d9; color: #9c7b1e; }
.fpp-badge.approved { background: #dffbe2; color: #2d6b34; }
.fpp-badge.rejected { background: #fee2e2; color: #b91c1c; }

/* Admin Inputs & Buttons */
.fpp-input {
    width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px;
    box-sizing: border-box; transition: var(--fpp-transition);
}
.fpp-input:focus { border-color: #333; outline: none; box-shadow: 0 0 0 3px rgba(0,0,0,0.05); }
.code-font { font-family: monospace; font-size: 13px; background: #fafafa; }

.fpp-btn {
    display: inline-block; padding: 12px 24px; border-radius: 50px; text-decoration: none;
    font-weight: 600; cursor: pointer; border: none; transition: var(--fpp-transition);
}
.fpp-btn-primary { background: #111; color: #fff; }
.fpp-btn-primary:hover { background: #333; transform: translateY(-1px); }
.fpp-btn-outline { background: transparent; border: 1px solid #ddd; color: #555; padding: 8px 16px; font-size: 13px; }
.fpp-btn-outline:hover { border-color: #111; color: #111; }
.fpp-btn-secondary { background: #f0f0f0; color: #333; }
.full-width { width: 100%; margin-bottom: 10px; }

/* Visual Builder */
.fpp-builder-layout { display: flex; gap: 30px; align-items: flex-start; }
.fpp-iphone-view { flex: 2; min-height: 200px; }
.fpp-builder-sidebar { flex: 1; }
.sticky { position: sticky; top: 40px; }

.fpp-visual-field {
    background: #fff; border: 1px solid #eee; border-radius: 8px; margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02); overflow: hidden; cursor: move;
}
.fpp-field-header { padding: 15px; display: flex; align-items: center; justify-content: space-between; background: #fdfdfd; }
.fpp-step-badge { background: #eee; font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 3px 6px; border-radius: 4px; margin-right: 10px; }
.fpp-preview-label { font-weight: 500; font-size: 14px; }
.fpp-field-tools { display: flex; gap: 10px; color: #999; }
.fpp-field-tools span:hover { color: #111; cursor: pointer; }

.fpp-field-settings { padding: 20px; border-top: 1px solid #eee; background: #fff; display: none; }
.fpp-grid-row { display: flex; gap: 15px; margin-bottom: 15px; }
.fpp-setting-col { flex: 1; }
.fpp-setting-col label { display: block; font-size: 11px; text-transform: uppercase; color: #888; margin-bottom: 5px; font-weight: 600; }

/* =========================================
   3. FRONTEND FORM STYLES
   ========================================= */
.fpp-frontend-wrapper {
    max-width: 650px; margin: 0 auto; padding: 20px;
    font-family: var(--fpp-font-body);
}

.fpp-step-container {
    background: #fff; border-radius: 20px; box-shadow: var(--fpp-shadow);
    padding: 60px 40px; position: relative; overflow: hidden; min-height: 450px;
    display: flex; flex-direction: column; justify-content: center;
}

/* Progress Bar */
.fpp-progress-bar-bg { position: absolute; top:0; left:0; width:100%; height:6px; background: #f0f0f0; }
.fpp-progress-bar { height: 100%; background: var(--fpp-accent); width: 0; transition: width 0.4s ease; }

/* Steps Animation */
.fpp-step { display: none; animation: slideUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.fpp-step.active { display: block; }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fpp-step label {
    display: block; font-family: var(--fpp-font-head); font-size: 32px;
    color: #111; margin-bottom: 30px; line-height: 1.2;
}

/* Frontend Inputs */
.fpp-input-wrapper input[type="text"],
.fpp-input-wrapper input[type="email"],
.fpp-input-wrapper textarea {
    width: 100%; border: none; border-bottom: 2px solid #ddd;
    font-size: 22px; padding: 15px 0; font-family: var(--fpp-font-body);
    background: transparent; outline: none; transition: border 0.3s;
}

/* Selection Cards */
.fpp-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.fpp-selection-card {
    border: 1px solid #ddd; border-radius: 12px; padding: 25px; cursor: pointer;
    text-align: center; font-weight: 500; font-size: 16px; transition: all 0.2s; background: #fff;
}
.fpp-selection-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.fpp-selection-card input { display: none; }

/* Navigation Buttons */
.fpp-nav-buttons { margin-top: auto; padding-top: 40px; display: flex; justify-content: space-between; align-items: center; }
.fpp-btn-action {
    /* Background handled by inline JS/CSS var */
    padding: 18px 45px; border-radius: 50px; font-size: 16px; font-weight: 700; border: none; cursor: pointer;
    transition: transform 0.2s;
}
.fpp-btn-action:hover { transform: scale(1.03); opacity: 0.95; }
.fpp-btn-back { background: transparent; border: none; color: #999; cursor: pointer; font-size: 15px; padding: 10px; }
.fpp-btn-back:hover { color: #333; }

/* =========================================
   4. TERMS & CONDITIONS MODAL
   ========================================= */
.fpp-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    
    /* Center Content */
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.fpp-modal.active { display: flex !important; }

.fpp-modal-content {
    background-color: #fff;
    width: 100%;
    max-width: 600px;
    height: auto;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fppModalPop 0.3s ease-out;
}

@keyframes fppModalPop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.fpp-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fcfcfc;
}
.fpp-modal-header h3 { margin: 0; font-size: 18px; font-weight: 600; }

.fpp-close-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 10px;
    min-width: 44px; /* Mobile touch target */
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fpp-close-modal:hover { color: #000; }

.fpp-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

/* Mobile Tweaks */
@media (max-width: 600px) {
    .fpp-modal-content { height: 85vh; }
    .fpp-step-container { padding: 40px 20px; min-height: 400px; }
    .fpp-step label { font-size: 24px; }
}