/**
 * ROI Calculator Styles - Redesigned v2.0
 * Clean, modern, professional design with improved UX
 *
 * @package Consultia Child
 * @since 1.2.0
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    /* Primary Colors */
    --roi-primary: #1f3c88;
    --roi-primary-dark: #0b3c5d;
    --roi-secondary: #1f7ae0;
    --roi-accent: #19b5a5;
    --roi-accent-dark: #14a094;

    /* Neutral Colors - Improved contrast */
    --roi-white: #ffffff;
    --roi-gray-50: #f9fafb;
    --roi-gray-100: #f3f4f6;
    --roi-gray-200: #e5e7eb;
    --roi-gray-300: #d1d5db;
    --roi-gray-400: #9ca3af;
    --roi-gray-500: #6b7280;
    --roi-gray-600: #4b5563;
    --roi-gray-700: #374151;
    --roi-gray-800: #1f2937;
    --roi-gray-900: #111827;

    /* Semantic Colors */
    --roi-success: #059669;
    --roi-success-light: #d1fae5;
    --roi-error: #dc2626;
    --roi-error-light: #fee2e2;
    --roi-warning: #d97706;

    /* Spacing */
    --roi-space-xs: 4px;
    --roi-space-sm: 8px;
    --roi-space-md: 16px;
    --roi-space-lg: 24px;
    --roi-space-xl: 32px;
    --roi-space-2xl: 48px;
    --roi-space-3xl: 64px;

    /* Border Radius */
    --roi-radius-sm: 6px;
    --roi-radius-md: 10px;
    --roi-radius-lg: 16px;
    --roi-radius-xl: 24px;

    /* Shadows */
    --roi-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --roi-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --roi-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --roi-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Typography */
    --roi-font-sans: "Inter", system-ui, -apple-system, sans-serif;
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
.roi-calculator-page {
    font-family: var(--roi-font-sans);
    color: var(--roi-gray-800);
    line-height: 1.6;
    background: var(--roi-gray-50);
}

.roi-calculator-page *,
.roi-calculator-page *::before,
.roi-calculator-page *::after {
    box-sizing: border-box;
}

.roi-calculator-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--roi-space-lg);
}

/* ==========================================================================
   Main Section
   ========================================================================== */
.roi-main-section {
    padding: var(--roi-space-3xl) 0;
}

/* ==========================================================================
   Module Selection - Prominent Position (moved up in form)
   ========================================================================== */
.roi-modules-field {
    padding: var(--roi-space-md);
    background: linear-gradient(135deg, rgba(31, 122, 224, 0.05) 0%, rgba(25, 181, 165, 0.05) 100%);
    border-radius: var(--roi-radius-md);
    border: 1px solid rgba(31, 122, 224, 0.15);
    margin-bottom: var(--roi-space-sm);
}

.roi-modules-field .roi-modules-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--roi-gray-800);
    margin-bottom: var(--roi-space-sm);
}

.roi-modules-hint {
    display: block;
    font-size: 13px;
    color: var(--roi-gray-600);
    margin-bottom: var(--roi-space-md);
}

.roi-modules-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--roi-space-sm);
}

.roi-module-chip {
    cursor: pointer;
    display: block;
    flex: 1;
    min-width: 120px;
}

.roi-module-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.roi-chip-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--roi-white);
    border: 2px solid var(--roi-gray-200);
    border-radius: var(--roi-radius-md);
    padding: 12px 16px;
    transition: all 0.2s ease;
    text-align: center;
}

.roi-module-chip:hover .roi-chip-content {
    border-color: var(--roi-secondary);
    background: var(--roi-white);
    box-shadow: 0 2px 8px rgba(31, 122, 224, 0.15);
}

.roi-module-chip input:checked + .roi-chip-content {
    border-color: var(--roi-secondary);
    background: rgba(31, 122, 224, 0.1);
    box-shadow: 0 0 0 3px rgba(31, 122, 224, 0.1);
}

