/* Calculator specific styles */
.calculator-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    margin-bottom: 80px;
    contain: content;
}

.calculator-wrapper {
    background: #fff;
    padding: 40px;
    border: 1px solid var(--pinstripe);
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.calculator-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px var(--shaddow);
}

/* Form styles */
.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--black);
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 1px solid var(--pinstripe);
    border-radius: 2px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: white;
    width: 100%;
    color: var(--black);
    -webkit-appearance: none;
    appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--blue-fisagency);
    box-shadow: 0 0 0 3px rgba(44, 69, 125, 0.1);
}

.form-group input::placeholder {
    color: var(--body-display);
    opacity: 0.7;
}

/* Input hint styling */
.input-hint {
    font-size: 12px;
    color: var(--body-display);
    margin-top: 4px;
    transition: color 0.3s ease;
}

.form-group.error .input-hint {
    color: var(--red-warning);
}

/* Button styles */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 2px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.button-primary {
    background: var(--blue-fisagency);
    color: white;
    border: none;
}

.button-primary:hover {
    background: var(--orange-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 75, 39, 0.15);
}

.button-primary:active {
    background: var(--blue-fisagency);
    transform: translateY(0);
}

.button-primary.loading {
    color: transparent;
    pointer-events: none;
    position: relative;
}

.button-primary.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Results section */
.results-container {
    margin-top: 40px;
    padding: 30px;
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.5s ease-out;
    opacity: 1;
    transform: translateY(0);
}

.results-container.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    contain: layout style;
}

.result-card {
    background: var(--grey);
    padding: 16px;
    border-radius: 2px;
    text-align: center;
}

.result-label {
    display: block;
    font-size: 12px;
    color: var(--body-display);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: var(--black);
}

/* Error message */
.error-message {
    background: var(--red-warning);
    color: white;
    padding: 12px 16px;
    border-radius: 2px;
    margin-bottom: 16px;
    font-size: 14px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Responsive styles */
@media screen and (max-width: 991px) {
    .calculator-container {
        grid-template-columns: 1fr;
    }
    
    .calculator-wrapper {
        padding: 24px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 767px) {
    .calculator-container {
        margin-bottom: 40px;
    }
    
    .result-value {
        font-size: 20px;
    }
    
    .button-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .calculate-button,
    .reset-button {
        padding: 14px 20px;
        font-size: 14px;
        width: 100%;
        height: 44px;
    }
}

/* Enhanced Benchmark Visualization */
.benchmark-comparison {
    margin-top: 32px;
    padding: 32px;
    background: var(--grey);
    border-radius: 2px;
    box-shadow: 0 2px 8px var(--shaddow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.benchmark-comparison:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--shaddow);
}

.benchmark-comparison::before {
    content: 'Industry Benchmarks';
    position: absolute;
    top: 12px;
    left: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--body-display);
    opacity: 0.7;
}

.benchmark-header {
    margin-bottom: 32px;
    text-align: center;
    position: relative;
}

.benchmark-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--black);
    margin: 0;
    position: relative;
    display: inline-block;
}

.benchmark-header h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, var(--blue-fisagency), var(--orange-red));
    border-radius: 2px;
}

.benchmark-visualization {
    padding: 0 32px;
    position: relative;
}

.benchmark-scale {
    position: relative;
    height: 120px;
    margin-top: 40px;
    animation: fadeIn 0.8s ease-out forwards;
    padding-bottom: 60px;
}

.scale-bar {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to right, 
        var(--red-warning) 0%, 
        var(--yellow-warning) 50%, 
        var(--green-success) 100%);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.scale-bar:hover {
    opacity: 1;
    height: 10px;
    transform: translateY(-1px);
}

.scale-marker {
    position: absolute;
    bottom: 50px;
    transform: translateX(-50%);
    cursor: help;
    transition: all 0.3s ease;
    z-index: 2;
    width: 60px;
    text-align: center;
}

