/* ============================================================
   main.css — Charte graphique Haropa Port
   ============================================================ */

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

:root {
    --bg:         #232347;
    --accent:     #58c5f1;
    --pink:       #e7328a;
    --white:      #ffffff;
    --input-text: #324097;
    --radius:     0px;
    --shadow:     0 4px 24px rgba(0,0,0,.25);
}

/* Police Lequire — à placer dans assets/fonts/Lequire.woff2 */
@font-face {
    font-family: 'Lequire';
    src: url('/assets/fonts/Lequire.woff2') format('woff2'),
         url('/assets/fonts/Lequire.woff')  format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--white);
}

/* ============================================================
   PAGE ACCUEIL / IDENTIFICATION
   ============================================================ */
.page-accueil {
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 20px;
}

.container { width: 100%; max-width: 440px; }

.card {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 0px;
    box-shadow: var(--shadow);
    padding: 36px 28px;
}

.logo-haropa { text-align: center; margin-bottom: 20px; }

.page-title {
    font-family: 'Lequire', -apple-system, sans-serif;
    font-weight: 900;
    font-size: 2rem;
    color: var(--white);
    text-align: center;
    margin-bottom: 6px;
    line-height: 1.1;
}

h1 {
    font-family: 'Lequire', -apple-system, sans-serif;
    font-weight: 900;
    font-size: 1.7rem;
    color: var(--white);
    text-align: center;
    margin-bottom: 8px;
}

h2 {
    font-family: 'Lequire', -apple-system, sans-serif;
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--white);
    margin-bottom: 12px;
}

.subtitle {
    text-align: center;
    color: var(--accent);
    font-size: .9rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Champs */
.field { margin-bottom: 14px; }

.field label {
    display: block; font-size: .82rem; font-weight: 600;
    color: var(--accent); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: .04em;
}

.field input {
    width: 100%;
    height: 45px;
    padding: 0 14px;
    background: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: .95rem;
    color: var(--input-text);
    outline: none;
    display: inline-block;
    vertical-align: middle;
    transition: box-shadow .15s;
}
.field input:focus { box-shadow: 0 0 0 3px rgba(88,197,241,.4); }

.required { color: var(--pink); }
.optional { font-weight: 400; color: rgba(255,255,255,.45); font-size: .78rem; }

/* RGPD */
.field-rgpd { margin-bottom: 20px; }

.checkbox-label {
    display: flex; gap: 10px; cursor: pointer;
    font-size: .82rem; color: rgba(255,255,255,.6); line-height: 1.5;
}
.checkbox-label input[type="checkbox"] {
    width: 18px; height: 18px; flex-shrink: 0;
    accent-color: var(--accent); margin-top: 2px; cursor: pointer;
}
.checkbox-label a { color: var(--accent); }

.rgpd-detail {
    background: rgba(88,197,241,.1);
    border-left: 3px solid var(--accent);
    border-radius: 0px; padding: 12px 14px;
    font-size: .78rem; color: rgba(255,255,255,.7);
    margin: 8px 0 16px; line-height: 1.6;
}

/* Boutons */
.btn-primary {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 100%;
    height: 45px; padding: 0 20px;
    background: var(--accent); color: #fff;
    border: none; border-radius: var(--radius);
    font-size: 1rem; font-weight: 700; cursor: pointer;
    transition: opacity .15s; margin-top: 10px;
}
.btn-primary:hover    { opacity: .88; }
.btn-primary:disabled { background: rgba(255,255,255,.15); color: rgba(255,255,255,.35); cursor: not-allowed; }

.btn-secondary {
    display: inline-flex; align-items: center; justify-content: center;
    height: 45px; padding: 0 18px;
    background: transparent; color: var(--accent);
    border: 1.5px solid var(--accent); border-radius: var(--radius);
    font-size: .9rem; font-weight: 600; cursor: pointer;
    transition: background .15s;
}
.btn-secondary:hover { background: rgba(88,197,241,.12); }

.btn-danger {
    display: inline-flex; align-items: center; justify-content: center;
    height: 45px; padding: 0 18px;
    background: transparent; color: var(--pink);
    border: 1.5px solid var(--pink); border-radius: var(--radius);
    font-size: .9rem; font-weight: 600; cursor: pointer;
}

.message-erreur {
    background: rgba(231,50,138,.15);
    border: 1px solid rgba(231,50,138,.35);
    color: #f9a8d4;
    border-radius: 0px; padding: 12px 14px;
    font-size: .88rem; margin-top: 12px;
}

.hint { font-size: .78rem; color: rgba(255,255,255,.45); margin-top: 4px; }
.text-center { text-align: center; }
.text-accent  { color: var(--accent); }
.text-pink    { color: var(--pink); }

/* ============================================================
   PAGE DESSIN
   ============================================================ */
.page-dessin {
    background: var(--bg);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}
.page-dessin.recap {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
}

#app-dessin {
    display: grid;
    grid-template-rows: auto 3px 1fr auto;
    /* toolbar | timer-bar | canvas-wrapper | footer-valider */
    height: 100vh;
    height: 100dvh;
}

