/* ROI Calculator Styles */
.hero {
    position: relative;
    height: 50vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(0, 162, 224, 0.9), rgba(0, 166, 81, 0.9));
    color: var(--light-color);
    overflow: hidden;
    padding-top: 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/pattern.svg') repeat;
    opacity: 0.1;
}

.hero .container {
    max-width: 800px;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.section.calculator-section {
    padding: 40px 0;
}

.calculator-container {
    background: var(--light-color);
    padding: 30px;
    border-radius: 12px;
}

.calculator-form {
    display: flex;
    gap: 20px;
}

.form-section {
    display: grid;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #555;
    font-family: 'Poppins', sans-serif;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #008080;
    box-shadow: 0 0 0 2px rgba(0, 128, 128, 0.2);
}

.form-group input:invalid:focus {
    border-color: #d32f2f;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.2);
}

.form-submit {
    text-align: center;
    margin-top: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #00a651);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #006666, #009999);
}

.btn {
    /* background: #fff; */
    color: #333;
    padding: 12px 24px;
    /* border: 1px solid #ddd; */
    border-radius: 6px;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

.btn:hover {
    background: #f5f5f5;
    color: #008080;
}

.results-section {
    margin-top: 40px;
    display: none;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: var(--light-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.result-card h3 {
    font-size: 1.2rem;
    color: #444;
    margin-bottom: 10px;
    font-family: 'Poppins', sans-serif;
}

.result-card .value {
    font-size: 1.5rem;
    color: #008080;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

.chart-container {
    margin-bottom: 30px;
}

.chart-container canvas {
    width: 100%;
    max-height: 400px;
}

.action-buttons {
    text-align: center;
}

.action-buttons button {
    margin: 10px;
}

.action-buttons i {
    margin-right: 8px;
}

.calculator-intro {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    margin-bottom: 50px;
}

.calculation-method {
    max-width: 800px;
    margin: 0 auto;
}

.calculation-item {
    margin-bottom: 30px;
}

.calculation-item h3 {
    margin-bottom: 15px;
}

.calculation-item p {
    margin-bottom: 10px;
}

.calculation-item .formula {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
}

.case-studies {
    background-color: #f9f9f9;
}

.card ul {
    list-style: none;
    margin-bottom: 20px;
}

.card ul li {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
}

.card ul li i {
    color: var(--primary-color);
    margin-right: 10px;
    margin-top: 5px;
}

.cta {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--light-color);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/pattern.svg') repeat;
    opacity: 0.1;
}

.cta .container {
    position: relative;
    z-index: 1;
}

.cta h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.cta p {
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.cta-button {
    margin-top: 30px;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    z-index: 1001;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.email-modal-content {
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.modal-body {
    padding: 25px;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.modal-body input,
.modal-body select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.modal-body input:focus,
.modal-body select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 128, 128, 0.1);
}

.modal-body button[type="submit"] {
    width: 100%;
    margin-top: 10px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #d32f2f;
}

.error-message i {
    font-size: 4rem;
    margin-bottom: 20px;
}

.success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-message i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .section {
        padding: 30px 25px;
    }

    .calculator-container {
        padding: 20px;
    }

    h2 {
        font-size: 1.8rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    h4 {
        font-size: 1.2rem;
    }

    .form-group input {
        font-size: 0.9rem;
        padding: 10px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .result-card {
        padding: 15px;
    }

    .result-card h3 {
        font-size: 1.1rem;
    }

    .result-card .value {
        font-size: 1.3rem;
    }

    .btn-primary, .btn {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
    .calculator-form {
        grid-template-columns:1fr; /* single column on mobile */
    }

    .calculator-form .bottom {
        grid-column: span 1; /* reset to one column */
    }

    .chart-container canvas {
        max-height: 300px;
    }
}