.scale-marker::before {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 16px;
    background: var(--black);
    transition: all 0.3s ease;
}

.scale-marker:hover::before {
    height: 20px;
    background: var(--blue-fisagency);
}

.marker-label {
    display: block;
    font-size: 13px;
    color: var(--body-display);
    margin-bottom: 4px;
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.marker-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--black);
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.your-rate {
    position: absolute;
    bottom: 70px;
    transform: translateX(-50%);
    cursor: help;
    transition: all 0.3s ease;
    z-index: 3;
    width: 80px;
    text-align: center;
}

.your-rate::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 20px;
    background: var(--blue-fisagency);
    transition: all 0.3s ease;
}

.your-rate::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translate(-50%, 0);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--blue-fisagency);
    box-shadow: 0 0 0 4px rgba(44, 69, 125, 0.2);
    z-index: 4;
    animation: pulse 1.5s infinite;
}

.rate-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--blue-fisagency);
    margin-bottom: 4px;
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.rate-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--blue-fisagency);
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Hover states */
.scale-marker:hover,
.your-rate:hover {
    transform: translateX(-50%) translateY(-4px);
}

.scale-marker:hover .marker-value,
.your-rate:hover .rate-value {
    color: var(--blue-fisagency);
}

/* Animation keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(44, 69, 125, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(44, 69, 125, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(44, 69, 125, 0);
    }
}

/* Responsive adjustments */
@media screen and (max-width: 767px) {
    .benchmark-comparison {
        padding: 24px 16px;
    }
    
    .benchmark-visualization {
        padding: 0 16px;
    }
    
    .scale-marker {
        width: 50px;
    }
    
    .your-rate {
        width: 70px;
    }
    
    .scale-marker::before {
        height: 12px;
    }
    
    .your-rate::before {
        height: 16px;
    }
    
    .marker-value,
    .rate-value {
        font-size: 14px;
    }
    
    .marker-label,
    .rate-label {
        font-size: 12px;
    }
}

/* Tooltip styles */
.tooltip {
    position: absolute;
    background-color: var(--black);
    color: var(--white);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    max-width: 250px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--black);
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Recommendation styles */
.recommendation {
    margin-top: 24px;
    padding: 24px;
    background: var(--grey);
    border-radius: 2px;
    font-size: 15px;
    line-height: 1.6;
}

.recommendation p {
    margin: 0 0 16px;
}

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

/* Update loading state styles */
.calculate-button.loading {
    position: relative;
    color: transparent;
}

/* Update button styles */
.button-group {
    display: flex;
    gap: 16px;
    width: 100%;
    margin-top: 8px;
}

.calculate-button,
.reset-button {
    padding: 14px 24px;
    border-radius: 2px;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.calculate-button {
    background: var(--blue-fisagency);
    color: white;
    border: none;
}

.calculate-button:hover {
    background: var(--orange-red);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(44, 69, 125, 0.1);
}

.reset-button {
    background: white;
    color: var(--blue-fisagency);
    border: 1px solid var(--blue-fisagency);
}

.reset-button:hover {
    background: var(--grey);
    transform: translateY(-2px);
}

/* Add keyboard focus styles */
.calculate-button:focus-visible,
.reset-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--blue-fisagency);
}

.form-group input:focus-visible,
.form-group select:focus-visible {
    outline: none;
    border-color: var(--blue-fisagency);
    box-shadow: 0 0 0 3px rgba(44, 69, 125, 0.1);
}

/* Info card styles */
.calculator-info {
    position: relative;
}

.info-card {
    background: var(--grey);
    padding: 24px;
    border-radius: 2px;
    position: relative;
}

.info-card h3 {
    font-size: 18px;
    margin: 0 0 16px;
    color: var(--black);
}

.info-card p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--body);
    margin: 0 0 16px;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--body);
}

.feature-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--blue-fisagency);
}

.feature-list li:last-child {
    margin-bottom: 0;
}

