/* Formulaire public diagnostic — Nexoria */

:root {
    --pd-bg: #060910;
    --pd-card: rgba(255, 255, 255, 0.045);
    --pd-line: rgba(255, 255, 255, 0.1);
    --pd-text: #EEF2FF;
    --pd-muted: rgba(238, 242, 255, 0.58);
    --pd-brand: #2F55FF;
    --pd-brand-2: #5B7CFF;
    --pd-ok: #34D399;
    --pd-danger: #F87171;
    --pd-radius: 1.1rem;
    --font: "DM Sans", system-ui, sans-serif;
    --display: "Syne", "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.pd-body {
    font-family: var(--font);
    color: var(--pd-text);
    background: var(--pd-bg);
    line-height: 1.55;
}

.pd-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 50% at 10% 0%, rgba(47, 85, 255, 0.28), transparent 55%),
        radial-gradient(ellipse 50% 40% at 100% 100%, rgba(47, 85, 255, 0.12), transparent 50%),
        linear-gradient(180deg, #060910, #0A1020);
    z-index: 0;
}

.pd-top, .pd-main { position: relative; z-index: 1; }
.pd-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.25rem;
    max-width: 920px;
    margin: 0 auto;
}
.pd-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff;
    text-decoration: none;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.03em;
}
.pd-brand img { border-radius: 0.55rem; }
.pd-top-note { margin: 0; font-size: 0.8rem; color: var(--pd-muted); }

.pd-main {
    max-width: 920px;
    margin: 0 auto;
    padding: 0.5rem 1.25rem 3rem;
}

.pd-intro { margin-bottom: 1.25rem; }
.pd-eyebrow {
    margin: 0 0 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--pd-brand-2);
}
.pd-intro h1, .pd-card h1, .pd-panel h2 {
    font-family: var(--display);
    letter-spacing: -0.035em;
    margin: 0 0 0.55rem;
    line-height: 1.15;
}
.pd-intro h1 { font-size: clamp(1.75rem, 4vw, 2.35rem); }
.pd-lead { margin: 0; color: var(--pd-muted); max-width: 38rem; }
.pd-hint { margin: 0 0 1.25rem; color: var(--pd-muted); font-size: 0.95rem; }

.pd-card {
    background: var(--pd-card);
    border: 1px solid var(--pd-line);
    border-radius: var(--pd-radius);
    padding: 1.35rem 1.25rem 1.25rem;
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.pd-panel h2 { font-size: 1.35rem; }

.pd-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.pd-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--pd-brand), var(--pd-brand-2));
    transition: width 0.35s ease;
}

.pd-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.35rem;
}
.pd-step-pill {
    border: 1px solid var(--pd-line);
    background: transparent;
    color: var(--pd-muted);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}
.pd-step-pill.is-active {
    color: #fff;
    border-color: rgba(47, 85, 255, 0.55);
    background: rgba(47, 85, 255, 0.2);
}
.pd-step-pill.is-done { color: var(--pd-ok); border-color: rgba(52, 211, 153, 0.35); }

.pd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem 0.85rem;
}
.pd-span-2 { grid-column: span 2; }
@media (max-width: 720px) {
    .pd-grid { grid-template-columns: 1fr; }
    .pd-span-2 { grid-column: span 1; }
}

.pd-field, .pd-field span, fieldset.pd-field legend {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(238, 242, 255, 0.78);
}
.pd-field span, fieldset.pd-field legend { margin-bottom: 0.35rem; }
fieldset.pd-field {
    border: none;
    margin: 0;
    padding: 0;
}
.pd-field input,
.pd-field select,
.pd-field textarea {
    width: 100%;
    border-radius: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #F8FAFC;
    padding: 0.75rem 0.9rem;
    font: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.pd-field textarea { resize: vertical; min-height: 88px; }
.pd-field input::placeholder,
.pd-field textarea::placeholder {
    color: rgba(248, 250, 252, 0.42);
}
.pd-field input:hover,
.pd-field select:hover,
.pd-field textarea:hover {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.11);
}
.pd-field input:focus,
.pd-field select:focus,
.pd-field textarea:focus {
    border-color: rgba(91, 124, 255, 0.9);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(47, 85, 255, 0.25);
}

