/**
 * BailCalc Pro - Styles harmonisés
 * Unifie tous les outils Pro avec une UX cohérente
 */

/* === VARIABLES PRO === */
:root {
    --pro-primary: #4F46E5;
    --pro-primary-dark: #4338CA;
    --pro-gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --pro-bg-light: #F9FAFB;
}

/* === LAYOUT === */
.pro-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.pro-container-wide {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* === NAVIGATION PRO (intégrée) === */
.nav-pro {
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.nav-menu-pro-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
}

.nav-menu-pro {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: flex-end;
}

.nav-menu-pro .nav-link-pro {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    color: #FFFFFF;
    background: #4338CA;
    border: 1px solid #3730A3;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.nav-menu-pro .nav-link-icon {
    font-size: 1rem;
    line-height: 1;
}

.nav-menu-pro .nav-link-text {
    white-space: nowrap;
}

.nav-menu-pro .nav-link-pro:hover {
    background: #312E81;
    color: #FFFFFF;
    border-color: #312E81;
}

.nav-menu-pro .nav-link-pro.nav-link-active {
    background: #111827;
    color: #FFFFFF;
    border-color: #111827;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.25);
}

.nav-menu-pro .nav-link-pro.nav-link-active:hover {
    background: #0F172A;
    border-color: #0F172A;
    color: #FFFFFF;
}

@media (max-width: 900px) {
    .nav-menu-pro-wrap {
        width: 100%;
        justify-content: flex-start;
    }
    .nav-menu-pro {
        justify-content: flex-start;
        gap: 6px 8px;
        /* Tous les boutons visibles comme sur le dashboard (pas de max-height) */
    }
    .nav-menu-pro .nav-link-pro {
        padding: 8px 12px;
        font-size: 0.875rem;
    }
    .nav-menu-pro .nav-link-text {
        white-space: nowrap;
    }
}

.pro-link {
    color: var(--pro-primary);
    text-decoration: underline;
}

.pro-link:hover {
    color: var(--pro-primary-dark);
}

/* === HERO SECTIONS === */
.pro-hero {
    padding: var(--spacing-2xl, 3rem) 0;
    min-height: 80vh;
}

.pro-hero-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: var(--spacing-sm, 0.5rem);
    text-align: center;
    color: var(--gray-900, #111827);
}

.pro-hero-subtitle {
    text-align: center;
    color: var(--gray-600, #6B7280);
    margin-bottom: var(--spacing-xl, 2rem);
    font-size: 1.0625rem;
    line-height: 1.6;
}

/* === CARDS === */
.generator-card {
    background: white;
    border-radius: var(--radius-2xl, 1rem);
    padding: var(--spacing-xl, 2rem);
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
}

.info-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border-left: 4px solid var(--pro-primary);
    margin-bottom: 24px;
}

.info-box svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.info-box strong {
    color: var(--pro-primary);
}

/* === FORMS === */
.form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md, 1rem);
    color: var(--gray-900, #1F2937);
}

.form-divider {
    margin: 30px 0;
    border: none;
    border-top: 1px solid #E5E7EB;
}

.field-hint {
    font-size: 13px;
    color: #6B7280;
    margin-top: 6px;
}

/* Property selector */
.property-selector {
    margin-bottom: 30px;
}

.property-selector .form-label {
    font-size: 16px;
    font-weight: 600;
}

.property-selector .form-input {
    font-size: 15px;
    font-weight: 500;
}

