/* ==========================================================================
   Acephal — acephal.fr/lancer-mon-projet/ (project submission page)
   Mobile-first, loaded after home.css and auth.css (reuses their tokens,
   sections, steps and buttons).
   ========================================================================== */

:root {
    --field-border: #B9C6D6;
    --error: #B42318;
    --error-bg: #FEF3F2;
    --info-bg: #EEF5FF;
    --success: #0B7A5C;
    --success-bg: #E7F7EF;
}

/* Component classes set display; keep the hidden attribute authoritative. */
.projet-page [hidden] {
    display: none !important;
}

/* ---- Page hero ---------------------------------------------------------- */
/* Compact bar: the form is the point of the page, no promotional hero. */
.page-hero {
    padding-block: var(--space-2) var(--space-5);
}

.page-hero__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--space-2);
    font-size: 0.85rem;
    line-height: 1.5;
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: 0;
    list-style: none;
    color: var(--acephal-gray);
}

.breadcrumb li + li::before {
    content: "/";
    margin-right: var(--space-2);
    opacity: 0.6;
}

.breadcrumb a {
    color: inherit;
}

.breadcrumb a:hover {
    color: var(--acephal-cyan);
}

/* Page heading shown as the last breadcrumb step. */
.page-hero__title {
    font-size: inherit;
    font-weight: var(--weight-semibold);
    line-height: inherit;
    color: var(--acephal-white);
}

.page-hero__title::before {
    content: "/";
    margin-right: var(--space-2);
    font-weight: var(--weight-regular);
    color: var(--acephal-gray);
    opacity: 0.6;
}

.page-hero__title span {
    color: var(--acephal-cyan);
}

/* ---- Layout: form + tips ------------------------------------------------ */
.section--form {
    padding-top: var(--space-6);
}

.submit-layout {
    display: grid;
    gap: var(--space-6);
}

.form-card {
    padding: var(--space-6) var(--space-5);
    border: 1px solid var(--line-light);
    border-radius: var(--radius-panel);
    background: var(--surface-white);
    color: var(--text-strong);
    box-shadow: 0 14px 34px -26px color-mix(in srgb, var(--acephal-night) 60%, transparent);
}

/* Task page: headings kept smaller than on the marketing home page. */
.projet-page .section-title {
    font-size: clamp(1.5rem, 5.5vw, 2.25rem);
}

.form-card__title {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
    font-weight: var(--weight-bold);
    line-height: 1.2;
}

.form-card__title:focus {
    outline: none;
}

.form-card__intro {
    margin-top: var(--space-3);
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-body);
}

.req {
    color: var(--error);
}

.opt {
    font-weight: var(--weight-regular);
    color: var(--text-body);
}

/* Account choice */
.account-box {
    display: grid;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding: var(--space-4);
    border-radius: 12px;
    background: var(--info-bg);
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-strong);
}

.account-box--in {
    grid-template-columns: auto 1fr;
    align-items: start;
    background: var(--success-bg);
}

.account-box--in .icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.1rem;
    color: var(--success);
}

.account-box a:not(.button) {
    color: var(--accent-on-light);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.account-box .button {
    justify-self: start;
}

/* Outline button for light backgrounds. */
.button--outline {
    border: 1px solid var(--accent-on-light);
    background: transparent;
    color: var(--accent-on-light);
}

button.button--outline {
    border: 1px solid var(--accent-on-light);
}

.button--outline:hover {
    box-shadow: none;
    background: color-mix(in srgb, var(--accent-on-light) 8%, transparent);
}

/* ---- Form --------------------------------------------------------------- */
.project-form {
    display: grid;
    gap: var(--space-4);
    margin-top: var(--space-5);
}

.field {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.field label,
.field legend {
    padding: 0;
    font-size: 0.85rem;
    font-weight: var(--weight-semibold);
    color: var(--text-strong);
}

.field legend {
    margin-bottom: 0.35rem;
}

/* 16px font size prevents iOS from zooming on focus; 44px keeps a comfortable touch target. */
.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--field-border);
    border-radius: 8px;
    background: var(--surface-white);
    color: var(--text-strong);
    font: inherit;
    font-size: 1rem;
}

.field textarea {
    min-height: 7rem;
    line-height: 1.5;
    resize: vertical;
}