.roi-module-chip input:focus + .roi-chip-content {
    outline: 2px solid var(--roi-secondary);
    outline-offset: 2px;
}

.roi-chip-icon {
    font-size: 16px;
    line-height: 1;
}

.roi-chip-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--roi-gray-700);
}

.roi-module-chip input:checked + .roi-chip-content .roi-chip-name {
    color: var(--roi-secondary);
}

/* ==========================================================================
   Calculator Grid (Two Columns)
   ========================================================================== */
.roi-calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--roi-space-xl);
    margin-bottom: var(--roi-space-2xl);
    align-items: start;
}

/* ==========================================================================
   Config Panel (Left)
   ========================================================================== */
.roi-config-panel {
    background: var(--roi-white);
    border-radius: var(--roi-radius-lg);
    box-shadow: var(--roi-shadow-lg);
    position: sticky;
    top: var(--roi-space-lg);
}

.roi-panel-header {
    display: flex;
    align-items: center;
    gap: var(--roi-space-md);
    padding: var(--roi-space-md) var(--roi-space-lg);
    background: linear-gradient(135deg, var(--roi-primary) 0%, var(--roi-primary-dark) 100%);
    border-bottom: none;
    border-radius: var(--roi-radius-lg) var(--roi-radius-lg) 0 0;
}

.roi-panel-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--roi-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--roi-white);
    box-shadow: none;
}

.roi-panel-icon svg {
    width: 20px;
    height: 20px;
}

.roi-panel-header > div:last-child {
    flex: 1;
    min-width: 0;
}

.roi-panel-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--roi-white);
    margin: 0 0 2px;
    line-height: 1.3;
}

.roi-panel-header p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.4;
}

.roi-config-form {
    padding: var(--roi-space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--roi-space-lg);
}

/* ==========================================================================
   Form Fields - Improved Accessibility
   ========================================================================== */
.roi-field {
    display: flex;
    flex-direction: column;
}

.roi-field-header {
    margin-bottom: var(--roi-space-sm);
}

.roi-field-header label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--roi-gray-800);
    margin-bottom: 4px;
}

/* Improved contrast for hint text - WCAG AA compliant */
.roi-field-hint {
    display: block;
    font-size: 13px;
    color: var(--roi-gray-600);
    line-height: 1.4;
}

.roi-field label .required {
    color: var(--roi-error);
    margin-left: 2px;
}

/* Select Input */
.roi-select {
    width: 100%;
    height: 52px;
    padding: 0 44px 0 16px;
    font-size: 15px;
    font-family: inherit;
    color: var(--roi-gray-800);
    background-color: var(--roi-white);
    border: 2px solid var(--roi-gray-200);
    border-radius: var(--roi-radius-md);
    /* Hide native dropdown arrow */
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    /* Custom arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-image 0.2s ease;
}

/* Hide native dropdown arrow - Chrome, Safari, Edge, Opera */
.roi-select::-webkit-calendar-picker-indicator,
.roi-select::-webkit-inner-spin-button,
.roi-select::-webkit-outer-spin-button {
    display: none !important;
    -webkit-appearance: none !important;
}

/* Hide native dropdown arrow - IE/Edge legacy */
.roi-select::-ms-expand {
    display: none !important;
}

/* Hide native dropdown arrow - Firefox */
.roi-select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 var(--roi-gray-800);
}

.roi-select:hover {
    border-color: var(--roi-gray-300);
}

