/**
 * Calculateur Préavis Location - Styles CSS
 * Design mobile-first, sobre et rassurant
 */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #1e40af;
    --primary-blue-dark: #1e3a8a;
    --accent-orange: #f97316;
    --accent-orange-dark: #ea580c;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --background: #f9fafb;
    --white: #ffffff;
    --border-gray: #e5e7eb;
    --success-green: #10b981;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background);
    font-size: 16px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER ===== */
header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

header .subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ===== MAIN CONTENT ===== */
main {
    padding: 2rem 0;
}

/* ===== SECTIONS ===== */
section {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

section h2 {
    color: var(--primary-blue);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

section h3 {
    color: var(--text-dark);
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* ===== ONGLETS ===== */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-gray);
}

.tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-gray);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--primary-blue);
}

.tab.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

.tab-content.hidden {
    display: none;
}

/* ===== FORMULAIRE ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-group .info-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== CHECKBOXES ===== */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.checkbox-label:hover {
    background-color: var(--background);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-blue);
}

/* ===== BOUTON ===== */
.btn-primary {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

/* ===== RÉSULTAT ===== */
.result-section {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 5px solid var(--accent-orange);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.result-box h2 {
    color: var(--text-dark);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.result-box h2 strong {
    color: var(--accent-orange);
}

.result-date {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 500;
}

.result-date strong {
    color: var(--accent-orange);
    font-weight: 700;
}

.result-explanation {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.result-info {
    background: var(--white);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-gray);
    border-left: 3px solid var(--primary-blue);
}

/* ===== BAILLEUR - Alertes et Checklists ===== */
.alerte {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-weight: 500;
}

.alerte-warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.alerte-danger {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.checklist-box {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border: 2px solid var(--border-gray);
}

.checklist-box h4 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.checklist-box ul {
    list-style: none;
    padding-left: 0;
}

.checklist-box li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.checklist-box li::before {
    content: "✓";
    color: var(--success-green);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.info-envoi {
    background: #eff6ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    border-left: 4px solid var(--primary-blue);
}

.info-envoi h4 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.info-envoi ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.info-envoi li {
    margin-bottom: 0.5rem;
}

.info-envoi .warning {
    font-weight: 600;
    color: var(--accent-orange);
    margin-top: 1rem;
}

/* ===== INFORMATIONS ZONES TENDUES ===== */
.zone-list {
    list-style: none;
    padding-left: 0;
}

.zone-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.zone-list li::before {
    content: "•";
    color: var(--accent-orange);
    font-weight: bold;
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: 0.25rem;
}

.source-link {
    margin-top: 1.5rem;
    text-align: center;
}

.source-link a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-blue);
    color: var(--white);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.2s;
}

.source-link a:hover {
    background-color: var(--primary-blue-dark);
    transform: translateY(-2px);
}

/* ===== FAQ ===== */
.faq-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-gray);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    color: var(--primary-blue);
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.faq-item p {
    color: var(--text-gray);
    line-height: 1.7;
}

/* ===== FOOTER ===== */
footer {
    background-color: var(--primary-blue-dark);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

footer p {
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

footer .sources {
    margin-top: 1rem;
    font-size: 0.9rem;
}

footer a {
    color: var(--white);
    text-decoration: underline;
    transition: opacity 0.3s;
}

footer a:hover {
    opacity: 0.8;
}

footer .disclaimer {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 1.5rem;
    font-style: italic;
}

/* ===== RESPONSIVE - TABLET ===== */
@media (min-width: 768px) {
    header h1 {
        font-size: 2.25rem;
    }

    header .subtitle {
        font-size: 1.15rem;
    }

    section {
        padding: 2.5rem;
    }

    section h2 {
        font-size: 1.75rem;
    }

    .result-box h2 {
        font-size: 2rem;
    }

    .result-date {
        font-size: 1.4rem;
    }
}

/* ===== RESPONSIVE - DESKTOP ===== */
@media (min-width: 1024px) {
    .container {
        max-width: 900px;
    }

    header h1 {
        font-size: 2.5rem;
    }

    section {
        padding: 3rem;
    }

    .checkbox-group {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .result-box {
        padding: 2.5rem;
    }
}

/* ===== ACCESSIBILITÉ ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible pour l'accessibilité au clavier */
*:focus-visible {
    outline: 3px solid var(--accent-orange);
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    header {
        background: var(--white);
        color: var(--text-dark);
        box-shadow: none;
    }

    .calculator-section,
    .info-section,
    .faq-section {
        page-break-inside: avoid;
    }

    .result-box {
        background: var(--white);
        border: 2px solid var(--text-dark);
    }

    footer {
        background: var(--white);
        color: var(--text-dark);
    }
}
