/* ==========================================================================
   Site public — « Contact », planche « Site · Contact »
   Chargee uniquement par templates/company/contact.html.twig.
   Ecrite contre public/css/tokens.css : aucune couleur brute, aucune police
   supplementaire. L'accent est celui du chassis, pas une couleur de module.
   ========================================================================== */

.ct {
    /* Cette page portait --accent sur --mod-documents, « parce que c'est une
       page de marque ». Mais #5B4FCF n'est pas une couleur de marque : c'est
       la teinte du module Documents. La porter ici, c'est dire « Documents »
       sur une page qui parle de tout sauf de ca, et c'est annuler la regle
       du chassis — tokens.css pose body[data-module="none"] { --accent:
       var(--ink) }, que /login, /register et l'accueil respectent.
       On laisse donc le chassis decider, et --brand suit l'accent. */
    --brand:     var(--accent);
    --brand-ink: var(--accent-ink);

    --ct-max:    1200px;

    max-width: var(--ct-max);
    margin: 0 auto;
    padding: var(--space-10) var(--gutter-page) var(--gutter-section);
    font-family: var(--font-ui);
    font-size: var(--text-body);
    line-height: var(--lh-normal);
    color: var(--ink);
}

.ct *,
.ct *::before,
.ct *::after { box-sizing: border-box; }

.ct :where(h1, h2, p) {
    margin: 0;
    padding: 0;
    color: inherit;
}

/* Le chassis ajoute un « © Stackly » minuscule sous la page aux visiteurs non
   connectes, en doublon du pied de page public. */
html body > footer:not(.home-footer) { display: none; }

/* ---------- Entete ---------------------------------------------------------- */

.ct-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.ct-overline {
    font-size: var(--text-label);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--track-label);
    text-transform: uppercase;
    color: var(--ink-faint);
}

.ct-h1 {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: var(--weight-bold);
    line-height: var(--lh-snug);
    letter-spacing: var(--track-display);
    margin-top: var(--space-2);
}

.ct-lead {
    font-size: var(--text-body-lg);
    line-height: var(--lh-normal);
    color: var(--ink-secondary);
    margin-top: var(--space-3);
}

.ct-h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: var(--weight-bold);
    line-height: var(--lh-snug);
    letter-spacing: var(--track-title);
}

.ct-num { font-variant-numeric: tabular-nums; }

/* ---------- Deux colonnes ---------------------------------------------------- */

.ct-layout {
    display: grid;
    grid-template-columns: 400px minmax(0, 1fr);
    gap: var(--space-6);
    margin-top: var(--space-8);
    align-items: start;
}

.ct-aside {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* ---------- Reperes ---------------------------------------------------------- */

.ct-mark {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    padding: 26px 28px;
    border-radius: var(--radius-card-lg);
}

.ct-mark--client {
    background: var(--accent-tint-2);
    /* La bordure se deduit de la teinte, elle n'est pas recopiee. */
    border-color: var(--accent-tint);
    border-color: color-mix(in srgb, var(--brand) 22%, var(--surface));
}

.ct-mark-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-button);
    background: var(--surface-sunken);
    color: var(--ink-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex: 0 0 auto;
}

.ct-mark-icon--brand {
    background: var(--accent-tint);
    color: var(--brand);
}

.ct-mark-icon--solid {
    background: var(--brand);
    color: var(--surface);
}

.ct-mark-title {
    font-size: var(--text-body);
    font-weight: var(--weight-semibold);
}

.ct-mark-text {
    font-size: 13.5px;
    line-height: var(--lh-normal);
    color: var(--ink-secondary);
    margin-top: 5px;
}

/* ---------- Boutons ----------------------------------------------------------
   Vocabulaire local : le site public n'utilise pas .ui-btn, et .btn herite de
   l'ancienne charte. Quatre variantes, pas une de plus.
   ---------------------------------------------------------------------------- */

.ct-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: var(--control-md);
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: var(--radius-button);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 13.5px;
    font-weight: var(--weight-semibold);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--duration) var(--ease),
                border-color var(--duration) var(--ease),
                filter var(--duration) var(--ease);
}

.ct-btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.ct-btn i { font-size: 14px; }

.ct-btn--brand-outline {
    margin-top: 13px;
    border-color: var(--brand);
    color: var(--brand-ink);
}

.ct-btn--brand-outline:hover {
    background: var(--accent-tint);
    color: var(--brand-ink);
}

.ct-btn--brand {
    height: var(--control-lg);
    padding: 0 28px;
    background: var(--brand);
    color: var(--surface);
    font-size: 14.5px;
}

.ct-btn--brand:hover {
    filter: brightness(0.93);
    color: var(--surface);
}

.ct-btn--plain {
    border-color: var(--border-strong);
    color: var(--ink);
    font-weight: var(--weight-medium);
}

