/* ========================================
   MODERN PAYMENT FORM STYLES
   Unique classes prefixed with 'pf-' (payment form)
   ======================================== */

/* Main Container */
.pf-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Card Wrapper */
.pf-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 40px;
    margin: 20px 0;
}

/* Back Link */
.pf-back-link {
    display: inline-flex;
    align-items: center;
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 20px;
    transition: color 0.2s ease;
}

.pf-back-link:hover {
    color: #4338ca;
}

.pf-back-link::before {
    content: "← ";
    margin-right: 5px;
}

/* Title */
.pf-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
    text-align: center;
}

/* Subtitle/Description */
.pf-description {
    font-size: 15px;
    color: #6b7280;
    text-align: center;
    margin: 0 0 30px 0;
    line-height: 1.5;
}

/* Security Notice */
.pf-security-notice {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 12px 16px;
    margin-bottom: 24px;
    border-radius: 4px;
}

.pf-security-notice h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #991b1b;
}

/* Form */
.pf-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Group */
.pf-form-group {
    display: flex;
    flex-direction: column;
}

/* Label */
.pf-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

/* Input Fields */
.pf-form-group input[type="text"],
.pf-form-group input[readonly] {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    color: #1f2937;
    background: #f9fafb;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.pf-form-group input[type="text"]:focus {
    outline: none;
    border-color: #4f46e5;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.pf-form-group input[readonly] {
    cursor: not-allowed;
    color: #6b7280;
}

/* Card Element Container (for Stripe/Shift4) */
.pf-card-element {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.2s ease;
    min-height: 44px;
}

.pf-card-element:focus-within {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Apply to Stripe and Shift4 card elements */
#card-element,
[data-shift4] {
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.2s ease;
    min-height: 44px;
}

/* Error Messages */
.pf-error,
#card-errors,
#payment-error {
    color: #dc2626;
    font-size: 14px;
    margin-top: 8px;
    display: block;
    min-height: 20px;
}

/* Submit Button */
.pf-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.pf-submit-btn:hover {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.pf-submit-btn:active {
    transform: translateY(0);
}

.pf-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Alert Messages */
.pf-alert-success {
    background: #d1fae5;
    border-left: 4px solid #10b981;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.pf-alert-danger {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Grid Layout for Form (optional) */
.pf-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Two Column Layout for smaller fields */
.pf-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pf-card {
        padding: 24px 20px;
        border-radius: 12px;
    }
    
    .pf-title {
        font-size: 20px;
    }
    
    .pf-description {
        font-size: 14px;
    }
    
    .pf-form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .pf-container {
        padding: 12px;
    }
    
    .pf-card {
        padding: 20px 16px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .pf-title {
        font-size: 18px;
    }
    
    .pf-submit-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* Loading State */
.pf-loading {
    position: relative;
    pointer-events: none;
}

.pf-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: pf-spin 0.6s linear infinite;
}

@keyframes pf-spin {
    to { transform: rotate(360deg); }
}