.field ::placeholder {
    color: #8A99AD;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--acephal-blue) 45%, transparent);
    outline-offset: 1px;
    border-color: var(--acephal-blue);
}

.field__help,
.field__count {
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--text-body);
}

.field__meta {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
}

.field__count {
    flex: none;
    font-variant-numeric: tabular-nums;
}

/* Under the 30-character minimum. */
.field__count.is-short {
    font-weight: var(--weight-semibold);
    color: var(--accent-on-light);
}

.field__error {
    font-size: 0.85rem;
    font-weight: var(--weight-medium);
    color: var(--error);
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
    border-color: var(--error);
}

/* Radio cards: two columns from the smallest phones, compact, to keep the form short. */
.choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.field .choice {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: var(--space-2);
    min-height: 44px;
    padding: 0.55rem var(--space-3);
    border: 1px solid var(--field-border);
    border-radius: 10px;
    background: var(--surface-white);
    font-size: 0.8rem;
    font-weight: var(--weight-regular);
    line-height: 1.35;
    color: var(--text-body);
    cursor: pointer;
    transition: border-color var(--duration) var(--ease), background-color var(--duration) var(--ease);
}

.choice input {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.1rem;
    accent-color: var(--accent-on-light);
}

.choice strong {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.88rem;
    line-height: 1.3;
    font-weight: var(--weight-semibold);
    color: var(--text-strong);
}

.choice:hover {
    border-color: var(--accent-on-light);
}

.choice:has(input:checked) {
    border-color: var(--accent-on-light);
    background: var(--info-bg);
    box-shadow: inset 0 0 0 1px var(--accent-on-light);
}

.choice:has(input:focus-visible) {
    outline: 3px solid color-mix(in srgb, var(--acephal-blue) 45%, transparent);
    outline-offset: 1px;
}

.field.is-invalid .choice {
    border-color: var(--error);
}

/* Contact block */
.contact {
    display: grid;
    gap: var(--space-4);
    margin: 0;
    padding: var(--space-5) 0 0;
    border: 0;
    border-top: 1px solid var(--line-light);
}

.contact__title {
    font-size: 1.05rem;
    font-weight: var(--weight-bold);
    color: var(--text-strong);
}

.contact .account-box {
    margin-top: 0;
}

.contact__fields {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.contact__row,
.field-row {
    display: grid;
    align-items: start;
    gap: var(--space-4);
}

/* Consent */
.field--check {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: var(--space-2) var(--space-3);
}

.field--check input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.15rem;
    accent-color: var(--accent-on-light);
}

.field--check label {
    font-weight: var(--weight-regular);
    line-height: 1.5;
    color: var(--text-body);
}

.field--check .field__error {
    grid-column: 1 / -1;
}

.field--check a {
    color: var(--accent-on-light);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Commitments shown right before consent and submit. */
.reassure {
    display: grid;
    gap: var(--space-2);
    margin: var(--space-4) 0 0;
    padding: var(--space-3) var(--space-4);
    border-radius: 12px;
    background: var(--success-bg);
    list-style: none;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-body);
}

.reassure li {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: var(--space-2);
}

.reassure .icon {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
    color: var(--success);
}

.reassure strong {
    font-weight: var(--weight-semibold);
    color: var(--text-strong);
}

/* Honeypot: off-screen for people, still in the DOM for bots. */
.hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.project-form__submit {
    width: 100%;
    min-height: 2.9rem;
    font-size: 1rem;
}

.project-form__note {
    margin-top: calc(-1 * var(--space-2));
    font-size: 0.78rem;
    line-height: 1.45;
    text-align: center;
    color: var(--text-body);
}