.roi-select:focus {
    outline: 2px solid var(--roi-secondary);
    outline-offset: 2px;
    border-color: var(--roi-secondary);
    /* Rotate arrow on focus */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231F7AE0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 15 12 9 18 15'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Full width dropdown options */
.roi-select option {
    width: 100%;
    padding: 10px 16px;
}

/* Hide Nice Select default arrow - aggressive override */
.roi-calculator-page .nice-select::after,
.roi-config-panel .nice-select::after,
.roi-select + .nice-select::after,
.roi-field .nice-select::after,
.nice-select::after {
    display: none !important;
    content: none !important;
    border: none !important;
    width: 0 !important;
    height: 0 !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Nice Select wrapper styling */
.roi-calculator-page .nice-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.roi-calculator-page .nice-select.open {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231F7AE0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 15 12 9 18 15'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Nice Select dropdown list full width */
.roi-calculator-page .nice-select .list {
    width: 100%;
}

/* Number Input - Full Width */
.roi-number-input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: var(--roi-gray-800);
    background: var(--roi-white);
    border: 2px solid var(--roi-gray-200);
    border-radius: var(--roi-radius-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
}

.roi-number-input:hover {
    border-color: var(--roi-gray-300);
}

.roi-number-input:focus {
    outline: 2px solid var(--roi-secondary);
    outline-offset: 2px;
    border-color: var(--roi-secondary);
}

/* Text Input */
.roi-field input[type="text"],
.roi-field input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    color: var(--roi-gray-800);
    background: var(--roi-white);
    border: 2px solid var(--roi-gray-200);
    border-radius: var(--roi-radius-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.roi-field input[type="text"]:hover,
.roi-field input[type="email"]:hover {
    border-color: var(--roi-gray-300);
}

.roi-field input[type="text"]:focus,
.roi-field input[type="email"]:focus {
    outline: 2px solid var(--roi-secondary);
    outline-offset: 2px;
    border-color: var(--roi-secondary);
}

.roi-field input::placeholder {
    color: var(--roi-gray-500);
}

/* Textarea */
.roi-field textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    color: var(--roi-gray-800);
    background: var(--roi-white);
    border: 2px solid var(--roi-gray-200);
    border-radius: var(--roi-radius-md);
    resize: vertical;
    /* min-height: 100px; */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.roi-field textarea:hover {
    border-color: var(--roi-gray-300);
}

.roi-field textarea:focus {
    outline: 2px solid var(--roi-secondary);
    outline-offset: 2px;
    border-color: var(--roi-secondary);
}

.roi-field textarea::placeholder {
    color: var(--roi-gray-500);
}

/* ==========================================================================
   Results Panel (Right) - Enhanced with animations
   ========================================================================== */
.roi-results-panel {
    background: var(--roi-white);
    border-radius: var(--roi-radius-lg);
    box-shadow: var(--roi-shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--roi-space-lg);
}

.roi-panel-header-accent {
    background: linear-gradient(135deg, var(--roi-accent) 0%, var(--roi-accent-dark) 100%);
    padding: var(--roi-space-md) var(--roi-space-lg);
}

.roi-panel-header-accent h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--roi-white);
    margin: 0 0 2px;
    line-height: 1.3;
}

.roi-panel-header-accent p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.4;
}

.roi-panel-header-accent .roi-panel-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--roi-radius-md);
    color: var(--roi-white);
}

.roi-panel-header-accent .roi-panel-icon svg {
    width: 20px;
    height: 20px;
}

/* Totals Cards - Improved spacing and alignment */
.roi-totals {
    display: flex;
    gap: var(--roi-space-sm);
    padding: var(--roi-space-sm) var(--roi-space-md);
    background: var(--roi-gray-50);
}

.roi-total-card {
    flex: 1;
    background: var(--roi-white);
    border-radius: var(--roi-radius-md);
    padding: var(--roi-space-md);
    display: flex;
    flex-direction: column;
    border: 2px solid var(--roi-gray-200);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.roi-total-card.roi-value-updated {
    animation: roi-card-pulse 0.4s ease-out;
}

@keyframes roi-card-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(25, 181, 165, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 8px rgba(25, 181, 165, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(25, 181, 165, 0);
    }
}

.roi-total-card-left {
    display: flex;
    align-items: center;
    gap: var(--roi-space-xs);
    margin-bottom: 2px;
}

.roi-total-card-right {
    text-align: left;
}

.roi-total-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--roi-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 0;
}

