/* ==========================================================
   AzotCar — Page d'accueil
   Styles propres à l'accueil (préfixe .hm-), chargés uniquement
   par home.blade.php. Les couleurs de marque viennent de app.css.
   ========================================================== */

.hm {
    --hm-ink: #0b1528;
    --hm-ink-soft: #16284a;
    --hm-blue: var(--color-primary, #267df0);
    --hm-blue-deep: #1a5ec6;
    --hm-sky: var(--color-primary-accent, #38bdf8);
    --hm-paper: #f3f5f9;
    --hm-line: #dde3ec;
    --hm-text: #334155;
    --hm-muted: #5b6b82;
    --hm-green: #0b7d48;
    --hm-green-bg: #e9f8f0;
    --hm-red: #c62828;
    --hm-display: 'Barlow Semi Condensed', 'Outfit', 'Segoe UI', system-ui, sans-serif;
    --hm-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --hm-wrap: 1160px;

    color: var(--hm-text);
}

.hm-wrap {
    max-width: var(--hm-wrap);
    margin: 0 auto;
    padding: 0 24px;
}

.hm h1,
.hm h2,
.hm h3 {
    font-family: var(--hm-display);
    color: var(--hm-ink);
    text-wrap: balance;
}

.hm a:focus-visible,
.hm button:focus-visible {
    outline: 2px solid var(--hm-sky);
    outline-offset: 3px;
}

/* ==============================================
   HERO
   ============================================== */
.hm-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1000px 560px at 50% -14%, #1a3462 0%, rgba(26, 52, 98, 0) 64%),
        var(--hm-ink);
    color: #cbd5e1;
}

/* Rosace guillochée, comme sur un document sécurisé */
.hm-guilloche {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1040px;
    height: 1040px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    color: var(--hm-sky);
    opacity: 0.13;
}

.hm-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding-top: 96px;
    padding-bottom: 96px;
}

.hm-kicker {
    font-family: var(--hm-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--hm-sky);
    margin-bottom: 22px;
}

.hm-title {
    font-size: clamp(40px, 5.4vw, 74px);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.012em;
    margin-bottom: 22px;
}

.hm .hm-title {
    color: #ffffff;
}

.hm-title span {
    color: var(--hm-sky);
}

.hm-lead {
    font-size: 17px;
    line-height: 1.65;
    max-width: 600px;
    margin: 0 auto 38px;
}

/* --- Barre de recherche par numéro de châssis --- */
.hm-search {
    max-width: 660px;
    margin: 0 auto;
    text-align: left;
}

.hm-search-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow:
        0 0 0 6px rgba(56, 189, 248, 0.09),
        0 30px 60px -24px rgba(0, 0, 0, 0.75);
    transition: box-shadow 0.2s ease;
}

.hm-search-bar:focus-within {
    box-shadow:
        0 0 0 4px rgba(56, 189, 248, 0.5),
        0 30px 60px -24px rgba(0, 0, 0, 0.75);
}

.hm-search-bar:has(input[aria-invalid="true"]) {
    box-shadow:
        0 0 0 4px rgba(255, 112, 112, 0.65),
        0 30px 60px -24px rgba(0, 0, 0, 0.75);
}

.hm-search-field {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px 6px 4px 14px;
    cursor: text;
}

.hm-search-label {
    margin-bottom: 3px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--hm-muted);
}

.hm-search-field input {
    width: 100%;
    padding: 0;
    font-family: var(--hm-mono);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hm-ink);
    background: transparent;
    border: none;
    outline: none;
}

.hm-search-field input::placeholder {
    font-weight: 500;
    color: #b4bdca;
}

.hm-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: stretch;
    flex-shrink: 0;
    min-height: 58px;
    padding: 0 22px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    color: #ffffff;
    background: var(--hm-blue-deep);
    border: none;
    border-radius: 9px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.hm-search-btn:hover:not(:disabled) {
    background: #174fa8;
}

.hm-search-btn svg {
    transition: transform 0.2s ease;
}

.hm-search-btn:hover:not(:disabled) svg {
    transform: translateX(3px);
}

.hm-search-btn:disabled {
    opacity: 0.85;
    cursor: progress;
}

.hm .hm-search-btn:focus-visible {
    outline: 2px solid var(--hm-ink);
    outline-offset: 2px;
}

/* Aide et erreur : absentes tant qu'elles ne sont pas utiles */
.hm-aide,
.hm-erreur {
    display: none;
    max-width: 660px;
    margin: 14px auto 0;
    font-size: 14px;
    line-height: 1.5;
}

.hm-aide.is-visible,
.hm-erreur.is-visible {
    display: block;
    animation: hm-fondu 0.25s ease;
}

.hm-aide {
    color: #9fb0c8;
}

