/* ============================================================
   ZAAG — Espace Citoyen / Services partagés
   Feuille de styles commune à tous les services citoyens
   ============================================================ */

* { box-sizing: border-box; }
body { margin: 0; background: #f4f6fb; font-family: inherit; }

/* ── Flag bar ─────────────────────────────────────────────── */
.flag-bar {
    height: 5px;
    background: linear-gradient(to right, #009e60 33.3%, #fcd116 33.3%, #fcd116 66.6%, #003189 66.6%);
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 12px;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-brand .logo-fallback {
    width: 36px; height: 36px; background: #009e60; border-radius: 9px;
    display: none; align-items: center; justify-content: center;
    color: white; font-weight: 900; font-size: .8rem;
}
.topbar-brand h1 { font-size: .95rem; font-weight: 800; color: #1a3c6e; margin: 0; }
.topbar-brand span { font-size: .72rem; color: #6b7280; display: block; }

.breadcrumb {
    font-size: .8rem; color: #6b7280;
    display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.breadcrumb a { color: #009e60; font-weight: 600; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: #d1d5db; }
.breadcrumb .current { color: #374151; font-weight: 600; }

/* ── Layout ───────────────────────────────────────────────── */
.page-content { max-width: 860px; margin: 0 auto; padding: 24px 16px 64px; }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
    border-radius: 16px; padding: 24px 28px; color: white;
    margin-bottom: 24px;
}
.page-header.ec  { background: linear-gradient(135deg, #1e4d2b 0%, #2e7d42 60%, #009e60 100%); }
.page-header.urb { background: linear-gradient(135deg, #5d3e0f 0%, #9d6b28 60%, #c8a050 100%); }
.page-header h2 { font-size: 1.3rem; font-weight: 800; margin: 0 0 6px; }
.page-header p  { font-size: .85rem; opacity: .88; margin: 0; line-height: 1.5; }
.page-header .delai-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.2); border-radius: 8px;
    padding: 5px 12px; font-size: .78rem; margin-top: 12px;
}

/* ── Hub — grille de services ─────────────────────────────── */
.hub-intro { font-size: .88rem; font-weight: 700; color: #374151; margin: 0 0 14px; }
.services-hub {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}
.svc-card {
    background: white; border-radius: 14px;
    border: 2px solid #e5e7eb; padding: 20px 16px;
    text-align: center; text-decoration: none; color: inherit;
    display: block; transition: all .22s;
}
.svc-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.09); }
.svc-card.ec:hover  { border-color: #009e60; }
.svc-card.urb:hover { border-color: #9d6b28; }
.svc-card .svc-icon { font-size: 2rem; margin-bottom: 10px; display: block; }
.svc-card h3 { font-size: .88rem; font-weight: 700; color: #1a3c6e; margin: 0 0 5px; }
.svc-card .svc-delai { font-size: .72rem; color: #6b7280; margin-bottom: 10px; }
.svc-card .svc-desc  { font-size: .78rem; color: #6b7280; line-height: 1.45; margin-bottom: 12px; }
.svc-card .svc-cta   { font-size: .8rem; font-weight: 700; }
.svc-card.ec  .svc-cta { color: #009e60; }
.svc-card.urb .svc-cta { color: #9d6b28; }
.svc-ref { font-size: .68rem; background: #f3f4f6; color: #6b7280;
    border-radius: 4px; padding: 2px 7px; font-family: monospace;
    display: inline-block; margin-top: 4px; }

/* ── Pipeline urbanisme (hub) ─────────────────────────────── */
.pipeline-box {
    background: white; border-radius: 14px; border: 1px solid #e5e7eb;
    padding: 18px 20px; margin-bottom: 22px;
}
.pipeline-box h4 { font-size: .85rem; font-weight: 700; color: #1a3c6e; margin: 0 0 14px; }
.pipeline { display: flex; align-items: flex-start; }
.pipe-step { flex: 1; text-align: center; position: relative; }
.pipe-step::after {
    content: ''; position: absolute; top: 19px;
    left: 50%; right: -50%; height: 2px; background: #e5e7eb; z-index: 0;
}
.pipe-step:last-child::after { display: none; }
.pipe-circle {
    width: 38px; height: 38px; border-radius: 50%;
    background: #1a3c6e; color: white;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 7px; font-size: .9rem; position: relative; z-index: 1;
}
.pipe-label { font-size: .68rem; color: #6b7280; font-weight: 600; line-height: 1.3; }

/* ── Formulaire ───────────────────────────────────────────── */
.docs-box {
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: 12px; padding: 16px 20px; margin-bottom: 20px;
}
.docs-box h4 { font-size: .85rem; font-weight: 700; color: #92400e; margin: 0 0 10px; }
.docs-box ul { margin: 0; padding-left: 18px; }
.docs-box li { font-size: .82rem; color: #78350f; margin-bottom: 4px; line-height: 1.5; }

.info-box {
    background: #eff6ff; border: 1px solid #bfdbfe;
    border-radius: 12px; padding: 14px 18px; margin-bottom: 18px;
    font-size: .82rem; color: #1e40af; line-height: 1.6;
}

.form-card { background: white; border-radius: 16px; border: 1px solid #e5e7eb; overflow: hidden; }
.form-card-head {
    padding: 16px 22px; border-bottom: 1px solid #e5e7eb;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.form-card-head.ec  { background: #f0fff4; border-bottom-color: #bbf7d0; }
.form-card-head.urb { background: #fef9f0; border-bottom-color: #fde68a; }
.form-card-head h3  { font-size: .95rem; font-weight: 700; color: #1a3c6e; margin: 0; }
.form-card-head .ref-tag {
    font-size: .72rem; font-family: monospace; border-radius: 6px;
    padding: 3px 9px; font-weight: 700;
}
.form-card-head.ec  .ref-tag { background: #dcfce7; color: #166534; }
.form-card-head.urb .ref-tag { background: #fde68a; color: #92400e; }
.form-body { padding: 24px 22px; }
.form-section { margin-bottom: 22px; }
.form-section-title {
    font-size: .74rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px; margin-bottom: 14px;
}
.form-section-title.ec  { color: #009e60; }
.form-section-title.urb { color: #9d6b28; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-group { margin-bottom: 14px; }
.form-label { font-size: .82rem; font-weight: 600; color: #374151; margin-bottom: 5px; display: block; }
.form-label .req { color: #ef4444; }
.form-hint { font-size: .72rem; color: #9ca3af; margin-top: 3px; line-height: 1.4; }

.form-error {
    display: none; margin-bottom: 14px; border-radius: 10px;
    padding: 12px 16px; background: #fef2f2; color: #991b1b;
    border: 1px solid #fecaca; font-size: .83rem;
}

/* ── Submit area ──────────────────────────────────────────── */
.submit-area {
    border-top: 1px solid #e5e7eb; padding: 18px 22px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
}
.submit-info { font-size: .76rem; color: #6b7280; max-width: 280px; line-height: 1.5; }
.btn-submit {
    border: none; color: white; border-radius: 10px;
    padding: 12px 26px; font-size: .92rem; font-weight: 700;
    cursor: pointer; transition: background .2s;
    display: flex; align-items: center; gap: 8px;
}
.btn-submit.ec  { background: #009e60; }
.btn-submit.ec:hover  { background: #007a4d; }
.btn-submit.urb { background: #9d6b28; }
.btn-submit.urb:hover { background: #7c5220; }
.btn-submit:disabled { background: #9ca3af !important; cursor: not-allowed; }
.btn-back {
    background: none; border: 1px solid #e5e7eb; color: #6b7280;
    border-radius: 10px; padding: 11px 18px; font-size: .85rem;
    cursor: pointer; transition: all .2s;
}
.btn-back:hover { border-color: #1a3c6e; color: #1a3c6e; }

/* ── Success card ─────────────────────────────────────────── */
.success-card { display: none; border-radius: 16px; padding: 48px 28px; text-align: center; }
.success-card.ec  { background: white; border: 2px solid #bbf7d0; }
.success-card.urb { background: white; border: 2px solid #fde68a; }
.success-card .s-icon { font-size: 3.5rem; margin-bottom: 16px; }
.success-card h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.success-card.ec  h3 { color: #166534; }
.success-card.urb h3 { color: #92400e; }
.success-card p { font-size: .88rem; color: #6b7280; max-width: 460px; margin: 0 auto 16px; line-height: 1.6; }
.ref-badge {
    display: inline-block; border-radius: 10px;
    padding: 12px 24px; font-size: 1.1rem; font-weight: 900;
    font-family: monospace; margin: 14px 0;
}
.ec  .ref-badge { background: #f0fff4; border: 1px solid #bbf7d0; color: #166534; }
.urb .ref-badge { background: #fef9f0; border: 1px solid #fde68a; color: #92400e; }
.success-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: white; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Back link ────────────────────────────────────────────── */
.back-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: #6b7280; font-size: .83rem; text-decoration: none;
    margin-bottom: 18px; transition: color .2s;
}
.back-link:hover { color: #1a3c6e; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 680px) {
    .services-hub { grid-template-columns: 1fr 1fr; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .submit-area { flex-direction: column; align-items: stretch; }
    .btn-submit, .btn-back { width: 100%; justify-content: center; }
    .pipeline { gap: 2px; }
    .pipe-label { font-size: .6rem; }
}
@media (max-width: 420px) {
    .services-hub { grid-template-columns: 1fr; }
    .topbar { padding: 0 14px; }
    .page-header { padding: 18px 16px; }
    .form-body { padding: 18px 14px; }
}