.roi-total-label svg {
    width: 12px;
    height: 12px;
    color: var(--roi-gray-400);
}

.roi-total-dollars .roi-total-label svg {
    color: var(--roi-success);
}

.roi-total-hours .roi-total-label svg {
    color: var(--roi-secondary);
}

.roi-total-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--roi-gray-900);
    line-height: 1.2;
    transition: color 0.2s ease;
}

.roi-total-dollars .roi-total-value {
    color: var(--roi-success);
}

.roi-total-hours .roi-total-value {
    color: var(--roi-secondary);
}

.roi-total-suffix {
    font-size: 10px;
    color: var(--roi-gray-500);
    margin-top: 1px;
}

/* Value update animation */
.roi-value-updated .roi-total-value {
    animation: roi-value-flash 0.4s ease-out;
}

@keyframes roi-value-flash {
    0% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Breakdown Section - Compact spacing */
.roi-breakdown {
    padding: var(--roi-space-sm) var(--roi-space-md);
    flex: 1;
}

.roi-breakdown-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--roi-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 0 0 var(--roi-space-sm);
    padding-bottom: var(--roi-space-xs);
    border-bottom: 1px solid var(--roi-gray-100);
}

.roi-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: var(--roi-space-xs);
}

/* Module Result Item - Compact layout */
.roi-module-result-item {
    background: var(--roi-gray-50);
    border-radius: var(--roi-radius-md);
    padding: var(--roi-space-sm) var(--roi-space-md);
    border: 1px solid var(--roi-gray-100);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.roi-module-result-item:hover {
    background: var(--roi-gray-100);
}

.roi-module-result-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.roi-module-result-icon {
    font-size: 14px;
    line-height: 1;
}

.roi-module-result-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--roi-gray-800);
}

.roi-module-result-savings {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--roi-space-xs) var(--roi-space-md);
    padding-left: 20px;
}

.roi-module-result-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.roi-module-result-label {
    font-size: 11px;
    color: var(--roi-gray-500);
}

.roi-module-result-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--roi-gray-700);
}

.roi-module-result-yearly {
    font-weight: 700;
    color: var(--roi-success);
}

.roi-no-modules {
    text-align: center;
    padding: var(--roi-space-md);
    color: var(--roi-gray-600);
    font-size: 12px;
    background: var(--roi-gray-50);
    border-radius: var(--roi-radius-md);
    border: 2px dashed var(--roi-gray-200);
}

.roi-no-modules-icon {
    font-size: 20px;
    margin-bottom: var(--roi-space-xs);
    display: block;
}

/* Disclaimer */
.roi-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: var(--roi-space-md) var(--roi-space-lg);
    margin-top: auto;
    background: var(--roi-gray-50);
    border-top: 1px solid var(--roi-gray-100);
}

.roi-disclaimer svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--roi-gray-500);
    margin-top: 1px;
}

.roi-disclaimer p {
    font-size: 11px;
    color: var(--roi-gray-600);
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   Contact Section - Better CTA and transition
   ========================================================================== */
.roi-contact-section {
    padding: var(--roi-space-lg);
    border-top: 2px solid var(--roi-gray-100);
    background: linear-gradient(180deg, var(--roi-gray-50) 0%, var(--roi-white) 100%);
}

.roi-contact-header {
    text-align: center;
    margin-bottom: var(--roi-space-md);
}

.roi-contact-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--roi-gray-800);
    margin: 0 0 4px;
}

.roi-contact-subhead {
    font-size: 13px;
    color: var(--roi-gray-600);
    margin: 0;
}

/* Dynamic savings in CTA */
.roi-savings-cta {
    color: var(--roi-success);
    font-weight: 700;
}

/* ==========================================================================
   Contact Form 7 Styling
   ========================================================================== */
.roi-cf7-form {
    padding: 0;
}

