/* ============================================
   completer-fiche — Style
   Page publique de complétion pour Immo Transac Réunion
   ============================================ */

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #1f2937;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* HEADER */
.brand-header {
    text-align: center;
    padding: 30px 20px 20px;
}
.brand-logo {
    max-height: 60px;
    margin-bottom: 14px;
}
.brand-header h1 {
    margin: 0;
    font-size: 1.6rem;
    color: #111827;
    letter-spacing: -0.5px;
}
.brand-subtitle {
    margin: 6px 0 0;
    color: #6366f1;
    font-size: 0.95rem;
    font-weight: 500;
}

/* ÉTATS (loading / error / success) */
.state-card {
    background: white;
    border-radius: 16px;
    padding: 40px 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.state-card i {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
}
.state-card h2 {
    margin: 0 0 8px;
    font-size: 1.3rem;
}
.state-card p {
    margin: 8px 0;
    color: #4b5563;
    line-height: 1.5;
}
.state-error i { color: #dc2626; }
.state-success i { color: #16a34a; }
.state-success { border-top: 4px solid #16a34a; }
.state-error { border-top: 4px solid #dc2626; }
.state-hint { font-size: 0.85rem; color: #9ca3af !important; margin-top: 18px !important; }
.state-hint a { color: #6366f1; text-decoration: none; }

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden { display: none !important; }

/* RÉCAP BIEN */
.bien-summary {
    display: flex;
    gap: 16px;
    background: white;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.bien-summary img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}
.bien-info { flex: 1; min-width: 0; }
.bien-ref {
    font-size: 0.72rem;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
    margin-bottom: 4px;
}
.bien-info h2 {
    margin: 0 0 6px;
    font-size: 1.2rem;
    color: #111827;
    line-height: 1.3;
}
.bien-info p {
    margin: 4px 0;
    color: #6b7280;
    font-size: 0.9rem;
}
.bien-prix {
    color: #059669 !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
}

/* INTRO */
.intro {
    background: white;
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.intro p { margin: 8px 0; line-height: 1.55; font-size: 0.95rem; }
.intro-note {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.85rem !important;
    color: #78350f !important;
    margin-top: 14px !important;
}

/* SECTIONS FORMULAIRE */
.form-section {
    background: white;
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.form-section h3 {
    margin: 0 0 16px;
    font-size: 1rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
}
.form-section h3 i { color: #6366f1; }

label {
    display: block;
    margin-bottom: 14px;
}
label:last-child { margin-bottom: 0; }
label > span {
    display: block;
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 6px;
    font-weight: 500;
}
label em {
    color: #dc2626;
    font-style: normal;
    margin-left: 2px;
}

input[type="text"],
input[type="number"],
input[type="url"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fafafa;
    transition: all 0.15s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #6366f1;
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
textarea {
    resize: vertical;
    min-height: 70px;
}

/* CHAMPS DEMANDÉS — format "carte" */
.champ-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fafafa;
}
.champ-card:last-child { margin-bottom: 0; }
.champ-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
}
.champ-label {
    font-weight: 600;
    color: #111827;
    font-size: 0.95rem;
}
.champ-mode {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}
.champ-mode-completer { background: #fee2e2; color: #b91c1c; }
.champ-mode-valider { background: #dbeafe; color: #1e40af; }
.champ-current {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 4px 0 8px;
    font-style: italic;
}
.champ-current strong {
    color: #374151;
    font-style: normal;
}
.champ-card input,
.champ-card textarea,
.champ-card select {
    background: white;
    border-color: #d1d5db;
}

/* FOOTER */
.form-footer {
    background: white;
    border-radius: 14px;
    padding: 18px 22px;
    margin-top: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    position: sticky;
    bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.expiration {
    margin: 0;
    font-size: 0.82rem;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #6366f1;
    color: white;
    border: none;
    padding: 13px 26px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s;
    font-family: inherit;
}
.btn-primary:hover { background: #4f46e5; transform: translateY(-1px); }
.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* FOOTER SITE */
.site-footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    font-size: 0.82rem;
    color: #9ca3af;
}
.site-footer p { margin: 4px 0; }
.site-footer a {
    color: #6366f1;
    text-decoration: none;
}

/* ============================================
   MODE VÉRIFICATION (fiche entière éditable)
   ============================================ */
.verif-section {
    margin-bottom: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.verif-section-title {
    margin: 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.2px;
}
.verif-section-title i {
    color: #6366f1;
    margin-right: 8px;
}
.verif-section-body {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px 14px;
}
.verif-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.verif-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.verif-row input,
.verif-row select,
.verif-row textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.verif-row input:focus,
.verif-row select:focus,
.verif-row textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* RESPONSIVE */
@media (max-width: 560px) {
    .container { padding: 10px 10px 30px; }
    .brand-header { padding: 20px 10px 14px; }
    .brand-header h1 { font-size: 1.3rem; }
    .bien-summary { flex-direction: column; }
    .bien-summary img { width: 100%; height: 180px; }
    .form-section { padding: 16px 14px; }
    .form-footer { flex-direction: column; align-items: stretch; position: static; }
    .btn-primary { width: 100%; justify-content: center; }
    .verif-section-body { grid-template-columns: 1fr; }
}