/* Selects lisibles (évite le gris sombre illisible) */
.pd-field select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #EEF2FF;
    color: #0F172A;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231E293B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 1rem;
    padding-right: 2.4rem;
    font-weight: 600;
    cursor: pointer;
}
.pd-field select:hover,
.pd-field select:focus {
    background-color: #FFFFFF;
    color: #0F172A;
}
.pd-field select option {
    color: #0F172A;
    background: #FFFFFF;
    font-weight: 500;
}
.pd-field select option:disabled {
    color: #94A3B8;
}

.pd-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}
.pd-checks label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.85rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.86rem;
    font-weight: 600;
    color: #E2E8F0;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    user-select: none;
}
.pd-checks label:hover {
    border-color: rgba(91, 124, 255, 0.55);
    background: rgba(47, 85, 255, 0.14);
    color: #fff;
}
.pd-checks input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    flex-shrink: 0;
    border-radius: 0.3rem;
    border: 2px solid rgba(255, 255, 255, 0.45);
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s, background 0.15s;
}
.pd-checks input[type="checkbox"]:checked {
    background: var(--pd-brand);
    border-color: var(--pd-brand);
}
.pd-checks input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 0.28rem;
    top: 0.05rem;
    width: 0.28rem;
    height: 0.55rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.pd-checks label:has(input:checked) {
    border-color: rgba(47, 85, 255, 0.75);
    background: rgba(47, 85, 255, 0.22);
    color: #fff;
}

.pd-captcha {
    margin-top: 0.35rem;
    padding: 1.05rem 1.1rem 1rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(91, 124, 255, 0.45);
    background: rgba(47, 85, 255, 0.12);
}
.pd-captcha .pd-field span {
    color: #E2E8F0;
    font-size: 0.88rem;
}
.pd-captcha .pd-field span strong {
    color: #fff;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}
.pd-captcha .pd-field input {
    background: #FFFFFF;
    color: #0F172A;
    border: 1px solid rgba(15, 23, 42, 0.18);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    max-width: 12rem;
}
.pd-captcha .pd-field input::placeholder {
    color: #94A3B8;
    font-weight: 500;
    letter-spacing: 0;
}
.pd-captcha .pd-field input:hover,
.pd-captcha .pd-field input:focus {
    background: #FFFFFF;
    color: #0F172A;
    border-color: var(--pd-brand);
}
.pd-linkish {
    margin-top: 0.65rem;
    background: none;
    border: none;
    color: #A5B4FC;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.pd-linkish:hover { color: #fff; text-decoration: underline; }

.pd-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1.4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--pd-line);
}
.pd-nav-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.pd-save-status {
    font-size: 0.75rem;
    color: var(--pd-muted);
}
.pd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.85rem;
    padding: 0 1.2rem;
    border-radius: 0.75rem;
    border: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, background 0.2s, opacity 0.2s;
}
.pd-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pd-btn-primary {
    background: var(--pd-brand);
    color: #fff;
    box-shadow: 0 10px 28px rgba(47, 85, 255, 0.35);
}
.pd-btn-primary:hover:not(:disabled) {
    background: #3D62FF;
    transform: translateY(-1px);
}
.pd-btn-ghost {
    background: transparent;
    color: var(--pd-text);
    border: 1px solid var(--pd-line);
}
.pd-btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.05); }

.pd-error {
    margin: 1rem 0 0;
    padding: 0.75rem 0.9rem;
    border-radius: 0.7rem;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #FECACA;
    font-size: 0.9rem;
}
.pd-banner {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.8rem;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #A7F3D0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.9rem;
}
.pd-fine {
    margin: 1.25rem 0 0;
    font-size: 0.75rem;
    color: rgba(238, 242, 255, 0.38);
    text-align: center;
}
.pd-hidden { display: none !important; }

.pd-field span em { font-style: normal; font-weight: 500; color: var(--pd-muted); }
.pd-ambassador input {
    max-width: 18rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}