.form-alert {
    padding: var(--space-3) var(--space-4);
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.form-alert--error {
    margin-top: var(--space-4);
    background: var(--error-bg);
    color: var(--error);
}

.project-form .form-alert--error {
    margin-top: 0;
}

/* Success state */
.success {
    display: grid;
    justify-items: start;
    gap: var(--space-2);
}

.success__icon {
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: var(--space-3);
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
}

.success__icon .icon {
    width: 1.75rem;
    height: 1.75rem;
}

.success__ref {
    margin-top: var(--space-2);
    font-size: 1.05rem;
}

.success__ref strong {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: var(--accent-on-light);
}

.success .actions {
    margin-top: var(--space-4);
    width: 100%;
}

/* ---- Tips --------------------------------------------------------------- */
.tips {
    padding: var(--space-5);
    border: 1px dashed var(--field-border);
    border-radius: var(--radius-panel);
    color: var(--text-strong);
}

.tips__title {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: 1.05rem;
    font-weight: var(--weight-bold);
    line-height: 1.35;
    list-style: none;
    cursor: pointer;
}

.tips__title::-webkit-details-marker {
    display: none;
}

/* Phones: tips collapsed inside the form, right after the description. */
.tips-slot:empty {
    display: none;
}

.tips-slot .tips {
    padding: var(--space-3) var(--space-4);
    border-radius: 12px;
    background: var(--surface-white);
}

.tips-slot .tips__title {
    align-items: center;
    min-height: 44px;
    font-size: 0.92rem;
}

.tips-slot .tips__title::after {
    content: "+";
    flex: none;
    display: grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    margin-left: auto;
    border-radius: 50%;
    background: var(--info-bg);
    font-size: 1.1rem;
    font-weight: var(--weight-regular);
    color: var(--accent-on-light);
}

.tips-slot .tips__details[open] .tips__title::after {
    content: "\2212";
}

.tips-slot .tips__list {
    margin-top: var(--space-3);
}

.tips-slot .tips__note {
    margin-top: var(--space-4);
}

.tips__title .icon {
    flex: none;
    width: 1.4rem;
    height: 1.4rem;
    color: var(--accent-on-light);
}

.tips__list {
    display: grid;
    gap: var(--space-4);
    margin-top: var(--space-4);
    padding: 0;
    list-style: none;
}

.tips__list li {
    padding-left: var(--space-4);
    border-left: 2px solid var(--accent-on-light);
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-body);
}

.tips__list strong {
    display: block;
    font-weight: var(--weight-semibold);
    color: var(--text-strong);
}

.tips__note {
    margin-top: var(--space-5);
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-body);
}

/* ---- FAQ ---------------------------------------------------------------- */
.faq-layout {
    display: grid;
    gap: var(--space-6);
}

.faq {
    display: grid;
    gap: var(--space-3);
}

.faq__item {
    border: 1px solid var(--line-light);
    border-radius: 12px;
    background: var(--surface-white);
}

.faq__item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: 56px;
    padding: var(--space-3) var(--space-4);
    font-weight: var(--weight-semibold);
    line-height: 1.4;
    color: var(--text-strong);
    cursor: pointer;
    list-style: none;
}

.faq__item summary::-webkit-details-marker {
    display: none;
}

.faq__item summary::after {
    content: "+";
    flex: none;
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--info-bg);
    font-size: 1.2rem;
    font-weight: var(--weight-regular);
    color: var(--accent-on-light);
}

.faq__item[open] summary::after {
    content: "\2212";
}

.faq__item summary:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--acephal-blue) 45%, transparent);
    outline-offset: 2px;
    border-radius: 12px;
}

.faq__answer {
    padding: 0 var(--space-4) var(--space-4);
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-body);
}

.faq__answer a {
    color: var(--accent-on-light);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.faq__answer p + p {
    margin-top: var(--space-2);
}

/* ==========================================================================
   Larger screens
   ========================================================================== */
@media (min-width: 600px) {
    .form-card {
        padding: var(--space-7) var(--space-6);
    }

    .choices {
        gap: var(--space-3);
    }

    .field .choice {
        gap: var(--space-3);
        padding: 0.6rem var(--space-4);
    }

    .contact__row {
        grid-template-columns: 1fr 1.4fr;
    }

    /* Project type and usage share the line, half each. */
    .field-row {
        grid-template-columns: 1fr 1fr;
    }

    .project-form__submit {
        justify-self: start;
        width: auto;
        padding-inline: 2.25rem;
    }

    .project-form__note {
        text-align: left;
    }

    .success .actions {
        width: auto;
    }
}

@media (min-width: 1024px) {
    .submit-layout {
        grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
        align-items: start;
        gap: var(--space-7);
    }

    .tips {
        position: sticky;
        top: var(--space-5);
    }

    /* Sidebar: always open, the heading is not a toggle. */
    .tips__title {
        cursor: default;
    }

    .faq-layout {
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
        align-items: start;
        gap: var(--space-8);
    }
}