/* Calculator header styles */
.calculator-header {
    margin-bottom: 40px;
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.card-icon {
    font-size: 32px;
}

.calculator-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--body);
    margin: 0 0 16px;
}

.calculator-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.calculator-features li {
    position: relative;
    padding-left: 24px;
    font-size: 15px;
    color: var(--body);
}

.calculator-features li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--blue-fisagency);
}

/* Add/update service badge styles to match index page */
.service-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
    margin-top: 4px;
    padding: 5px 14px;
    min-width: 85px;
    height: 24px;
    border-radius: 100px;
    transform: translateY(-1px);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.service-badge.trending {
    background: linear-gradient(135deg, var(--blue-fisagency) 0%, #3A5CA7 90%);
    box-shadow: 0 2px 12px rgba(44, 69, 125, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.badge-text {
    font-size: 10.5px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    font-family: Poppins, sans-serif;
    position: relative;
    z-index: 1;
    opacity: 0.95;
    white-space: nowrap;
    text-align: center;
}

/* Add hover effect */
.calculator-card:hover .service-badge {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 69, 125, 0.12);
}

/* Update card header to match index styling */
.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.card-icon {
    font-size: 32px;
}

/* Add focus styles for accessibility */
:focus-visible {
    outline: 3px solid var(--blue-fisagency);
    outline-offset: 2px;
}

/* Add print styles */
@media print {
    .calculator-form,
    .cta-section {
        display: none;
    }

    .results-container {
        break-inside: avoid;
    }
}

/* Add reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .calculator-wrapper:hover,
    .service-badge,
    .link-arrow {
        transition: none;
    }
}

/* Add high contrast support */
@media (forced-colors: active) {
    .button-primary {
        border: 2px solid ButtonText;
    }
    
    .service-badge {
        border: 1px solid ButtonText;
    }
}

/* Add loading states */
[aria-busy="true"] {
    cursor: progress;
}

/* Add error states */
[aria-invalid="true"] {
    border-color: var(--red-warning);
}

/* Add content-visibility for performance */
.faq-section {
    content-visibility: auto;
    contain-intrinsic-size: 1000px;
}

/* Add loading skeleton styles */
@keyframes shimmer {
    0% { background-position: -468px 0 }
    100% { background-position: 468px 0 }
}

.skeleton {
    background: #f6f7f8;
    background-image: linear-gradient(
        to right,
        #f6f7f8 0%,
        #edeef1 20%,
        #f6f7f8 40%,
        #f6f7f8 100%
    );
    background-repeat: no-repeat;
    background-size: 800px 104px;
    animation: shimmer 1.5s infinite linear;
    contain: content;
}

/* Add intersection observer styles */
.lazy-load {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lazy-load.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Add print optimization */
@media print {
    @page {
        margin: 2cm;
    }
    
    .calculator-form {
        display: none !important;
    }
    
    .results-container {
        display: block !important;
        opacity: 1 !important;
    }
    
    .result-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Update info card styles */
.info-card {
    background: var(--grey);
    padding: 24px;
    border-radius: 2px;
    position: relative;
}

/* Update service badge positioning */
.info-card .service-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    margin: 0;
}

/* Performance indicator */
.performance-indicator {
    margin-top: 40px;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.performance-indicator.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.performance-below {
    background-color: rgba(244, 67, 54, 0.1);
    color: #F44336;
    border-left: 4px solid #F44336;
}

.performance-average {
    background-color: rgba(255, 193, 7, 0.1);
    color: #FFC107;
    border-left: 4px solid #FFC107;
}

.performance-above {
    background-color: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border-left: 4px solid #4CAF50;
}

/* Animation classes for benchmark elements */
.scale-bar.animate-in {
    animation: growWidth 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.scale-marker.animate-in,
.your-rate.animate-in {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes growWidth {
    from {
        transform: scaleX(0);
        transform-origin: left;
    }
    to {
        transform: scaleX(1);
        transform-origin: left;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px) translateX(-50%);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(-50%);
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
} 