/* Thin border for all fields */
.cfm-thin-border {
    border: 1px solid #bbb !important;
    border-radius: 6px !important;
    box-shadow: none !important;
}

/* Single column layout for simplified form */
.cfm-form-single-column {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
}


/* Modern Contact Form Styles */
.cfm-modern-contact-container {
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--cfm-bg-color);
    color: inherit;
    max-width: 900px; /* Increased from default if any */
}

.cfm-contact-card {
    background: var(--cfm-card-bg-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    color: inherit;
}

.cfm-contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--cfm-input-border-color);
}

.cfm-contact-header {
    text-align: center;
    margin-bottom: 16px;
}

.cfm-contact-title {
    font-size: 24px;
    font-weight: 700;
    color: inherit;
    margin: 0 0 4px 0;
    background: inherit;
}

.cfm-contact-subtitle {
    color: var(--cfm-subtitle-color);
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

/* Form Layout Styles */
.cfm-form-layout {
    display: block;
}

.cfm-modern-form {
    width: 100% !important;
    max-width: 100% !important; /* Override .cfm-form max-width */
    display: block !important; /* Use block so internal grids work */
}

.cfm-form-columns {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.cfm-form-left {
    display: flex;
    flex-direction: column;
}

.cfm-form-right {
    display: flex;
    flex-direction: column;
}

.cfm-message-tall {
    min-height: 120px;
    height: 100%;
    resize: vertical;
}

/* Social Section within Left Column */
.cfm-social-section {
    margin-top: 4px;
}

.cfm-social-section .cfm-social-links {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.cfm-form-group {
    position: relative;
    margin-bottom: 8px;
}

.cfm-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--cfm-accent-color);
    margin-bottom: 2px;
    transition: color 0.2s ease;
    background: none;
}

html body .cfm-modern-contact-container .cfm-input,
html body .cfm-modern-contact-container .cfm-textarea,
html body .cfm-modern-contact-container select.cfm-input,
html body .cfm-modern-contact-container input.cfm-input,
html body .cfm-modern-contact-container input.cfm-input[readonly],
html body .cfm-modern-contact-container input.cfm-input:disabled {
    width: 100%;
    background: var(--cfm-input-bg-color) !important;
    border: 1px solid var(--cfm-input-border-color);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 14px;
    color: var(--cfm-input-text-color) !important;
    -webkit-text-fill-color: var(--cfm-input-text-color) !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

html body .cfm-modern-contact-container select.cfm-input option {
    background-color: var(--cfm-input-bg-color);
    color: var(--cfm-input-text-color);
}

.cfm-input::placeholder,
.cfm-textarea::placeholder {
    color: var(--cfm-subtitle-color);
    opacity: 1;
}

.cfm-input:focus,
.cfm-textarea:focus {
    outline: none;
    border-color: var(--cfm-input-focus-border-color);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
    background: var(--cfm-input-bg-color) !important;
    color: var(--cfm-input-text-color);
}

.cfm-input-border {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--cfm-button-bg-color);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.cfm-input:focus + .cfm-input-border,
.cfm-textarea:focus + .cfm-input-border {
    width: 100%;
}

.cfm-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Prevent select and input fields from inheriting large min-height */
select.cfm-textarea,
input.cfm-textarea {
    min-height: 0 !important;
    height: 42px !important;
}

/* Prevent input fields from having textarea properties */
input.cfm-textarea {
    resize: none;
    min-height: auto;
    height: auto;
}

.cfm-submit-btn {
    width: 100%;
    background: var(--cfm-button-bg-color);
    color: var(--cfm-button-text-color);
    font-weight: 600;
    font-size: 16px;
    padding: 16px 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.cfm-submit-btn:hover {
    background: linear-gradient(135deg, var(--cfm-accent-color-dark), #0e7490);
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.3);
}

.cfm-submit-btn:active {
    transform: translateY(0);
}

.cfm-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cfm-btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cfm-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(15, 23, 42, 0.3);
    border-top: 2px solid var(--cfm-button-text-color);
    border-radius: 50%;
    animation: cfm-spin 1s linear infinite;
}

@keyframes cfm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Total Summary Styling */
.cfm-total-summary-group {
    background: var(--cfm-social-link-bg-color);
    padding: 16px;
    border-radius: 8px;
    border: 1px dashed var(--cfm-input-border-color);
    margin-top: 16px !important;
}

.cfm-total-display-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 8px;
    padding: 0 16px;
    border: 1px solid var(--cfm-input-border-color);
}

:where(.dark-mode, [data-theme='dark']) .cfm-total-display-wrapper {
    background: rgba(15, 23, 42, 0.5);
}

.cfm-currency-symbol {
    font-size: 24px;
    font-weight: 700;
    color: var(--cfm-accent-color);
}

.cfm-total-input {
    background: transparent !important;
    border: none !important;
    font-size: 32px !important;
    font-weight: 800 !important;
    color: var(--cfm-accent-color) !important;
    padding: 8px 0 !important;
    width: 100%;
    pointer-events: none !important;
    user-select: none !important;
    cursor: default !important;
}

.cfm-total-input:focus {
    box-shadow: none !important;
}

.cfm-form-section-title {
    font-size: 15px;
    font-weight: 700;
    margin: 8px 0 6px 0;
    padding-bottom: 2px;
    border-bottom: 2px solid var(--cfm-accent-color);
    display: inline-block;
}

.cfm-workshop-section {
    padding-top: 6px;
    border-top: 1px solid var(--cfm-input-border-color);
    margin-top: 8px;
}

/* Desktop Grid */
@media (min-width: 769px) {
    .cfm-form-columns {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .cfm-contact-card {
        padding: 24px;
    }
    .cfm-form-columns {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}

/* Base Dark Mode Support (Media Query) */
@media (prefers-color-scheme: dark) {
    .cfm-total-display-wrapper {
        background: rgba(15, 23, 42, 0.7);
    }
    
    .cfm-input:focus,
    .cfm-textarea:focus {
        background: #1e293b !important;
        border-color: var(--cfm-accent-color);
        box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
    }
}

/* Explicit Dark Mode Overrides (if theme adds a class) */
.dark-mode .cfm-contact-card,
[data-theme='dark'] .cfm-contact-card {
    background: #1e293b;
    border: 1px solid #334155;
}

.dark-mode .cfm-total-display-wrapper,
[data-theme='dark'] .cfm-total-display-wrapper {
    background: rgba(15, 23, 42, 0.7);
}

/* --- Unified Form Components --- */

/* Rating Section (Survey) */
.cfm-rating-options {
    display: flex;
    gap: 15px;
    margin-top: 5px;
    flex-wrap: wrap;
}
.cfm-rating-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    gap: 5px;
    padding: 10px;
    border: 1px solid var(--cfm-input-border-color);
    border-radius: 8px;
    min-width: 45px;
    transition: all 0.2s ease;
    background: var(--cfm-input-bg-color);
}
.cfm-rating-label:hover {
    border-color: var(--cfm-accent-color);
    background: rgba(6, 182, 212, 0.05);
}
.cfm-rating-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}
.cfm-rating-label span {
    font-weight: 600;
    font-size: 16px;
    color: var(--cfm-text-color);
}
.cfm-rating-label:has(input:checked) {
    border-color: var(--cfm-accent-color);
    background: var(--cfm-accent-color);
}
.cfm-rating-label:has(input:checked) span {
    color: #fff;
}
.cfm-rating-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

/* Legal & Indemnity Sections */
.cfm-signature-input {
    font-family: 'Brush Script MT', cursive;
    font-size: 24px !important;
    height: 50px !important;
}
.cfm-indemnity-legal-sections {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.cfm-legal-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--cfm-text-color);
}
.cfm-legal-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--cfm-subtitle-color);
    margin: 0 0 12px 0;
}
.cfm-checkbox-group {
    margin-top: 8px;
}
.cfm-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
    line-height: 1.4;
}
.cfm-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Guardian Toggle Section */
.cfm-guardian-toggle-section {
    margin-top: 24px;
    padding: 16px;
    background: var(--cfm-social-link-bg-color);
    border-radius: 8px;
    border: 1px solid var(--cfm-input-border-color);
}