/* Toolbar */
#toolbar {
    background: #1a1a3a;
    padding: 4px 8px;
    display: flex; align-items: center; gap: 5px;
    flex-wrap: nowrap; overflow-x: auto; flex-shrink: 0;
    border-bottom: 1px solid rgba(88,197,241,.2);
}

.toolbar-left { display: flex; flex-direction: column; flex-shrink: 0; }
.toolbar-nom  { color: var(--white); font-size: .78rem; font-weight: 700; }
.toolbar-step { font-size: .62rem; color: var(--accent); }

.toolbar-tools, .toolbar-options {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}

.tool-btn {
    background: rgba(255,255,255,.08);
    border: 2px solid transparent;
    border-radius: 0px; color: #fff;
    font-size: .9rem; width: 32px; height: 32px; flex-shrink: 0;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .1s, border-color .1s;
}
.tool-btn:hover  { background: rgba(255,255,255,.15); }
.tool-btn.active { border-color: var(--accent); background: rgba(88,197,241,.2); }

#epaisseur { width: 60px; accent-color: var(--accent); flex-shrink: 0; }

/* Dots progression — ultra compact */
#progress-dots {
    display: flex; justify-content: center; align-items: center; gap: 5px;
    padding: 3px 8px; background: #1a1a3a; flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.dot {
    width: 18px; height: 18px; border-radius: 0%;
    display: flex; align-items: center; justify-content: center;
    font-size: .62rem; font-weight: 700;
    background: rgba(255,255,255,.1); color: rgba(255,255,255,.4);
}
.dot.active { background: var(--pink); color: #fff; }
.dot.done   { background: var(--accent); color: #fff; }

/* Canvas wrapper */
#canvas-wrapper {
    overflow: hidden; min-height: 0;
    display: flex; align-items: center; justify-content: center;
    background: #111;
}

#drawing-canvas {
    background: transparent;
    touch-action: none; cursor: crosshair;
    box-shadow: 0 0 0 3px rgba(88,197,241,.3);
    max-width: 100%; max-height: 100%; display: block;
}

/* Text overlay */
#text-input-overlay {
    position: fixed; z-index: 100; background: #fff;
    border-radius: 0px; box-shadow: var(--shadow);
    padding: 10px; gap: 6px; display: none; align-items: center;
}
#text-input {
    height: 45px; padding: 0 10px;
    border: 1.5px solid #e2e8f0; border-radius: 0px;
    font-size: .95rem; color: var(--input-text);
    width: 160px; outline: none; background: #fff;
}
#text-confirm {
    background: var(--accent); color: #fff;
    border: none; border-radius: 0px;
    height: 45px; padding: 0 14px; cursor: pointer; font-weight: 600;
}
#text-cancel { background: none; border: none; color: #999; cursor: pointer; }

/* Footer valider — compact */
#footer-valider {
    background: #1a1a3a;
    padding: 7px 12px;
    padding-bottom: max(7px, env(safe-area-inset-bottom));
    text-align: center;
    border-top: 1px solid rgba(88,197,241,.2);
    flex-shrink: 0;
}
#footer-valider .hint {
    color: rgba(255,255,255,.45); margin-bottom: 6px; font-size: .75rem;
}
#footer-valider .hint strong { color: var(--pink); }
#btn-valider { max-width: 360px; margin: 0 auto; height: 40px; font-size: .9rem; }

/* Modal */
#modal-confirm {
    position: fixed; inset: 0; background: rgba(0,0,0,.75);
    display: flex; align-items: center; justify-content: center;
    z-index: 200; padding: 16px;
}
.modal-box {
    background: #2d2d5a; border: 1px solid rgba(88,197,241,.2);
    border-radius: 0px; padding: 28px 24px;
    max-width: 360px; width: 100%; text-align: center;
}
.modal-box h3 {
    font-family: 'Lequire', sans-serif; font-weight: 900;
    font-size: 1.3rem; color: var(--white); margin-bottom: 10px;
}
.modal-box p  { color: rgba(255,255,255,.6); margin-bottom: 20px; font-size: .9rem; }
.modal-box p strong { color: var(--pink); }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions .btn-primary,
.modal-actions .btn-secondary { flex: 1; max-width: 160px; margin-top: 0; }

/* Recap */
#recap-wrapper { overflow-x: auto; text-align: center; margin: 0 auto; }
#recap-canvas  { border-radius: 0px; max-width: 100%; }