.roi-cf7-form .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: var(--roi-space-sm);
}

.roi-cf7-form .wpcf7-form p {
    margin: 0;
}

.roi-cf7-form .wpcf7-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--roi-gray-800);
    margin-bottom: 6px;
}

.roi-cf7-form .wpcf7-form-control:not(.wpcf7-submit) {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    color: var(--roi-gray-800);
    background: var(--roi-white);
    border: 2px solid var(--roi-gray-200);
    border-radius: var(--roi-radius-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.roi-cf7-form .wpcf7-form-control:not(.wpcf7-submit):hover {
    border-color: var(--roi-gray-300);
}

.roi-cf7-form .wpcf7-form-control:not(.wpcf7-submit):focus {
    outline: 2px solid var(--roi-secondary);
    outline-offset: 2px;
    border-color: var(--roi-secondary);
}

.roi-cf7-form .wpcf7-form-control::placeholder {
    color: var(--roi-gray-500);
}

.roi-cf7-form textarea.wpcf7-form-control {
    min-height: 50px;
    resize: vertical;
}

.roi-cf7-form .wpcf7-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--roi-white);
    background: linear-gradient(135deg, var(--roi-accent) 0%, var(--roi-accent-dark) 100%);
    border: none;
    border-radius: var(--roi-radius-md);
    cursor: pointer;
    box-shadow: var(--roi-shadow-md);
    width: 100%;
    margin-top: var(--roi-space-md);
    transition: all 0.2s ease;
}

.roi-cf7-form .wpcf7-submit:hover {
    transform: translateY(-1px);
    box-shadow: var(--roi-shadow-lg), 0 0 0 3px rgba(25, 181, 165, 0.2);
}

.roi-cf7-form .wpcf7-submit:active {
    transform: translateY(0);
    box-shadow: var(--roi-shadow-sm);
}

.roi-cf7-form .wpcf7-submit:focus {
    outline: 2px solid var(--roi-secondary);
    outline-offset: 2px;
}

.roi-cf7-form .wpcf7-spinner {
    display: none;
}

.roi-cf7-form .wpcf7-response-output {
    margin: var(--roi-space-md) 0 0 !important;
    padding: var(--roi-space-md) !important;
    border-radius: var(--roi-radius-sm) !important;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
}

.roi-cf7-form .wpcf7-form.sent .wpcf7-response-output {
    background: var(--roi-success-light);
    color: var(--roi-success);
    border: 1px solid rgba(5, 150, 105, 0.2) !important;
}

.roi-cf7-form .wpcf7-form.failed .wpcf7-response-output,
.roi-cf7-form .wpcf7-form.invalid .wpcf7-response-output {
    background: var(--roi-error-light);
    color: var(--roi-error);
    border: 1px solid rgba(220, 38, 38, 0.2) !important;
}

.roi-cf7-form .wpcf7-not-valid-tip {
    font-size: 11px;
    color: var(--roi-error);
    margin-top: 4px;
}

/* ==========================================================================
   Mobile Floating Results Button
   ========================================================================== */
.roi-mobile-results-btn {
    display: none;
    position: fixed;
    bottom: var(--roi-space-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--roi-white);
    background: linear-gradient(135deg, var(--roi-accent) 0%, var(--roi-accent-dark) 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(25, 181, 165, 0.4);
    transition: all 0.2s ease;
    align-items: center;
    gap: 8px;
}

.roi-mobile-results-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 24px rgba(25, 181, 165, 0.5);
}

.roi-mobile-results-btn svg {
    width: 18px;
    height: 18px;
}

.roi-mobile-results-btn .roi-mobile-savings {
    font-weight: 700;
}