/* === BUTTONS === */
.btn-primary {
    background: var(--pro-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--pro-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--pro-primary);
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid var(--pro-primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #EEF2FF;
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-full {
    width: 100%;
}

/* Accès rapide aux outils (dashboard Pro) */
.tools-quick-access {
    padding: 0 0 80px;
}

.tools-quick-access-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
    color: #1F2937;
}

.tools-quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

/* Bloc Partenaires (intégré sur plusieurs pages) */
.partenaires-teaser {
    padding: 2rem 0;
    background: linear-gradient(180deg, #F9FAFB 0%, #fff 100%);
    border-top: 1px solid #E5E7EB;
}
.partenaires-teaser .partenaires-teaser-inner {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}
.partenaires-teaser .partenaires-teaser-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1F2937;
    margin: 0 0 0.5rem;
}
.partenaires-teaser .partenaires-teaser-desc {
    font-size: 0.9375rem;
    color: #6B7280;
    margin: 0 0 1.25rem;
    line-height: 1.5;
}
.partenaires-teaser .partenaires-teaser-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--pro-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}
.partenaires-teaser .partenaires-teaser-link:hover {
    color: var(--pro-primary-dark);
}
.partenaires-teaser .partenaires-teaser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 0 0 1.25rem;
}
.partenaires-teaser .partenaires-mini-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #C7D2FE;
    border-radius: 10px;
    background: #EEF2FF;
    color: #312E81;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}
.partenaires-teaser .partenaires-mini-card:hover {
    background: #E0E7FF;
    border-color: #A5B4FC;
    color: #1E1B4B;
}

.tool-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: var(--spacing-md, 1rem) var(--spacing-lg, 1.25rem);
    background: white;
    border: 2px solid var(--gray-200, #E5E7EB);
    border-radius: var(--radius-lg, 12px);
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-700, #374151);
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.tool-card:hover {
    border-color: var(--pro-primary);
    background: #EEF2FF;
    color: var(--pro-primary);
}

.tool-card:focus {
    outline: none;
    border-color: var(--pro-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* === RESULTS === */
.results-section {
    margin-top: 40px;
}

.results-card {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border-radius: 16px;
    padding: 32px;
}

.results-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #059669;
}

/* === PROPERTY CARDS === */
.property-card {
    background: var(--pro-bg-light);
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.property-card:hover {
    border-color: var(--pro-primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.property-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.property-action-btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.property-action-btn.primary {
    background: var(--pro-primary);
    color: white;
}

.property-action-btn.primary:hover {
    background: var(--pro-primary-dark);
}

.property-action-btn.secondary {
    background: white;
    color: #6B7280;
    border: 1px solid #E5E7EB;
}

.property-action-btn.secondary:hover {
    background: var(--pro-bg-light);
    border-color: var(--pro-primary);
    color: var(--pro-primary);
}

/* === STATS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-label {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--pro-primary);
}

/* === MODALS === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #1F2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6B7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--pro-bg-light);
    color: #1F2937;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* === DASHBOARD SPECIFIC === */
.pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
    color: #000;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.dashboard-hero {
    padding: 40px 0 30px;
    background: var(--pro-gradient);
    color: white;
}

.dashboard-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.dashboard-subtitle {
    font-size: 16px;
    opacity: 0.9;
}

/* Stat Cards - Dashboard specific styling */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: -30px 0 40px; /* Negative margin pour chevaucher le hero */
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
}

.icon-purple { background: linear-gradient(135deg, #F3E8FF 0%, #E9D5FF 100%); }
.icon-blue { background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%); }
.icon-green { background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%); }
.icon-yellow { background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%); }

/* === SECTIONS === */
.section {
    background: white;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* En-tête de section Pro (dashboard, etc.) : titre à gauche, bouton à droite */
.section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section .section-title {
    font-size: 22px;
    font-weight: 600;
    color: #1F2937;
    margin: 0;
}

/* === PROFILE === */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.profile-field {
    padding: 16px;
    background: var(--pro-bg-light);
    border-radius: 8px;
}

.profile-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6B7280;
    margin-bottom: 4px;
}

.profile-value {
    font-size: 16px;
    color: #1F2937;
    font-weight: 500;
}

.profile-empty {
    color: #9CA3AF;
    font-style: italic;
}

/* === PROPERTIES === */
.properties-list {
    display: grid;
    gap: 16px;
}

.property-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.property-name {
    font-size: 18px;
    font-weight: 600;
    color: #1F2937;
    margin: 0 0 4px;
}

.property-address {
    font-size: 14px;
    color: #6B7280;
}

.property-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 16px 0;
    padding: 16px;
    background: white;
    border-radius: 8px;
}

.property-info-item {
    display: flex;
    flex-direction: column;
}

.property-info-label {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 4px;
}

.property-info-value {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
}

/* === BUTTONS EXTENDED === */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-danger {
    background: #EF4444;
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
}

/* === FORMS EXTENDED === */
.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid-2 {
    grid-template-columns: 1fr 1fr;
}

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

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-input,
.form-select {
    padding: 10px 14px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
}

select.form-input,
select.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.5rem;
    cursor: pointer;
    background-color: #fff;
    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='%234F46E5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 1.15rem;
}

