/*
 * cockpit-vite-fait.css — styling for the rep "Action rapide" overlay.
 *
 * Plain language: floating bottom-right button + modal with three
 * fast-paths (Appel / Stade / Devis). Big French buttons, generous
 * spacing, large hit targets so a rep on the road clicks once and
 * lands.
 *
 * Phase 4 / Agent 4A. Lead sheet §13.
 */

/* ============================================================
 * Floating action button
 * ============================================================ */

.cockpit-vite-fait__fab-wrap {
    position: fixed;
    bottom: 88px;     /* sits above the support FAB at 24px and the
                         QC FAB at 24px without overlapping */
    right: 24px;
    z-index: 8500;
}

.cockpit-vite-fait__fab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border-radius: 999px;
    border: 0;
    background: var(--accent, #2563eb);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.32);
    transition: background 0.16s ease, transform 0.08s ease,
                box-shadow 0.16s ease;
    font-family: inherit;
}

.cockpit-vite-fait__fab:hover {
    background: var(--accent-strong, #1d4fc4);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.42);
}

.cockpit-vite-fait__fab:active {
    transform: translateY(1px);
}

.cockpit-vite-fait__fab-plus {
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    margin-bottom: 2px;
}

.cockpit-vite-fait__fab-label {
    /* Plain language: keep the label readable on mobile too. We
       don't hide it on small screens — the rep needs to know what
       the button does at first glance. */
    font-size: 14px;
    letter-spacing: 0.01em;
}

@media (max-width: 540px) {
    .cockpit-vite-fait__fab {
        padding: 10px 16px;
        font-size: 14px;
    }
    .cockpit-vite-fait__fab-plus { font-size: 20px; }
}

/* ============================================================
 * Modal overlay
 * ============================================================ */

.cockpit-vite-fait__modal-root:empty {
    display: none;
}

.cockpit-vite-fait__overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 18, 0.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cockpit-vite-fait-fade-in 0.16s ease;
}

@keyframes cockpit-vite-fait-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.cockpit-vite-fait__modal {
    background: var(--surface, #fff);
    color: var(--ink, #1a1a18);
    border-radius: 14px;
    padding: 24px;
    width: min(100%, 480px);
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
    animation: cockpit-vite-fait-pop-in 0.2s ease;
    font-family: inherit;
}

@keyframes cockpit-vite-fait-pop-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.cockpit-vite-fait__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--ink-soft, #6c6c66);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.14s ease;
}

.cockpit-vite-fait__close:hover {
    background: var(--rule, #f0f0eb);
    color: var(--ink, #1a1a18);
}

/* ============================================================
 * Header
 * ============================================================ */

.cockpit-vite-fait__header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 32px 18px 0;
}

.cockpit-vite-fait__title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.cockpit-vite-fait__subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--ink-soft, #4a4a45);
}

.cockpit-vite-fait__back {
    align-self: flex-start;
    background: transparent;
    border: 0;
    color: var(--ink-soft, #6c6c66);
    cursor: pointer;
    padding: 4px 0;
    font-size: 13px;
    margin-bottom: 4px;
}

.cockpit-vite-fait__back:hover {
    color: var(--ink, #1a1a18);
}

/* ============================================================
 * Menu cards (3-card chooser)
 * ============================================================ */

.cockpit-vite-fait__cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.cockpit-vite-fait__card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 14px;
    row-gap: 4px;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid var(--rule, #e8e8e2);
    background: var(--surface, #fff);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.14s ease, transform 0.06s ease;
    font-family: inherit;
    color: var(--ink, #1a1a18);
}

.cockpit-vite-fait__card:hover {
    border-color: var(--ink-soft, #6c6c66);
    transform: translateY(-1px);
}

.cockpit-vite-fait__card-icon {
    grid-row: 1 / span 2;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-soft, rgba(37, 99, 235, 0.12));
    color: var(--accent, #2563eb);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
}

.cockpit-vite-fait__card-title {
    font-size: 16px;
    font-weight: 600;
    align-self: end;
}

.cockpit-vite-fait__card-hint {
    font-size: 13px;
    color: var(--ink-soft, #4a4a45);
}

/* ============================================================
 * Form (shared across Appel / Stage / Devis)
 * ============================================================ */

.cockpit-vite-fait__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cockpit-vite-fait__label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink, #1a1a18);
}

.cockpit-vite-fait__input,
.cockpit-vite-fait__select,
.cockpit-vite-fait__textarea {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--rule-strong, #d8d8d2);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--ink, #1a1a18);
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.cockpit-vite-fait__input:focus,
.cockpit-vite-fait__select:focus,
.cockpit-vite-fait__textarea:focus {
    outline: 0;
    border-color: var(--accent, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cockpit-vite-fait__textarea {
    resize: vertical;
    min-height: 64px;
}

/* Contact suggestion chip row */
.cockpit-vite-fait__chip-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.cockpit-vite-fait__chip {
    padding: 5px 10px;
    background: var(--rule, #f0f0eb);
    border: 1px solid var(--rule-strong, #d8d8d2);
    border-radius: 999px;
    font-size: 12px;
    color: var(--ink, #1a1a18);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.14s ease;
}

.cockpit-vite-fait__chip:hover {
    background: var(--accent-soft, #e0e8fa);
}

/* Submit button — always large, accent-coloured */
.cockpit-vite-fait__submit {
    margin-top: 8px;
    padding: 12px 18px;
    background: var(--accent, #2563eb);
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.14s ease;
}

.cockpit-vite-fait__submit:hover {
    background: var(--accent-strong, #1d4fc4);
}

.cockpit-vite-fait__submit[disabled] {
    opacity: 0.6;
    cursor: progress;
}

/* Error message inline */
.cockpit-vite-fait__error {
    background: rgba(214, 58, 58, 0.08);
    color: #b53b3b;
    border: 1px solid rgba(214, 58, 58, 0.25);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}

/* ============================================================
 * Local fallback toast (when window.Toast is unavailable)
 * ============================================================ */

.cockpit-vite-fait__toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink, #1a1a18);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    z-index: 9100;
    animation: cockpit-vite-fait-toast-in 0.2s ease;
}

.cockpit-vite-fait__toast--success { background: #2c7a4a; }
.cockpit-vite-fait__toast--error { background: #b53b3b; }

.cockpit-vite-fait__toast.is-leaving {
    animation: cockpit-vite-fait-toast-out 0.35s ease forwards;
}

@keyframes cockpit-vite-fait-toast-in {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes cockpit-vite-fait-toast-out {
    to { opacity: 0; transform: translate(-50%, 8px); }
}