.hm-erreur {
    font-weight: 600;
    color: #ffb3b3;
}

/* Une seule ligne sous la barre : l'erreur remplace l'aide */
.hm-aide:has(+ .hm-erreur.is-visible) {
    display: none;
}

@keyframes hm-fondu {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

/* Où trouver le numéro : toujours visible sous la plaque */
.hm-ou {
    max-width: 560px;
    margin: 18px auto 0;
    font-size: 14px;
    line-height: 1.6;
    color: #9fb0c8;
}

.hm-ou strong {
    margin-right: 4px;
    font-weight: 600;
    color: #e6edf7;
}

/* ==============================================
   SECTIONS — socle commun
   ============================================== */
.hm-section {
    padding: 96px 0;
    background: #ffffff;
}

.hm-section--paper {
    background: var(--hm-paper);
}

.hm-h2 {
    font-size: clamp(30px, 3.4vw, 42px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.005em;
}

.hm-text {
    font-size: 16.5px;
    line-height: 1.7;
    color: var(--hm-text);
}

/* ==============================================
   CONTRÔLES
   ============================================== */
.hm-controles {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 72px;
    align-items: start;
}

.hm-controles-intro .hm-h2 {
    margin-bottom: 18px;
}

.hm-liste {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 40px;
    border-top: 2px solid var(--hm-ink);
}

.hm-liste li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 19px 2px;
    font-size: 16.5px;
    font-weight: 500;
    color: var(--hm-ink);
    border-bottom: 1px solid var(--hm-line);
}

.hm-liste svg {
    flex-shrink: 0;
    color: var(--hm-green);
}

/* ==============================================
   DEUX USAGES
   ============================================== */
.hm-usages-tete {
    max-width: 720px;
    margin-bottom: 48px;
}

.hm-usages-tete .hm-h2 {
    margin-bottom: 18px;
}

.hm-usages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.hm-usage {
    display: flex;
    flex-direction: column;
    padding: 40px 40px 36px;
    border-radius: 12px;
    border: 1px solid var(--hm-line);
    background: #ffffff;
}

.hm-usage-role {
    font-family: var(--hm-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--hm-blue-deep);
    margin-bottom: 14px;
}

.hm-usage h3 {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.12;
    margin-bottom: 24px;
}

.hm-usage ol,
.hm-usage ul {
    list-style: none;
    margin-bottom: 34px;
}

.hm-usage li {
    position: relative;
    padding: 13px 0 13px 40px;
    font-size: 16px;
    line-height: 1.5;
    border-top: 1px solid var(--hm-line);
}

.hm-usage ol {
    counter-reset: etape;
}

.hm-usage ol li {
    counter-increment: etape;
}

.hm-usage ol li::before {
    content: counter(etape);
    position: absolute;
    left: 0;
    top: 12px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    font-family: var(--hm-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--hm-ink);
    border: 1.5px solid var(--hm-ink);
    border-radius: 50%;
}

.hm-usage ul li::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 23px;
    width: 9px;
    height: 2px;
    background: var(--hm-sky);
}

.hm-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    align-self: flex-start;
    margin-top: auto;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    background: var(--hm-ink);
    border-radius: 6px;
    transition: background-color 0.15s;
}

.hm-btn:hover {
    background: var(--hm-ink-soft);
}

.hm-btn svg {
    transition: transform 0.2s ease;
}

.hm-btn:hover svg {
    transform: translateX(4px);
}

/* Variante sombre : le propriétaire */
.hm-usage--sombre {
    background: var(--hm-ink);
    border-color: var(--hm-ink);
    color: #cbd5e1;
}

.hm-usage--sombre h3 {
    color: #ffffff;
}

.hm-usage--sombre .hm-usage-role {
    color: var(--hm-sky);
}

.hm-usage--sombre li {
    border-top-color: rgba(255, 255, 255, 0.13);
}

.hm-usage--sombre .hm-btn {
    color: var(--hm-ink);
    background: #ffffff;
}

.hm-usage--sombre .hm-btn:hover {
    background: #dbe7f7;
}

/* ==============================================
   ENGAGEMENTS
   ============================================== */
.hm-engagements .hm-h2 {
    margin-bottom: 44px;
}

.hm-piliers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 2px solid var(--hm-ink);
}

.hm-pilier {
    padding: 30px 36px 6px 0;
}

.hm-pilier + .hm-pilier {
    padding-left: 36px;
    border-left: 1px solid var(--hm-line);
}

.hm-pilier h3 {
    font-size: 25px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 10px;
}

.hm-pilier p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--hm-text);
}

/* ==============================================
   APPEL FINAL
   ============================================== */
.hm-final {
    background: var(--hm-blue-deep);
    padding: 68px 0;
}

.hm-final-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.hm .hm-final h2 {
    color: #ffffff;
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    line-height: 1.05;
}