.pd-code-status {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--pd-muted);
}
.pd-code-status.is-ok { color: var(--pd-ok); font-weight: 600; }
.pd-code-status.is-warn { color: #FBBF24; }

/* —— Inscription ambassadeur —— */
.pd-top-wide, .pd-main-wide { max-width: 1160px; }
.pd-top-note a { color: #A5B4FC; }
.amb-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 2rem;
    align-items: start;
}
.amb-aside { position: sticky; top: 1.25rem; padding-top: 0.5rem; }
.amb-aside h1 {
    font-family: var(--display);
    font-size: clamp(1.8rem, 3.6vw, 2.5rem);
    letter-spacing: -0.035em;
    line-height: 1.1;
    margin: 0 0 0.8rem;
}
.amb-points { list-style: none; padding: 0; margin: 1.4rem 0; display: grid; gap: 0.7rem; }
.amb-points li {
    position: relative;
    padding-left: 1.7rem;
    color: rgba(238, 242, 255, 0.78);
    font-size: 0.95rem;
}
.amb-points li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0.05rem;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 99px;
    background: rgba(52, 211, 153, 0.16);
    color: var(--pd-ok);
    font-size: 0.7rem;
    font-weight: 800;
    display: grid;
    place-items: center;
}
.amb-points strong { color: #fff; }
.amb-note {
    padding: 0.95rem 1.05rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(91, 124, 255, 0.4);
    background: rgba(47, 85, 255, 0.12);
    font-size: 0.9rem;
    color: #E0E7FF;
}
.amb-more { margin: 1rem 0 0; font-size: 0.88rem; }
.amb-more a, .amb-check a, .amb-share a { color: #A5B4FC; }
.amb-card h2 { font-family: var(--display); font-size: 1.35rem; letter-spacing: -0.03em; margin: 0 0 0.35rem; }
.amb-card .pd-error { margin: 0 0 1rem; }
.amb-layout [hidden] { display: none !important; }
.amb-err { display: block; margin-top: 0.35rem; color: #FCA5A5; font-size: 0.78rem; font-weight: 600; }
.amb-consents { display: grid; gap: 0.6rem; }
.amb-check {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    font-size: 0.86rem;
    color: rgba(238, 242, 255, 0.82);
    cursor: pointer;
}
.amb-check input { margin-top: 0.2rem; width: 1.05rem; height: 1.05rem; accent-color: var(--pd-brand); flex-shrink: 0; }
.amb-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.amb-security { margin: 0.6rem 0 0; font-size: 0.78rem; color: rgba(255, 255, 255, 0.55); display: flex; align-items: center; gap: 0.45rem; }
.amb-security::before { content: ""; width: 0.7rem; height: 0.7rem; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: amb-spin 0.8s linear infinite; }
.amb-security.is-ok { color: #6EE7B7; }
.amb-security.is-ok::before { content: "✓"; border: 0; animation: none; width: auto; height: auto; font-weight: 700; }
@keyframes amb-spin { to { transform: rotate(360deg); } }

.amb-done { text-align: center; padding: 2.4rem 1.6rem; }
.amb-done .pd-lead { margin: 0 auto; }
.amb-code-box {
    margin: 1.6rem auto 1.2rem;
    max-width: 22rem;
    padding: 1.1rem;
    border-radius: 1rem;
    border: 2px dashed rgba(91, 124, 255, 0.7);
    background: rgba(47, 85, 255, 0.12);
    display: grid;
    gap: 0.25rem;
}
.amb-code-box span { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--pd-muted); font-weight: 700; }
.amb-code-box strong { font-family: "Courier New", monospace; font-size: 2rem; letter-spacing: 0.18em; color: #fff; }
.amb-code-box .pd-linkish { margin: 0; }
.amb-steps { text-align: left; max-width: 34rem; margin: 0 auto 1.2rem; padding-left: 1.2rem; color: rgba(238, 242, 255, 0.8); display: grid; gap: 0.45rem; }
.amb-steps strong { color: #fff; }
.amb-share { font-size: 0.85rem; color: var(--pd-muted); word-break: break-all; }
.amb-share .pd-linkish { margin: 0 0 0 0.4rem; }
.amb-done-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; margin-top: 1.4rem; }

@media (max-width: 900px) {
    .amb-layout { grid-template-columns: 1fr; gap: 1.25rem; }
    .amb-aside { position: static; }
    .amb-points { margin: 1rem 0; }
}
@media (max-width: 560px) {
    .pd-top { flex-wrap: wrap; gap: 0.4rem; }
    .amb-card .pd-nav { flex-direction: column-reverse; align-items: stretch; }
    .amb-card .pd-nav .pd-btn { width: 100%; }
    .amb-code-box strong { font-size: 1.6rem; }
}

#pd-success, #pd-blocked { text-align: center; padding: 2.5rem 1.5rem; }
.pd-success-icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(52, 211, 153, 0.15);
    color: var(--pd-ok);
    font-size: 1.5rem;
    font-weight: 700;
}
#pd-blocked h1 { color: #FECACA; }
