/* =========================================================
   LUNE — Audit pédagogique
   Reprend la palette du chat (sombre + lunaire + violet)
   ========================================================= */

:root {
    /* Fonds */
    --bg-deep: #0b0b10;
    --bg-surface: #14141c;
    --bg-elevated: #1c1c26;
    --bg-input: #1a1a24;

    /* Bordures */
    --border-subtle: #24242f;
    --border-strong: #2e2e3b;

    /* Texte — palette lunaire */
    --text-primary: #e6dccb;
    --text-secondary: #a89f8d;
    --text-muted: #6b6557;

    /* Accent violet */
    --accent: #c084fc;
    --accent-hover: #d8a4ff;
    --accent-soft: rgba(192, 132, 252, 0.15);
    --accent-strong: #a855f7;

    /* États */
    --danger: #f87171;
    --success: #4ade80;
    --warning: #fbbf24;

    /* Forme */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.45);

    /* Typo */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
}

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

html, body {
    min-height: 100%;
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    /* Léger halo lunaire en arrière-plan */
    background-image:
        radial-gradient(circle at 20% 0%, rgba(192, 132, 252, 0.08), transparent 50%),
        radial-gradient(circle at 80% 100%, rgba(168, 85, 247, 0.06), transparent 50%);
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; outline: none; }

/* =========================================================
   LAYOUT
   ========================================================= */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 48px 24px 32px;
}

.header {
    text-align: center;
    margin-bottom: 32px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 12px;
}
.brand-icon {
    font-size: 26px;
    color: var(--accent);
    text-shadow: 0 0 18px var(--accent-soft);
}
.subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    max-width: 460px;
    margin: 0 auto;
}

/* =========================================================
   FORMULAIRE
   ========================================================= */
.form {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: var(--shadow-soft);
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Erreur qui occupe les 2 colonnes de la row */
.row-error {
    grid-column: 1 / -1;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label,
.field legend {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.field input[type="text"],
.field input[type="email"] {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 11px 14px;
    font-size: 14.5px;
    transition: border-color 0.15s ease;
}
.field input[type="text"]:focus,
.field input[type="email"]:focus {
    border-color: var(--accent);
}
.field input::placeholder { color: var(--text-muted); }

.error-msg {
    display: none;
    color: var(--danger);
    font-size: 12.5px;
    margin-top: 2px;
}

.form-note {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-input);
    border-left: 3px solid var(--accent);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    line-height: 1.45;
}

/* =========================================================
   TYPE DE DOCUMENT — radio cards
   ========================================================= */
.doc-types {
    border: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.doc-types legend { margin-bottom: 4px; }

.doc-type {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.doc-type:hover { border-color: var(--border-strong); }

.doc-type input[type="radio"] {
    margin-top: 3px;
    accent-color: var(--accent); /* couleur du radio natif */
    cursor: pointer;
    flex-shrink: 0;
}

/* Card sélectionnée → bordure et fond violet (selecteur :has, supporté partout en 2026) */
.doc-type:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.doc-type-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--text-primary);
}
.doc-type-title {
    font-weight: 500;
    font-size: 14.5px;
}
.doc-type-title .ext {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    font-weight: normal;
    margin-left: 6px;
    letter-spacing: 0.05em;
}
.doc-type-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* =========================================================
   ZONE D'UPLOAD
   ========================================================= */
.file-label { display: block; cursor: pointer; }

/* L'input file natif est masqué visuellement mais reste accessible */
.file-label input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.file-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 16px;
    background: var(--bg-input);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-md);
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.file-zone:hover,
.file-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.file-zone.has-file {
    border-color: var(--accent);
    border-style: solid;
    background: var(--accent-soft);
}

.file-icon { font-size: 28px; }
.file-text {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
    max-width: 100%;
}
.file-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* =========================================================
   BOUTON SUBMIT
   ========================================================= */
.btn-submit {
    margin-top: 4px;
    background: var(--accent);
    color: var(--bg-deep);
    padding: 13px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    transition: all 0.15s ease;
}
.btn-submit:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 0 24px var(--accent-soft);
}
.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =========================================================
   DISCLAIMER IA
   ========================================================= */
.disclaimer {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 20px;
    padding: 14px 18px;
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.disclaimer-icon {
    color: var(--warning);
    font-size: 18px;
    line-height: 1.2;
    flex-shrink: 0;
    margin-top: 1px;
}
.disclaimer strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.05em;
}

/* =========================================================
   MODALE
   ========================================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    animation: fadeIn 0.15s ease;
}
.modal-overlay.visible { display: flex; }

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

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px 28px 24px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-soft);
    animation: slideUp 0.2s ease;
}

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

.modal-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: bold;
    line-height: 1;
}
.modal-icon.success {
    background: rgba(74, 222, 128, 0.12);
    color: var(--success);
    border: 2px solid var(--success);
}
.modal-icon.warning {
    background: rgba(251, 191, 36, 0.12);
    color: var(--warning);
    border: 2px solid var(--warning);
}
.modal-icon.error {
    background: rgba(248, 113, 113, 0.12);
    color: var(--danger);
    border: 2px solid var(--danger);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-message {
    color: var(--text-secondary);
    font-size: 14.5px;
    margin-bottom: 22px;
    line-height: 1.5;
}

.modal-close {
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    border: 1px solid var(--border-strong);
    transition: all 0.15s ease;
}
.modal-close:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

/* =========================================================
   SCROLLBAR
   ========================================================= */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 600px) {
    .row { grid-template-columns: 1fr; }
    .container { padding: 28px 16px; }
    .form { padding: 22px 18px; }
    .brand { font-size: 19px; }
    .brand-icon { font-size: 22px; }
}
