body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto;
    margin: 0;
    flex-direction: column;
}

.container {
    max-width: 750px;
    width: 100%;
    text-align: center;
    margin: 0 auto;
}

header, footer {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

header img {
    max-width: 200px;
    height: auto;
}

footer {
    margin-top: 20px;
}

.payment-form {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.payment-form h2 {
    margin-bottom: 20px;
    font-size: 1.5em;
    color: #333;
}

.payment-form .form-group {
    margin-bottom: 15px;
}

.payment-form .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.payment-form .form-group input[type="text"],
.payment-form .form-group input[type="email"],
.payment-form .form-group input[type="tel"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

.hidden-field {
    display: none;
}

.payment-form .submit-button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    transition: all 0.3s ease;
}

/* Loading and error messages */
#loading-message {
    display: none;
    color: #007cba;
    margin-top: 10px;
    text-align: center;
}

#error-message {
    display: none;
    color: #d9534f;
    margin-top: 10px;
    text-align: center;
    background: #f8d7da;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

.error-info {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 20px;
    border-radius: 8px;
}

.error-info h2 {
    color: #721c24;
    margin-top: 0;
}

.payment-form .portal-info {
    width: 100%;
    text-align: left;
    margin-top: 20px;
}

.payment-form .portal-image-wrapper {
    width: 100%;
    height: auto;
    text-align: right;
}

.payment-form .portal-image {
    width: 50%;
    height: auto;
}

.payment-form .terms-group {
    margin-top: 20px;
    margin-bottom: 20px;
}

.payment-form .checkbox-label {
    display: flex;
    align-items: flex-start;
    font-weight: normal;
    cursor: pointer;
}

.payment-form .checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.payment-form .checkbox-label span {
    font-size: 0.95em;
    color: #555;
    line-height: 1.4;
}

.payment-form .checkbox-label a {
    color: #007cba;
    text-decoration: underline;
}

.payment-form .checkbox-label a:hover {
    color: #005a87;
}

/* Payment Logo Styles - Reusable across all templates */
.payment-logo-wrapper {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
}

.payment-logo-wrapper img {
    max-width: 200px;
    height: auto;
}

/* Receipt Page Styles */
.receipt-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    font-family: Arial, sans-serif;
    position: relative;
}

/* Accommodate WordPress admin bar */
.admin-bar .receipt-container {
    margin-top: 52px; /* 32px admin bar + 20px spacing */
}

@media screen and (max-width: 782px) {
    .admin-bar .receipt-container {
        margin-top: 66px; /* 46px admin bar on mobile + 20px spacing */
    }
}

.receipt-logo {
    padding: 20px;
}

.receipt-logo img {
    max-width: 100px;
    height: auto;
    max-height: 100px;
}

.receipt-header {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.receipt-header.success {
    background: #d4edda;
    border: 2px solid #c3e6cb;
}

.receipt-header.processing {
    background: #fff3cd;
    border: 2px solid #ffc107;
}

.receipt-header h1 {
    margin: 0 0 10px 0;
    font-size: 32px;
}

.receipt-header.success h1 {
    color: #155724;
}

.receipt-header.processing h1 {
    color: #856404;
}

.receipt-header .checkmark {
    font-size: 40px;
}

.receipt-header.success .checkmark {
    color: #28a745;
}

.receipt-header.processing .checkmark {
    color: #ffc107;
}

.email-notice {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.email-notice p {
    margin: 0;
    color: #0c5460;
}

.processing-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    animation: pulse 2s ease-in-out infinite;
}

.processing-notice p {
    margin: 5px 0;
    color: #856404;
}

.processing-notice .refresh-countdown {
    font-size: 14px;
    margin-top: 10px;
}

.processing-notice .refresh-countdown strong {
    color: #d39e00;
    font-size: 16px;
}

@keyframes pulse {
    0%, 100% {
        background: #fff3cd;
    }
    50% {
        background: #ffe69c;
    }
}

.receipt-details {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    padding-top: 0px;
}

.receipt-details h2 {
    margin-top: 0;
    color: #333;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 20px 0 10px 0;
    padding: 8px 12px;
    background: #f8f9fa;
    border-left: 4px solid #007cba;
    border-radius: 3px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: bold;
    color: #555;
}

.detail-value {
    color: #333;
    text-align: right;
}

.detail-value code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    color: #333;
    font-family: 'Courier New', Courier, monospace;
}

