/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Info Banner */
.info-banner {
    background: #dbeafe;
    border-left: 4px solid var(--secondary-color);
    padding: 20px;
    margin: 20px 40px;
    border-radius: 8px;
}

.info-banner p {
    margin: 0;
    color: var(--primary-color);
    font-weight: 500;
}

/* Form Sections */
.form-section {
    padding: 40px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.required-note {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.875rem;
}

.required {
    color: var(--danger-color);
}

/* Checkbox and Radio Groups */
.checkbox-group,
.radio-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}

.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group label,
.radio-group label {
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
    flex: 1;
}

.important-check {
    background: #fef3c7;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid var(--warning-color);
}

/* Consent Section */
.consent-section {
    background: var(--bg-light);
}

.consent-box {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    margin-bottom: 25px;
}

.consent-box .checkbox-group {
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 15px;
}

.warning-note {
    color: var(--warning-color);
    font-weight: 600;
    margin-top: 15px;
    text-align: center;
}

.privacy-info {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.privacy-info h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.privacy-info h4 {
    color: var(--text-color);
    margin: 20px 0 10px;
    font-size: 1.1rem;
}

.contact-info p {
    margin: 8px 0;
}

.contact-info a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Conditional Sections */
.conditional-section {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.conditional-section h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 15px;
}

/* Info Links */
.info-link {
    margin-bottom: 20px;
}

.help-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    background: #dbeafe;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.help-link:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

/* Result Boxes */
.result-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-top: 30px;
    text-align: center;
}

.result-box h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.result-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 10px 0;
}

.result-box .note {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 15px;
    font-style: italic;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: var(--success-color);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.form-actions {
    padding: 40px;
    text-align: center;
    background: var(--bg-light);
}

/* Results Section */
.results-section {
    margin-top: 40px;
    padding: 30px;
    background: var(--bg-light);
    border-radius: 12px;
}

.results-section h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
}

.result-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-card h4 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.result-row span:first-child {
    color: var(--text-light);
}

.result-row span:last-child {
    font-weight: 600;
    color: var(--text-color);
}

.result-row.highlight {
    background: #fef3c7;
    padding: 12px 15px;
    border-radius: 6px;
    margin: 8px 0;
}

.result-row.total {
    background: var(--primary-color);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 1.1rem;
}

.result-row.total span {
    color: white !important;
}

/* Ratio Boxes */
.ratios {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ratios h4 {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.info-note {
    color: white;
    opacity: 0.9;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.ratio-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    text-align: center;
}

.ratio-box:last-child {
    margin-bottom: 0;
}

.ratio-label {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 10px;
}

.ratio-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 10px 0;
}

.ratio-status {
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 10px;
}

.ratio-status.excellent {
    background: #d1fae5;
    color: #065f46;
}

.ratio-status.good {
    background: #dbeafe;
    color: #1e40af;
}

.ratio-status.warning {
    background: #fef3c7;
    color: #92400e;
}

.ratio-status.danger {
    background: #fee2e2;
    color: #991b1b;
}

.ratio-box small {
    display: block;
    color: var(--text-light);
    margin-top: 10px;
}

/* Warning Card */
.warning-card {
    background: #fef3c7;
    border: 2px solid var(--warning-color);
}

.warning-card h4 {
    color: #92400e;
}

.warning-card ul {
    list-style: none;
    padding: 0;
}

.warning-card li {
    padding: 10px 0;
    color: #92400e;
    font-weight: 500;
}

.warning-card li:before {
    content: "⚠️ ";
    margin-right: 8px;
}

/* Info Card */
.info-card {
    background: #dbeafe;
    border: 2px solid var(--secondary-color);
    text-align: center;
}

.info-card h4 {
    color: var(--primary-color);
}

.info-card p {
    color: var(--text-color);
    margin: 15px 0;
}

.info-card .btn-secondary {
    margin-top: 15px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 40px;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: #000;
}

#modalBody h3 {
    color: var(--primary-color);
    margin: 20px 0 10px;
}

#modalBody p {
    margin: 10px 0;
    line-height: 1.8;
}

#modalBody table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

#modalBody th,
#modalBody td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}

#modalBody th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

#modalBody tr:nth-child(even) {
    background: var(--bg-light);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: white;
    font-size: 0.9rem;
}

footer p {
    margin: 5px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 12px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .form-section {
        padding: 25px 20px;
    }

    .info-banner {
        margin: 15px 20px;
        padding: 15px;
    }

    .result-amount {
        font-size: 2rem;
    }

    .ratio-value {
        font-size: 2.5rem;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 25px;
    }

    .result-row {
        flex-direction: column;
        gap: 5px;
    }

    .result-row span:first-child {
        font-weight: 600;
    }
}

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

.conditional-section,
.results-section {
    animation: fadeIn 0.3s ease;
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    .form-actions,
    .help-link,
    .btn-primary,
    .btn-secondary,
    .powerapp-nav {
        display: none;
    }
}

/* Bouton PowerApp */
.btn-powerapp:hover {
    background: linear-gradient(135deg, #5a1f5a 0%, #7a3d7a 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(116, 39, 116, 0.4) !important;
}