.ct-btn--plain:hover {
    background: var(--surface-sunken);
    color: var(--ink);
}

.ct-btn--ink {
    background: var(--ink);
    color: var(--ink-on-dark);
    font-weight: var(--weight-medium);
}

.ct-btn--ink:hover {
    filter: brightness(1.3);
    color: var(--ink-on-dark);
}

.ct-btn--ko {
    border-color: var(--danger);
    color: var(--danger);
}

.ct-btn--ko:hover {
    background: var(--danger-tint);
    color: var(--danger);
}

/* ---------- Le formulaire ------------------------------------------------------ */

.ct-form-card {
    padding: 34px 38px;
    border-radius: var(--radius-card-lg);
}

.ct-form-note {
    font-size: 13.5px;
    color: var(--ink-muted);
    margin-top: 7px;
}

.ct-form { margin-top: 26px; }

.ct-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ct-form > .ct-field + .ct-field,
.ct-form > .ct-row + .ct-field,
.ct-form > .ct-row + .ui-field { margin-top: 18px; }

.ct-textarea { min-height: 150px; }

/* Le chassis declare .ui-field-hint en ligne : sans display bloc, sa marge
   haute ne s'applique pas. */
.ct-form .ui-field-hint { display: block; }

/* ---------- Raccourcis de sujet -------------------------------------------------
   Livres masques par le gabarit, reveles par company-contact.js. `hidden`
   seul ne suffirait pas : display:flex l'emporterait sur la regle par defaut
   du navigateur.
   ------------------------------------------------------------------------------- */

.ct-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 11px;
}

.ct-chips[hidden] { display: none; }

.ct-chip {
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    padding: 5px 11px;
    background: var(--surface-sunken);
    color: var(--ink-secondary);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: var(--weight-regular);
    line-height: var(--lh-snug);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease),
                color var(--duration-fast) var(--ease);
}

.ct-chip:hover { background: var(--border); }

.ct-chip.is-active {
    background: var(--accent-tint);
    color: var(--brand-ink);
    font-weight: var(--weight-medium);
}

.ct-chip:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.ct-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--border-subtle);
}

.ct-form-privacy {
    font-size: 12.5px;
    line-height: var(--lh-snug);
    color: var(--ink-muted);
    max-width: 380px;
}

/* ---------- Les deux etats d'apres envoi ----------------------------------------
   Dessines sur la planche, donc rendus vraiment : succes a la place du
   formulaire, echec au-dessus d'un formulaire toujours rempli.
   ------------------------------------------------------------------------------- */

.ct-state {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    padding: 28px 32px;
    border-radius: var(--radius-card-lg);
}

.ct-state--ok {
    background: var(--success-tint);
    border-color: var(--success-tint);
    border-color: color-mix(in srgb, var(--success) 32%, var(--surface));
}

.ct-state--ko {
    background: var(--danger-tint);
    border-color: var(--danger-tint);
    border-color: color-mix(in srgb, var(--danger) 30%, var(--surface));
    margin-bottom: var(--space-4);
}

.ct-state-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: var(--surface);
    flex: 0 0 auto;
}

.ct-state-icon--ok { background: var(--success); }
.ct-state-icon--ko { background: var(--danger); }

.ct-state-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: var(--weight-bold);
    letter-spacing: var(--track-title);
    line-height: var(--lh-snug);
}

.ct-state-text {
    font-size: 13.5px;
    line-height: var(--lh-normal);
    color: var(--ink-secondary);
    margin-top: 6px;
    /* La carte occupe toute la colonne : sans borne, la phrase tiendrait sur
       une seule ligne de 90 caracteres. */
    max-width: 62ch;
}

.ct-state-text a { color: var(--brand-ink); }

.ct-state-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 14px;
}

.ct-state-actions .ct-btn { height: 36px; }

/* ---------- Adaptations ----------------------------------------------------------
   Jusqu'a 390 px sans debordement lateral.
   -------------------------------------------------------------------------------- */

@media (max-width: 980px) {
    .ct-layout { grid-template-columns: minmax(0, 1fr); }

    /* Le formulaire passe devant les reperes : c'est lui qu'on vient chercher. */
    .ct-panel { order: -1; }
}

@media (max-width: 768px) {
    .ct { padding: var(--space-6) var(--gutter-page) var(--gutter-section); }

    .ct-h1 { font-size: 30px; }
    .ct-lead { font-size: var(--text-body); }

    .ct-form-card { padding: var(--space-5); }
    .ct-mark { padding: var(--space-5); }
    .ct-state { padding: var(--space-5); }

    .ct-row { grid-template-columns: minmax(0, 1fr); }

    .ct-form-foot {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-4);
    }

    .ct-btn { height: var(--touch-target); }
    .ct-state-actions .ct-btn { height: 40px; }
    .ct-chip { padding: 7px 12px; }
}
