/* =========================================================================
   OurCalendar — Feuille de style principale
   Charte : typographie Arial, fond #f4f6f9, accent #2563eb
   ========================================================================= */

/* ------------------------------------------------------------------ Base */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #f4f6f9;
    padding: 20px;
    color: #1e293b;
}

.container {
    max-width: 1200px;
    margin: auto;
}

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

h1 { margin: 0; font-size: 1.4rem; }

a { color: #2563eb; }

/* --------------------------------------------------------------- Boutons */
button {
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    cursor: pointer;
    font: inherit;
    transition: background 0.15s ease;
}

button:hover { background: #1d4ed8; }

.btn-secondary { background: #64748b; }
.btn-secondary:hover { background: #475569; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-small { padding: 6px 10px; font-size: 13px; }

/* -------------------------------------------------------------- Calendrier */
.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.day-name {
    font-weight: bold;
    text-align: center;
    padding: 10px;
}

.day {
    background: white;
    border-radius: 10px;
    min-height: 90px;
    padding: 8px;
    cursor: pointer;
    position: relative;
    border: 1px solid #ddd;
    overflow: hidden;
}

.day.other { opacity: 0.4; }

.day-number { font-weight: bold; }

.father { background: #ffffff; }
.mother { background: #cfffcc; }
.none { background: #e5e7eb; }

.badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #333;
    color: #fff;
}

.has-exception::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: rgba(180, 83, 9, 0.45);
}

.exception-mark {
    display: inline-block;
    width: 4px;
    height: 14px;
    border-radius: 2px;
    background: rgba(180, 83, 9, 0.45);
}

.events {
    position: absolute;
    bottom: 7px;
    left: 12px;
    display: flex;
    gap: 3px;
}

.event-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.25);
    display: inline-block;
}

.today {
    border: 3px solid #22c55e !important;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
}

.today .day-number {
    color: #15803d;
    font-weight: bold;
}

.today::after {
    content: "●";
    position: absolute;
    top: 5px;
    right: 5px;
    color: #22c55e;
    font-size: 12px;
}

/* ------------------------------------------------------- Légende / pastilles */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0;
    font-size: 13px;
}

.legend span { display: inline-flex; align-items: center; gap: 6px; }

.swatch {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid #bbb;
    display: inline-block;
}

/* --------------------------------------------------------------- Modales */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal.open { display: flex; }

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    width: min(500px, 90vw);
}

.modal-content.wide {
    width: min(820px, 95vw);
    max-height: 90vh;
    overflow: auto;
}

.modal-content h2 { margin-top: 0; }

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ------------------------------------------------------------- Paramètres */
.settings section { margin-bottom: 20px; }

.settings h3 {
    margin: 0 0 8px;
    font-size: 15px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 4px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}

.field input,
.field select {
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font: inherit;
}

.hint {
    font-size: 12px;
    color: #64748b;
    margin: 6px 0 0;
}

.rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) auto;
    gap: 8px;
    align-items: end;
    background: #f8fafc;
    padding: 10px;
    border-radius: 8px;
}

.error {
    color: #dc2626;
    font-size: 13px;
    margin: 0 0 10px;
}

/* =====================================================================
   Authentification (Fortify)
   ===================================================================== */
.auth-body {
    background: #f4f6f9;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    width: min(420px, 100%);
    padding: 28px;
}

.auth-title {
    margin: 0 0 6px;
    font-size: 1.25rem;
    color: #0f172a;
    text-align: center;
}

.auth-subtitle {
    margin: 0 0 20px;
    font-size: 13px;
    color: #64748b;
    text-align: center;
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
}

.auth-form input {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font: inherit;
}

.auth-form input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-form .auth-error {
    color: #dc2626;
    font-size: 13px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 8px 10px;
    margin: 0;
}

.auth-button {
    width: 100%;
    padding: 11px 14px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
}

.auth-button:hover { background: #1d4ed8; }

.auth-links {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
    font-size: 13px;
}

.auth-links a { color: #2563eb; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

.auth-hint {
    margin-top: 16px;
    font-size: 12px;
    color: #64748b;
    text-align: center;
}

/* ------------------------------------------------------------- Responsive */
@media (max-width: 700px) {
    .day { min-height: 70px; }
    .header { flex-wrap: wrap; gap: 10px; }
}