/* ============================================
   Générateur de Contrats BMAD — Stylesheet
   ============================================ */

:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --accent: #3182ce;
    --accent-hover: #2b6cb0;
    --bg: #f7fafc;
    --card-bg: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
    --success: #38a169;
    --error: #e53e3e;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
    --radius: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── HEADER ── */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 2rem 2rem 1.8rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.3);
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: -0.02em;
}

.header p {
    font-size: 0.95rem;
    opacity: 0.8;
    font-weight: 400;
}

/* ── CONTAINER ── */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* ── SECTIONS ── */
.section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.8rem 2rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s ease;
}

.section:hover {
    box-shadow: var(--shadow-lg);
}

.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title .icon {
    font-size: 1rem;
}

/* ── FORM GRID ── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.5rem;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
    letter-spacing: 0.01em;
}

.form-group label .optional {
    font-weight: 400;
    color: var(--text-light);
    font-size: 0.75rem;
}

.form-group input,
.form-group select {
    padding: 0.6rem 0.8rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.form-group input:disabled,
.form-group select:disabled {
    background: #f1f5f9;
    color: #a0aec0;
    cursor: not-allowed;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.2rem;
}

/* ── TYPE CONTRAT RADIO BUTTONS ── */
.radio-group {
    display: flex;
    gap: 0.5rem;
}

.radio-option {
    flex: 1;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-option label {
    display: block;
    text-align: center;
    padding: 0.55rem 1rem;
    border: 2px solid var(--border);
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    color: var(--text-light);
    background: white;
    margin-bottom: 0;
}

.radio-option input[type="radio"]:checked + label {
    border-color: var(--accent);
    background: rgba(49, 130, 206, 0.08);
    color: var(--accent);
}

.radio-option label:hover {
    border-color: var(--accent);
}

/* ── DURÉE RAPIDE ── */
.duree-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
}

.duree-btn {
    padding: 0.45rem 0.3rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.15s ease;
    text-align: center;
    font-family: inherit;
}

.duree-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.duree-btn.active {
    border-color: var(--accent);
    background: rgba(49, 130, 206, 0.08);
    color: var(--accent);
    font-weight: 600;
}

/* ── BOUTON GÉNÉRER ── */
.generate-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
    letter-spacing: 0.01em;
    margin-top: 0.5rem;
}

.generate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(49, 130, 206, 0.4);
}

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

/* ── LOGIN ── */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.login-card {
    background: white;
    border-radius: 14px;
    padding: 2.5rem 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.login-card h1 {
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.login-card .subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.8rem;
}

.login-card input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: 0.15em;
}

.login-card input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.login-card button {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease;
}

.login-card button:hover {
    background: var(--accent-hover);
}

.login-error {
    color: var(--error);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* ── CHECKBOXES ── */
.checkbox-group {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.3rem;
}

.checkbox-option {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.15s ease;
    background: white;
    margin-bottom: 0;
    white-space: nowrap;
}

.checkbox-option:has(input:checked) {
    border-color: var(--accent);
    background: rgba(49, 130, 206, 0.08);
    color: var(--accent);
}

.checkbox-option:hover {
    border-color: var(--accent);
}

.checkbox-option input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--accent);
}

/* ── LOGOUT ── */
.logout-btn {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.85rem;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.logout-btn:hover {
    color: white;
    border-color: white;
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .header {
        padding: 1.5rem 1.2rem;
    }

    .container {
        padding: 0 1rem 2rem;
    }

    .section {
        padding: 1.2rem 1.2rem;
    }

    .duree-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
