/* 1. VARIABLES ET CONFIGURATION */
:root {
    --primary: #2563eb;       /* Bleu moderne */
    --primary-dark: #1e40af;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-app: #f8fafc;        /* Fond gris très léger */
    --white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* Retire le flash bleu au clic sur mobile */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 80px; /* Espace pour la navigation basse */
}

/* 2. LAYOUT & HEADER */
.main-header {
    background: var(--white);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header h1 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 800;
}

.container {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* 3. CARTES DE LOGEMENT (index.php) */
.card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.price-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 0.9rem;
}

.card-content {
    padding: 16px;
}

.card-content h3 {
    margin-bottom: 8px;
    font-size: 1.25rem;
}

.pricing-preview {
    display: flex;
    justify-content: space-between;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 12px;
    margin: 15px 0;
    font-size: 0.85rem;
}

/* 4. FORMULAIRES ET INPUTS */
.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

input[type="text"],
input[type="date"],
input[type="password"] {
    width: 100%;
    padding: 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary);
}

/* 5. BOUTONS */
.btn-primary {
    display: block;
    width: 100%;
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 16px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: bold;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.1s;
}

.btn-primary:active {
    transform: scale(0.98);
    background: var(--primary-dark);
}

/* 6. NAVIGATION MOBILE (Bottom Bar) */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    z-index: 1000;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
}

.nav-item i {
    font-style: normal;
    font-size: 1.4rem;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--primary);
}

/* 7. BADGES DE STATUT (Admin) */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-warning { background: #fef3c7; color: #92400e; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* 8. ÉTAT HORS-LIGNE */
.offline-mode {
    filter: grayscale(0.5);
}

.offline-mode::before {
    content: "Mode Hors-ligne";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--danger);
    color: white;
    text-align: center;
    font-size: 0.8rem;
    z-index: 9999;
    padding: 2px;
}