/* Hide floating button when results are visible */
.roi-mobile-results-btn.roi-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet landscape and below */
@media (max-width: 1024px) {
    .roi-calculator-grid {
        grid-template-columns: 1fr;
        gap: var(--roi-space-lg);
    }

    .roi-config-panel,
    .roi-results-panel {
        position: static;
    }

    /* Show mobile floating button */
    .roi-mobile-results-btn {
        display: flex;
    }

    /* Ensure proper order on tablets */
    .roi-config-panel {
        order: 1;
    }

    .roi-results-panel {
        order: 2;
    }
}

/* Tablet portrait and below */
@media (max-width: 768px) {
    .roi-main-section {
        padding: var(--roi-space-xl) 0;
    }

    /* Panel header improvements */
    .roi-panel-header {
        padding: var(--roi-space-sm) var(--roi-space-md);
        gap: var(--roi-space-sm);
    }

    .roi-panel-icon {
        width: 26px;
        height: 26px;
    }

    .roi-panel-icon svg {
        width: 13px;
        height: 13px;
    }

    .roi-panel-header h2 {
        font-size: 13px;
    }

    .roi-panel-header p {
        font-size: 10px;
    }

    /* Totals cards - stack vertically */
    .roi-totals {
        flex-direction: column;
        gap: var(--roi-space-sm);
        padding: var(--roi-space-md);
    }

    .roi-total-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: var(--roi-space-md);
    }

    .roi-total-card-right {
        text-align: right;
    }

    .roi-total-value {
        font-size: 20px;
    }

    /* Form grid single column */
    .roi-form-grid {
        grid-template-columns: 1fr;
    }

    /* Modules stack vertically */
    .roi-modules-grid {
        flex-direction: column;
    }

    .roi-module-chip {
        min-width: 100%;
    }

    /* Larger touch targets for module chips */
    .roi-chip-content {
        padding: 14px 16px;
        min-height: 48px;
    }

    .roi-chip-icon {
        font-size: 18px;
    }

    .roi-chip-name {
        font-size: 14px;
    }

    /* Form field improvements */
    .roi-select,
    .roi-number-input {
        height: 48px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .roi-field input[type="text"],
    .roi-field input[type="email"],
    .roi-field textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 12px 14px;
    }

    /* Breakdown section */
    .roi-breakdown {
        padding: var(--roi-space-sm) var(--roi-space-md);
    }

    .roi-module-result-item {
        padding: var(--roi-space-sm) var(--roi-space-md);
    }

    .roi-module-result-savings {
        flex-direction: column;
        gap: 2px;
    }

    /* Contact section */
    .roi-contact-section {
        padding: var(--roi-space-lg);
    }

    .roi-contact-header h3 {
        font-size: 18px;
    }

    /* Mobile button adjustments */
    .roi-mobile-results-btn {
        padding: 14px 20px;
        font-size: 14px;
        bottom: var(--roi-space-lg);
        max-width: calc(100% - var(--roi-space-xl));
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .roi-calculator-page .container {
        padding: 0 var(--roi-space-md);
    }

    .roi-main-section {
        padding: var(--roi-space-lg) 0;
    }

    /* Panel header - more compact */
    .roi-panel-header {
        padding: var(--roi-space-sm);
        flex-direction: row;
        text-align: left;
        gap: var(--roi-space-sm);
    }

    .roi-panel-icon {
        width: 24px;
        height: 24px;
    }

    .roi-panel-icon svg {
        width: 12px;
        height: 12px;
    }

    .roi-panel-header h2 {
        font-size: 12px;
    }

    .roi-panel-header p {
        font-size: 9px;
    }

    /* Config form */
    .roi-config-form {
        padding: var(--roi-space-md);
        gap: var(--roi-space-md);
    }

    /* Modules field */
    .roi-modules-field {
        padding: var(--roi-space-sm);
    }

    .roi-modules-field .roi-modules-label {
        font-size: 14px;
    }

    .roi-modules-hint {
        font-size: 12px;
    }

    /* Field labels and hints */
    .roi-field-header label {
        font-size: 14px;
    }

    .roi-field-hint {
        font-size: 12px;
    }

    /* Totals - compact horizontal layout */
    .roi-totals {
        padding: var(--roi-space-sm);
        gap: var(--roi-space-xs);
    }

    .roi-total-card {
        padding: var(--roi-space-sm) var(--roi-space-md);
    }

    .roi-total-label {
        font-size: 9px;
    }

    .roi-total-label svg {
        width: 10px;
        height: 10px;
    }

    .roi-total-value {
        font-size: 16px;
    }

    .roi-total-suffix {
        font-size: 9px;
    }

    /* Breakdown section */
    .roi-breakdown {
        padding: var(--roi-space-xs) var(--roi-space-sm);
    }

    .roi-breakdown-title {
        font-size: 10px;
        margin-bottom: var(--roi-space-xs);
    }

    .roi-breakdown-list {
        gap: 2px;
    }

    .roi-module-result-item {
        padding: var(--roi-space-xs) var(--roi-space-sm);
    }

    .roi-module-result-header {
        margin-bottom: 2px;
    }

    .roi-module-result-icon {
        font-size: 12px;
    }

    .roi-module-result-name {
        font-size: 11px;
    }

    .roi-module-result-savings {
        padding-left: 18px;
        gap: 1px;
    }

    .roi-module-result-label,
    .roi-module-result-value {
        font-size: 10px;
    }

    .roi-no-modules {
        padding: var(--roi-space-sm);
        font-size: 11px;
    }

    .roi-no-modules-icon {
        font-size: 16px;
    }

    /* Disclaimer */
    .roi-disclaimer {
        padding: var(--roi-space-sm) var(--roi-space-md);
    }

    .roi-disclaimer svg {
        width: 12px;
        height: 12px;
    }

    .roi-disclaimer p {
        font-size: 10px;
    }

    /* Contact section */
    .roi-contact-section {
        padding: var(--roi-space-md);
    }

    .roi-contact-header h3 {
        font-size: 16px;
    }

    .roi-contact-subhead {
        font-size: 12px;
    }

    /* Contact form inputs */
    .roi-contact-section .roi-field input[type="text"],
    .roi-contact-section .roi-field input[type="email"] {
        padding: 12px;
        font-size: 16px;
    }

    .roi-contact-section .roi-field textarea {
        padding: 12px;
        font-size: 16px;
        min-height: 60px;
    }

    .roi-contact-section .roi-field label {
        font-size: 11px;
    }

    /* CF7 form adjustments */
    .roi-cf7-form .wpcf7-form-control:not(.wpcf7-submit) {
        padding: 12px;
        font-size: 16px;
    }

    .roi-cf7-form .wpcf7-form label {
        font-size: 11px;
    }

    .roi-cf7-form textarea.wpcf7-form-control {
        min-height: 60px;
    }

    /* Submit buttons */
    .roi-submit-btn,
    .roi-cf7-form .wpcf7-submit {
        padding: 14px 20px;
        font-size: 14px;
        min-height: 48px;
    }

    /* Mobile results button */
    .roi-mobile-results-btn {
        bottom: var(--roi-space-md);
        padding: 12px 16px;
        font-size: 13px;
        gap: 6px;
        max-width: calc(100% - var(--roi-space-lg));
    }

    .roi-mobile-results-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Results panel header accent on mobile - matches config panel */
    .roi-panel-header-accent {
        padding: var(--roi-space-sm);
    }

    .roi-panel-header-accent h2 {
        font-size: 12px;
    }

    .roi-panel-header-accent p {
        font-size: 9px;
    }

    .roi-panel-header-accent .roi-panel-icon {
        width: 24px;
        height: 24px;
    }

    .roi-panel-header-accent .roi-panel-icon svg {
        width: 12px;
        height: 12px;
    }
}