/* Mobile Adjustments for specific components */
@media (max-width: 600px) {
    .cfm-rating-options { gap: 10px; }
    .cfm-rating-label { padding: 8px; min-width: 40px; }
    .cfm-signature-input { font-size: 20px !important; height: 44px !important; }
    .cfm-legal-title { font-size: 15px; }
    .cfm-legal-text { font-size: 13px; }
}

/* End of File */
```
.cfm-status-display {
    text-align: center;
    animation: cfm-fade-in 0.5s ease-in-out;
}

.cfm-status-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.cfm-success-icon {
    width: 64px;
    height: 64px;
    color: var(--cfm-success-color);
    animation: cfm-success-pulse 0.6s ease-in-out;
}

.cfm-error-icon {
    width: 64px;
    height: 64px;
    color: var(--cfm-error-color);
    animation: cfm-error-shake 0.6s ease-in-out;
}

.cfm-status-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.cfm-status-success .cfm-status-title {
    color: var(--cfm-success-color);
}

.cfm-status-error .cfm-status-title {
    color: var(--cfm-error-color);
}

.cfm-status-subtitle {
    color: var(--cfm-subtitle-color);
    font-size: 16px;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.cfm-status-details {
    background: var(--cfm-social-link-bg-color);
    border: 1px solid var(--cfm-input-border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
}

.cfm-status-item {
    margin-bottom: 16px;
}

.cfm-status-item:last-child {
    margin-bottom: 0;
}

.cfm-status-item h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--cfm-accent-color);
    margin: 0 0 4px 0;
}

.cfm-status-item p {
    color: var(--cfm-text-color);
    margin: 0;
    font-size: 14px;
}

.cfm-error-details {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    color: #fca5a5;
    font-size: 14px;
}

.cfm-reset-btn {
    width: 100%;
    background: var(--cfm-input-border-color);
    color: var(--cfm-text-color);
    font-weight: 600;
    font-size: 16px;
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cfm-reset-btn:hover {
    background: #64748b;
    transform: translateY(-1px);
}

/* Accessibility Features */
.cfm-required {
    color: var(--cfm-error-color);
    font-weight: 600;
    margin-left: 2px;
}

.cfm-error-message {
    color: var(--cfm-error-color);
    font-size: 13px;
    margin-top: 6px;
    min-height: 18px;
    display: block;
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.cfm-field-help {
    color: var(--cfm-subtitle-color);
    font-size: 12px;
    margin-top: 4px;
    font-style: italic;
}

.cfm-field-help.cfm-error-text {
    color: #fca5a5;
    font-weight: 600;
}

.cfm-submit-status {
    margin-top: 8px;
    min-height: 20px;
    font-size: 14px;
}

/* Enhanced focus indicators for accessibility */
.cfm-input:focus,
.cfm-textarea:focus,
.cfm-submit-btn:focus,
.cfm-social-link:focus {
    outline: 3px solid var(--cfm-accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cfm-input,
    .cfm-textarea {
        background: #000000;
        color: #ffffff;
        border-color: #ffffff;
    }
    
    .cfm-contact-card {
        background: #000000;
        border: 2px solid #ffffff;
    }
    
    .cfm-label,
    .cfm-contact-title,
    .cfm-contact-subtitle {
        color: #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cfm-input,
    .cfm-textarea,
    .cfm-submit-btn,
    .cfm-social-link,
    .cfm-input-border {
        transition: none;
    }
    
    .cfm-spinner {
        animation: none;
    }
}

/* Submission Modal Styles */
.cfm-modal {
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cfm-modal-content {
    background: var(--cfm-card-bg-color);
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.cfm-modal-close {
    color: var(--cfm-subtitle-color);
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cfm-modal-close:hover,
.cfm-modal-close:focus {
    color: var(--cfm-text-color);
}

/* Honeypot field - hide it */
.cfm-hp {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    visibility: hidden !important;
}


/* Social Media Links */
.cfm-social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 16px;
}

.cfm-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--cfm-social-link-bg-color);
    border: 1px solid var(--cfm-social-link-border-color);
    border-radius: 12px;
    color: var(--cfm-social-link-color);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cfm-social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.1), transparent);
    transition: left 0.5s ease;
}

.cfm-social-link:hover::before {
    left: 100%;
}

.cfm-social-link:hover {
    transform: translateY(-2px);
    border-color: var(--cfm-accent-color);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.15);
}

.cfm-social-link:nth-child(1):hover {
    color: #1877f2; /* Facebook blue */
    border-color: #1877f2;
    box-shadow: 0 8px 25px rgba(24, 119, 242, 0.25);
}

.cfm-social-link:nth-child(2):hover {
    color: #e4405f; /* Instagram pink */
    border-color: #e4405f;
    box-shadow: 0 8px 25px rgba(228, 64, 95, 0.25);
}

.cfm-social-link:nth-child(3):hover {
    color: #25d366; /* WhatsApp green */
    border-color: #25d366;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.25);
}

.cfm-social-icon {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.cfm-social-link:hover .cfm-social-icon {
    transform: scale(1.1);
}

.cfm-social-link:active {
    transform: translateY(0);
}

/* Animations */
@keyframes cfm-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cfm-success-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes cfm-error-shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Character count for message field */

/* Enhanced Validation States */
.cfm-form-group.cfm-focused .cfm-label {
    color: var(--cfm-accent-color);
}

.cfm-form-group.cfm-invalid .cfm-label {
    color: var(--cfm-error-color);
}

.cfm-form-group.cfm-invalid .cfm-input,
.cfm-form-group.cfm-invalid .cfm-textarea {
    border-color: var(--cfm-error-color);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.3);
}

.cfm-input.cfm-error,
.cfm-textarea.cfm-error {
    border-color: var(--cfm-error-color);
    background: rgba(239, 68, 68, 0.1);
}

.cfm-form-group.cfm-invalid .cfm-input-border {
    background: var(--cfm-error-color);
    width: 100%;
}

.cfm-notice-box {
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
    font-size: 14px;
    color: var(--cfm-text-color);
}

.cfm-warning-box {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
    font-size: 14px;
    color: #92400e;
}

:where(.dark-mode, [data-theme='dark']) .cfm-warning-box {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

/* Additional Animation Classes */
.cfm-animate-success {
    animation: cfm-success-bounce 0.6s ease-in-out;
}

.cfm-animate-error {
    animation: cfm-error-shake 0.6s ease-in-out;
}

@keyframes cfm-success-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Aggressively hide theme-level page titles when this modern form is rendered */
.entry-title, 
.page-title, 
.post-title, 
header.entry-header, 
.td-page-title, 
.td-post-title, 
.elementor-heading-title,
.td-page-header,
.page-header,
.header-title {
    display: none !important;
}

/* Ensure any first-level h1 outside our container is hidden if it matches common form names */
h1:not(.cfm-contact-title):first-of-type,
h2:not(.cfm-contact-title):first-of-type {
    /* We will refine this with JS to avoid hiding legitimate content */
}