select.form-input:hover,
select.form-select:hover {
    border-color: #D1D5DB;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--pro-primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* === EMPTY STATES === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6B7280;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 15px;
    margin-bottom: 24px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .pro-hero-title {
        font-size: 24px;
    }

    .generator-card {
        padding: 20px;
    }

    .info-box {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        margin: 0 0 40px; /* Pas de negative margin sur mobile */
    }

    .property-actions {
        flex-direction: column;
    }

    .property-action-btn {
        width: 100%;
        text-align: center;
    }

    .modal-content {
        padding: 24px;
        width: 95%;
    }

    .btn-large {
        padding: 12px 24px;
        font-size: 15px;
    }

    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .property-info {
        grid-template-columns: 1fr;
    }

    /* Suivi loyers : cartes empilées, actions en colonne sur mobile */
    #properties-container {
        display: block;
    }
    .property-header {
        flex-direction: column;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }
    .suivi-card-actions {
        flex-direction: column;
        gap: 10px;
    }
    .suivi-card-actions .btn,
    .suivi-card-actions .property-action-btn,
    .suivi-card-actions a[class*="property-action"] {
        width: 100%;
        min-height: 44px;
        padding: 12px 16px;
        text-align: center;
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
    }
    /* Polices lisibles sur mobile (min 14px) */
    .property-card .property-info-label,
    .property-card .suivi-meta,
    .property-card .suivi-status-badge,
    .property-card .suivi-tag,
    .property-card .suivi-history,
    .property-card .suivi-history-item {
        font-size: 14px;
    }
    .section .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .section .section-header .btn {
        min-height: 44px;
        font-size: 15px;
    }
    .suivi-toolbar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .pro-container,
    .pro-container-wide {
        padding: 0 0.75rem;
    }

    .pro-hero {
        padding: 40px 0;
    }

    .form-section-title {
        font-size: 16px;
    }

    .section {
        padding: 20px;
    }

    .dashboard-title {
        font-size: 24px;
    }
}

/* ===================================
   Pro Visual Refresh (non-breaking)
   =================================== */

.dashboard-hero {
    background:
        radial-gradient(900px 260px at 20% -20%, rgba(255, 255, 255, 0.24), transparent 55%),
        radial-gradient(700px 220px at 80% -10%, rgba(196, 181, 253, 0.3), transparent 58%),
        var(--pro-gradient);
}

.dashboard-title,
.pro-hero-title {
    letter-spacing: -0.015em;
}

.generator-card,
.section,
.property-card,
.stat-card,
.modal-content {
    border: 1px solid rgba(17, 24, 39, 0.06);
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
}

.stat-card {
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(17, 24, 39, 0.12);
}

.tools-quick-access-grid .tool-card {
    min-height: 60px;
    border-radius: 12px;
    border-color: #D7DCEF;
}

.tools-quick-access-grid .tool-card:hover {
    transform: translateY(-1px);
}

.property-card {
    background: linear-gradient(180deg, #ffffff 0%, #FBFCFF 100%);
}

.property-card .btn,
.property-action-btn,
.form-actions .btn {
    min-height: 42px;
}

.form-input,
.form-select,
textarea.form-input {
    border-radius: 10px;
}

.modal {
    backdrop-filter: blur(2px);
}

.modal-content {
    border-radius: 18px;
}

.modal-header {
    padding-bottom: 12px;
    border-bottom: 1px solid #ECEFF5;
}