/* Very small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
    .roi-calculator-page .container {
        padding: 0 var(--roi-space-sm);
    }

    .roi-main-section {
        padding: var(--roi-space-md) 0;
    }

    .roi-panel-header {
        padding: var(--roi-space-xs) var(--roi-space-sm);
    }

    .roi-panel-icon {
        width: 22px;
        height: 22px;
    }

    .roi-panel-icon svg {
        width: 11px;
        height: 11px;
    }

    .roi-panel-header h2 {
        font-size: 11px;
    }

    .roi-panel-header p {
        font-size: 8px;
    }

    .roi-config-form {
        padding: var(--roi-space-sm);
        gap: var(--roi-space-sm);
    }

    /* Totals as stacked columns on very small screens */
    .roi-totals {
        flex-direction: column;
        gap: var(--roi-space-xs);
    }

    .roi-total-card {
        flex-direction: row;
        justify-content: space-between;
    }

    .roi-total-value {
        font-size: 15px;
    }

    .roi-field-header label {
        font-size: 13px;
    }

    .roi-field-hint {
        font-size: 11px;
    }

    .roi-chip-content {
        padding: 12px 14px;
    }

    .roi-chip-name {
        font-size: 13px;
    }

    /* Breakdown */
    .roi-breakdown {
        padding: var(--roi-space-xs);
    }

    .roi-module-result-savings {
        padding-left: 14px;
    }

    .roi-module-result-label,
    .roi-module-result-value {
        font-size: 9px;
    }

    /* Contact */
    .roi-contact-section {
        padding: var(--roi-space-sm);
    }

    .roi-contact-header {
        margin-bottom: var(--roi-space-sm);
    }

    .roi-contact-header h3 {
        font-size: 14px;
    }

    .roi-submit-btn,
    .roi-cf7-form .wpcf7-submit {
        padding: 12px 16px;
        font-size: 13px;
    }

    .roi-mobile-results-btn {
        padding: 10px 14px;
        font-size: 12px;
        bottom: var(--roi-space-sm);
    }
}