.hm-final p {
    margin-top: 10px;
    font-size: 17px;
    color: #dbe7fb;
}

.hm-final .hm-btn {
    margin-top: 0;
    padding: 16px 26px;
    font-size: 16px;
    color: var(--hm-ink);
    background: #ffffff;
}

.hm-final .hm-btn:hover {
    background: #e6effc;
}

.hm .hm-final .hm-btn:focus-visible {
    outline-color: #ffffff;
}

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 980px) {
    .hm-hero-grid {
        padding-top: 64px;
        padding-bottom: 72px;
    }

    .hm-guilloche {
        width: 820px;
        height: 820px;
    }

    .hm-section {
        padding: 72px 0;
    }

    .hm-controles {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .hm-usages {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .hm-wrap {
        padding: 0 18px;
    }

    /* --- Hero --- */
    .hm-hero-grid {
        padding-top: 79px;
        padding-bottom: 77px;
    }

    .hm-kicker {
        font-size: 10.5px;
        letter-spacing: 0.12em;
        margin-bottom: 14px;
    }

    .hm-title {
        font-size: clamp(29px, 8.7vw, 36px);
        line-height: 1.06;
        margin-bottom: 14px;
    }

    .hm-lead {
        font-size: 15px;
        line-height: 1.6;
        margin-bottom: 24px;
    }

    .hm-search-label {
        font-size: 11.5px;
    }

    /* 16px minimum : en dessous, iOS zoome sur le champ au focus */
    .hm-search-field input {
        font-size: 16px;
        letter-spacing: 0.05em;
    }

    .hm-search-btn {
        min-height: 54px;
        padding: 0 18px;
        font-size: 14.5px;
    }

    .hm-aide,
    .hm-erreur,
    .hm-ou {
        font-size: 13.5px;
    }

    .hm-ou {
        margin-top: 14px;
    }

    /* --- Sections --- */
    .hm-section {
        padding: 48px 0;
    }

    .hm-h2 {
        font-size: 25px;
        line-height: 1.15;
    }

    .hm-text {
        font-size: 15px;
        line-height: 1.65;
    }

    .hm-controles {
        gap: 26px;
    }

    .hm-controles-intro .hm-h2,
    .hm-usages-tete .hm-h2 {
        margin-bottom: 12px;
    }

    .hm-liste {
        grid-template-columns: 1fr;
    }

    .hm-liste li {
        gap: 12px;
        padding: 13px 2px;
        font-size: 15px;
    }

    .hm-liste svg {
        width: 18px;
        height: 18px;
    }

    .hm-usages-tete {
        margin-bottom: 26px;
    }

    .hm-usages {
        gap: 16px;
    }

    .hm-usage {
        padding: 24px 20px 22px;
    }

    .hm-usage-role {
        font-size: 10.5px;
        margin-bottom: 10px;
    }

    .hm-usage h3 {
        font-size: 22px;
        margin-bottom: 18px;
    }

    .hm-usage ol,
    .hm-usage ul {
        margin-bottom: 24px;
    }

    .hm-usage li {
        padding: 12px 0 12px 38px;
        font-size: 15px;
    }

    .hm-usage ol li::before {
        top: 10px;
    }

    .hm-usage ul li::before {
        top: 22px;
    }

    .hm-btn {
        padding: 13px 18px;
        font-size: 14.5px;
    }

    .hm-piliers {
        grid-template-columns: 1fr;
    }

    .hm-pilier,
    .hm-pilier + .hm-pilier {
        padding: 20px 0;
        border-left: none;
    }

    .hm-pilier + .hm-pilier {
        border-top: 1px solid var(--hm-line);
    }

    .hm-pilier h3 {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .hm-pilier p {
        font-size: 15px;
    }

    .hm-engagements .hm-h2 {
        margin-bottom: 22px;
    }

    .hm-final {
        padding: 44px 0;
    }

    .hm-final-grid {
        gap: 22px;
    }

    .hm .hm-final h2 {
        font-size: 28px;
    }

    .hm-final p {
        margin-top: 6px;
        font-size: 15px;
    }

    .hm-final .hm-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}

@media (max-width: 560px) {
    /* La barre passe sur deux lignes : champ, puis bouton pleine largeur */
    .hm-search-bar {
        flex-wrap: wrap;
        gap: 6px;
        padding: 6px;
        border-radius: 12px;
    }

    .hm-search-btn {
        flex-basis: 100%;
        min-height: 50px;
    }

    .hm-final .hm-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hm-aide.is-visible,
    .hm-erreur.is-visible {
        animation: none;
    }

    .hm-btn svg,
    .hm-search-bar,
    .hm-search-btn,
    .hm-search-btn svg {
        transition: none;
    }
}
