/* ── CCP Plugin — Frontend Styles ── */

/* Checkout button */
.ccp-checkout-btn {
    display: inline-block;
    padding: 12px 28px;
    background: #1a56db;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.ccp-checkout-btn:hover { background: #1649c5; }
.ccp-checkout-btn:active { background: #1240ad; }

/* Modal overlay */
.ccp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
}

/* Modal box */
.ccp-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

@media (max-width: 540px) {
    .ccp-modal { padding: 20px; border-radius: 8px; }
}

/* Close button */
.ccp-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 4px 8px;
}
.ccp-modal-close:hover { color: #111; }

/* Header */
.ccp-modal-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}
.ccp-plan-name {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}
.ccp-plan-price {
    font-size: 28px;
    font-weight: 800;
    color: #1a56db;
    line-height: 1.1;
}
.ccp-plan-billing {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

/* Notice */
.ccp-notice {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
}
.ccp-notice.is-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}
.ccp-notice.is-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

/* Form sections */
.ccp-form-section { margin-bottom: 24px; }
.ccp-form-section h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #374151;
    margin: 0 0 14px;
}

/* Grid */
.ccp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.ccp-field { display: flex; flex-direction: column; }
.ccp-field.full { grid-column: 1 / -1; }

@media (max-width: 400px) {
    .ccp-grid { grid-template-columns: 1fr; }
    .ccp-field.full { grid-column: 1; }
}

/* Labels + Inputs */
.ccp-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}
.ccp-field input {
    padding: 9px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #111827;
    transition: border-color 0.15s;
    outline: none;
    box-sizing: border-box;
    width: 100%;
}
.ccp-field input:focus { border-color: #1a56db; box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.ccp-field input.ccp-invalid { border-color: #ef4444; }

/* Submit button */
.ccp-submit-btn {
    width: 100%;
    padding: 14px;
    background: #1a56db;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 8px;
}
.ccp-submit-btn:hover:not(:disabled) { background: #1649c5; }
.ccp-submit-btn:disabled { opacity: 0.65; cursor: not-allowed; }

/* Secure note */
.ccp-secure-note {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Success state */
.ccp-success {
    text-align: center;
    padding: 24px 0;
}
.ccp-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #d1fae5;
    color: #065f46;
    font-size: 26px;
    line-height: 56px;
    margin: 0 auto 16px;
}
.ccp-success h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #111827;
}
.ccp-success p { color: #6b7280; margin: 0; }

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .ccp-modal {
        background: #1f2937;
        box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    }
    .ccp-plan-name  { color: #f9fafb; }
    .ccp-plan-price { color: #60a5fa; }
    .ccp-plan-billing { color: #9ca3af; }
    .ccp-modal-header { border-bottom-color: #374151; }
    .ccp-modal-close { color: #9ca3af; }
    .ccp-modal-close:hover { color: #f9fafb; }
    .ccp-form-section h3 { color: #d1d5db; }
    .ccp-field label { color: #d1d5db; }
    .ccp-field input {
        background: #111827;
        border-color: #374151;
        color: #f9fafb;
    }
    .ccp-field input:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,0.15); }
    .ccp-secure-note { color: #6b7280; }
    .ccp-success h3 { color: #f9fafb; }
}