/* Landscape orientation fixes for mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .roi-main-section {
        padding: var(--roi-space-lg) 0;
    }

    .roi-calculator-grid {
        gap: var(--roi-space-md);
    }

    .roi-panel-header {
        flex-direction: row;
        text-align: left;
    }

    /* In landscape, use horizontal totals */
    .roi-totals {
        flex-direction: row;
    }

    .roi-total-card {
        flex-direction: column;
        text-align: center;
    }

    .roi-total-card-right {
        text-align: center;
    }

    /* Mobile button at bottom right in landscape */
    .roi-mobile-results-btn {
        left: auto;
        right: var(--roi-space-md);
        transform: none;
        bottom: var(--roi-space-md);
    }

    .roi-mobile-results-btn:hover {
        transform: translateY(-2px);
    }

    .roi-mobile-results-btn.roi-hidden {
        transform: translateY(20px);
        opacity: 0;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .roi-calculator-page .container {
        padding-left: max(var(--roi-space-md), env(safe-area-inset-left));
        padding-right: max(var(--roi-space-md), env(safe-area-inset-right));
    }

    .roi-mobile-results-btn {
        bottom: max(var(--roi-space-md), env(safe-area-inset-bottom));
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .roi-chip-content {
        border-width: 3px;
    }

    .roi-select,
    .roi-number-input {
        border-width: 3px;
    }

    .roi-module-chip input:checked + .roi-chip-content {
        border-color: var(--roi-primary);
        background: var(--roi-white);
    }
}

/* ==========================================================================
   Accessibility - Skip to results link (screen readers)
   ========================================================================== */
.roi-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--roi-primary);
    color: var(--roi-white);
    padding: 8px 16px;
    z-index: 100;
    text-decoration: none;
    border-radius: var(--roi-radius-sm);
}

.roi-skip-link:focus {
    top: var(--roi-space-sm);
}

/* Focus visible for better keyboard navigation */
.roi-calculator-page *:focus-visible {
    outline: 2px solid var(--roi-secondary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .roi-calculator-page *,
    .roi-calculator-page *::before,
    .roi-calculator-page *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

}