.detail-value.status-success {
    color: #28a745;
    font-weight: bold;
    text-transform: uppercase;
}

.detail-value.status-processing {
    color: #ffc107;
    font-weight: bold;
    text-transform: uppercase;
}

.amount-row {
    font-size: 24px;
    color: #28a745;
    font-weight: bold;
    padding-top: 10px;
    margin-top: 10px;
}

.action-buttons {
    text-align: center;
    margin: 30px 0;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    margin: 0 10px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: #007cba;
    color: #ffffff !important;
    border-color: #007cba;
}

.btn-primary:hover {
    background: #005a87;
    color: #ffffff !important;
    border-color: #005a87;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #545b62;
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.error-message h2 {
    margin-top: 0;
}

.receipt-footer {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 40px;
}

.receipt-footer p {
    margin: 10px 0;
}

.receipt-footer a {
    color: #007cba;
    text-decoration: none;
}

.receipt-footer a:hover {
    text-decoration: underline;
}

.receipt-footer .note {
    font-size: 12px;
    color: #999;
}

/* Cancellation Page Styles */
.receipt-header.cancelled {
    background-color: #fef2f2;
    border: 2px solid #d63638;
}

.receipt-header.cancelled .checkmark {
    color: #d63638;
    background-color: transparent;
}

.receipt-header.cancelled h1 {
    color: #d63638;
}

.cancellation-notice {
    background-color: #fff8e1;
    border-left: 4px solid #f59e0b;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.cancellation-notice h3 {
    color: #d63638;
    margin-top: 0;
}

.cancellation-notice p {
    margin-bottom: 0;
    color: #333;
}

.status-cancelled {
    color: #d63638;
    font-weight: 600;
    text-transform: uppercase;
}

.next-steps {
    background-color: #f0f6fc;
    border-left: 4px solid #0071a1;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.next-steps h3 {
    margin-top: 0;
    color: #0071a1;
}

.next-steps ul {
    text-align: left;
    margin: 15px 0;
    padding-left: 20px;
}

.next-steps ul li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Print styles for receipt */
@media print {
    .action-buttons,
    .email-notice {
        display: none;
    }
    
    .receipt-container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .receipt-details {
        box-shadow: none;
    }
    
    /* Keep logos horizontal when printing */
    .receipt-logo {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: center;
        gap: 20px;
        margin: 20px 0;
    }
    
    .receipt-logo.has-both-logos {
        flex-wrap: nowrap !important;
        gap: 20px !important;
    }
    
    .receipt-logo.has-both-logos .header-logo,
    .receipt-logo.has-both-logos .featured-image {
        flex: 0 1 auto;
        max-width: 280px;
    }
    
    .receipt-logo .header-logo img,
    .receipt-logo .featured-image img {
        max-width: 100%;
        height: auto;
        max-height: 120px;
        display: block;
    }
    
    /* Keep receipt footer section horizontal when printing */
    .receipt-footer-section {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: flex-start;
        gap: 30px;
    }
    
    .receipt-footer-section .payment-footer-content {
        flex: 1;
    }
    
    .receipt-footer-section .portal-logo {
        flex-shrink: 0;
        text-align: right;
    }
    
    /* Prevent page breaks within important sections */
    .receipt-header,
    .receipt-details,
    .receipt-logo,
    .receipt-footer-section {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* Hide processing notice when printing */
    .processing-notice {
        display: none;
    }
    
    /* Section title styling for print */
    .section-title {
        font-size: 15px;
        font-weight: 600;
        color: #000;
        margin: 15px 0 8px 0;
        padding: 6px 10px;
        background: #f0f0f0;
        border-left: 3px solid #000;
        page-break-after: avoid;
    }
}

/* ======================================== */
/* Payment Page Specific Styles */
/* ======================================== */

/* Info Grid Layout */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 15px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.info-section {
    padding: 10px;
}

.info-section strong {
    color: #333;
    font-size: 1.1em;
}

/* Amount Display - Make it prominent */
.amount-display {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.amount-label {
    display: block;
    color: #ffffff;
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.amount-value {
    display: block;
    color: #ffffff;
    font-size: 2.5em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Privacy Disclaimer Modal Overlay */
.privacy-disclaimer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 9998;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(3px);
}

.privacy-disclaimer-overlay.active {
    display: block;
}

/* Privacy Disclaimer Modal */
.privacy-disclaimer {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px 60px 30px 30px;
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    border-left: 6px solid #ff9800;
    border-radius: 10px;
    font-size: 0.95em;
    line-height: 1.6;
    z-index: 9999;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.4s ease;
}

.privacy-disclaimer.active {
    display: block;
}

.disclaimer-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    font-size: 1.4em;
    color: #856404;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10000;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.disclaimer-close-btn:hover {
    background: rgba(255, 152, 0, 0.3);
    color: #ff9800;
}

.privacy-disclaimer-icon {
    display: inline-block;
    margin-right: 8px;
    font-weight: bold;
    color: #ff9800;
    font-size: 1.3em;
}

.privacy-disclaimer p {
    margin: 0 0 15px 0;
    color: #856404;
}

.privacy-disclaimer p:last-child {
    margin-bottom: 0;
}

.privacy-disclaimer strong {
    color: #6d4c00;
}

.privacy-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.continue-btn {
    flex: 1;
    min-width: 200px;
    padding: 12px 24px;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.continue-btn:hover {
    background-color: #218838;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.close-page-btn {
    flex: 1;
    min-width: 200px;
    padding: 12px 24px;
    background-color: #d32f2f;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

.close-page-btn:hover {
    background-color: #b71c1c;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.4);
}

@media (max-width: 768px) {
    .privacy-buttons {
        flex-direction: column;
    }
    
    .continue-btn,
    .close-page-btn {
        width: 100%;
        min-width: auto;
    }
}

/* Animations for Modal */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

/* Mobile responsiveness for modal */
@media (max-width: 768px) {
    .privacy-disclaimer {
        width: 95%;
        padding: 25px 50px 25px 20px;
        max-height: 90vh;
        font-size: 0.9em;
    }
    
    .disclaimer-close-btn {
        width: 28px;
        height: 28px;
        font-size: 1.3em;
        top: 8px;
        right: 8px;
    }
    
    .close-page-btn {
        width: 100%;
        text-align: center;
    }
}

/* Payment Logos Wrapper */
.payment-logos-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

/* When both logos exist - display side by side */
.payment-logos-wrapper.has-both-logos {
    gap: 20px;
    flex-wrap: nowrap;
}

.payment-logos-wrapper.has-both-logos .header-logo,
.payment-logos-wrapper.has-both-logos .featured-image {
    flex: 0 1 auto;
    max-width: 280px;
}

/* When only one logo exists - center it */
.payment-logos-wrapper.has-header-only,
.payment-logos-wrapper.has-featured-only {
    justify-content: center;
}

.payment-logos-wrapper.has-header-only .header-logo,
.payment-logos-wrapper.has-featured-only .featured-image {
    flex: 0 1 auto;
    max-width: 350px;
    margin: 0 auto;
}

/* Logo images */
.payment-logos-wrapper .header-logo img,
.payment-logos-wrapper .featured-image img {
    max-width: 100%;
    height: auto;
    max-height: 120px;
    display: block;
    object-fit: contain;
    margin: 0 auto;
}

/* Mobile responsive for logos */
@media (max-width: 768px) {
    .payment-logos-wrapper.has-both-logos {
        gap: 15px;
        flex-direction: column;
    }
    
    .payment-logos-wrapper.has-both-logos .header-logo,
    .payment-logos-wrapper.has-both-logos .featured-image {
        max-width: 100%;
    }
    
    .payment-logos-wrapper .header-logo img,
    .payment-logos-wrapper .featured-image img {
        max-height: 100px;
    }
}

/* Receipt Logo - Same styling as payment-logos-wrapper */
.receipt-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.receipt-logo.has-both-logos {
    gap: 20px;
    flex-wrap: nowrap;
}

.receipt-logo.has-both-logos .header-logo,
.receipt-logo.has-both-logos .featured-image {
    flex: 0 1 auto;
    max-width: 280px;
}

.receipt-logo.has-header-only,
.receipt-logo.has-featured-only {
    justify-content: center;
}

.receipt-logo.has-header-only .header-logo,
.receipt-logo.has-featured-only .featured-image {
    flex: 0 1 auto;
    max-width: 350px;
    margin: 0 auto;
}

.receipt-logo .header-logo img,
.receipt-logo .featured-image img {
    max-width: 100%;
    height: auto;
    max-height: 120px;
    display: block;
    object-fit: contain;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .receipt-logo.has-both-logos {
        gap: 15px;
        flex-direction: column;
    }
    
    .receipt-logo.has-both-logos .header-logo,
    .receipt-logo.has-both-logos .featured-image {
        max-width: 100%;
    }
    
    .receipt-logo .header-logo img,
    .receipt-logo .featured-image img {
        max-height: 100px;
    }
}

/* Terms Disclaimer on Receipt */
.terms-disclaimer {
    background-color: #fffbea;
    border: 1px solid #ffd54f;
    border-left: 4px solid #ffa000;
    border-radius: 5px;
    padding: 15px 20px;
    margin: 20px 0;
    text-align: center;
}

/* Receipt Footer Section */
.receipt-footer-section {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    padding-top: 20px;
}

.receipt-footer-section .payment-footer-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

.receipt-footer-section .portal-logo {
    flex-shrink: 0;
    text-align: right;
}

.receipt-footer-section .portal-logo img {
    max-width: 150px;
    height: auto;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .receipt-footer-section {
        flex-direction: column;
        gap: 20px;
    }
    
    .receipt-footer-section .portal-logo {
        align-self: center;
    }
    
    .receipt-footer-section .portal-logo img {
        max-width: 120px;
    }
    
    .receipt-footer-section .payment-footer-content {
        text-align: center;
        font-size: 13px;
    }
}

.terms-disclaimer p {
    margin: 0;
    color: #7a5f00;
    font-size: 0.95em;
    line-height: 1.6;
}

.terms-disclaimer a {
    color: #1976d2;
    text-decoration: underline;
    font-weight: 600;
}

.terms-disclaimer a:hover {
    color: #0d47a1;
}

.terms-disclaimer strong {
    color: #5f4900;
}

/* Payment Form Notice */
.payment-form-notice {
    background-color: #e7f3ff;
    border: 1px solid #2196F3;
    border-left: 4px solid #2196F3;
    border-radius: 5px;
    padding: 15px 20px;
    margin: 20px 0;
}

.payment-form-notice p {
    margin: 0;
    color: #1565C0;
    font-size: 0.95em;
    line-height: 1.6;
}

.payment-form-notice .notice-icon {
    font-size: 1.2em;
    margin-right: 8px;
    vertical-align: middle;
}

.payment-form-notice strong {
    color: #0d47a1;
}

/* Responsive adjustments for payment page */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .amount-value {
        font-size: 2em;
    }
}