/* rent_documents.css : documents des locations, fichier unique du domaine (pas de CSS supplémentaire par page)
   - manage_documents.php : panneau, cartes, carte Ajouter / Générer, section « Documents générés »
   - generate_document.php : assistant de génération ; rents_documents_pdf.php : page d'impression
   Couleurs et boutons : ceux de style.css et de Foundation (.button, .help-text, .text-center, .va-center) */

.documents-intro p,
.documents-presentation p {
	margin-bottom: 0.5rem;
}

/* Présentation grand public (visiteur non connecté) : Archiver / Générer */
.documents-presentation-card {
	height: calc(100% - 1rem);
}

.documents-presentation-card h3 {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 1.25rem;
	color: #00970E;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid #f0f0f0;
}

.documents-presentation-features {
	list-style: none;
	margin-left: 0;
}

.documents-presentation-features li {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.documents-presentation-icon {
	flex: 0 0 auto;
}

.documents-presentation-badges .label {
	margin: 0 0.25rem 0.25rem 0;
}

.documents-presentation-dataflow {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
}

.documents-presentation-source {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.documents-presentation-arrow {
	font-size: 1.5rem;
	color: #00970E;
}

.documents-presentation-benefit {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.documents-presentation-benefit p {
	margin-bottom: 0;
}

.documents-grid {
	margin-top: 1rem;
}

.documents-card {
	height: calc(100% - 1rem);
}

.documents-card-unclassified {
	border-color: #ffae00;
	box-shadow: 0 0 0 2px #ffae00;
}

/* Carte Ajouter / Générer : deux blocs superposés, boutons identiques (icône 30x30 + libellé) */
.documents-add-card .card-section {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 260px;
}

.documents-action-block + .documents-action-block {
	margin-top: 0.5rem;
	padding-top: 1rem;
	border-top: 1px solid #e6e6e6;
}

.documents-action-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
	font-weight: bold;
}

.documents-progress {
	width: 100%;
	margin-bottom: 0.5rem;
}

.documents-progress-meter {
	width: 0;
	color: #fff;
	font-size: 0.75rem;
	white-space: nowrap;
	padding-left: 0.25rem;
	transition: width 0.2s ease;
}

/* Miniatures */
.documents-thumb-zone {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 220px;
	background: #f4f4f4;
	border-bottom: 1px solid #e6e6e6;
	overflow: hidden;
}

.documents-thumb-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.documents-thumb {
	max-width: 100%;
	max-height: 220px;
	object-fit: contain;
}

.documents-thumb-icon {
	max-height: 64px;
}

.documents-thumb-extension {
	margin-top: 0.5rem;
	font-weight: bold;
	color: #767676;
}

/* Détails */
.documents-title {
	font-weight: bold;
	word-break: break-word;
	margin-bottom: 0.25rem;
}

/* Type, entrée/sortie et date du document sur une même ligne */
.documents-badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	margin-bottom: 0.25rem;
}

.documents-date {
	font-size: 0.85rem;
	color: #767676;
}

.documents-type-filter {
	max-width: 32rem;
}

.documents-meta {
	font-size: 0.85rem;
	color: #767676;
	margin-bottom: 0.25rem;
}

.documents-actions {
	margin-top: 0.5rem;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

.documents-properties-form {
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	border-top: 1px solid #e6e6e6;
}

/* ===== Génération de documents (repris de generate_document-overrides.css, supprimé le 2026-11-21) ===== */

/* Section « Documents générés » du panneau (manage_documents.php) */
.generate-document-panel-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.generate-document-panel-header h5 {
	margin-bottom: 0;
}

.generate-document-empty {
	margin: 0.5rem 0 0;
	color: #6b6b6b;
}

.generate-document-table {
	margin: 0.75rem 0 0;
}

.generate-document-actions {
	white-space: nowrap;
	text-align: right;
}

/* Boutons d'action : Form::ButtonAction(), style commun .button-action de style.css */

.generate-document-status-draft { background: #767676; }
.generate-document-status-archived { background: #1779ba; }
.generate-document-status-signed { background: #3adb76; }
.generate-document-status-signaturepending,
.generate-document-status-partiallysigned { background: #ffae00; }
.generate-document-status-cancelled { background: #cc4b37; }

/* Étape 1 : choix du modèle */
.generate-document-template-card {
	height: calc(100% - 1rem);
}

.generate-document-recommended {
	border-color: #3adb76;
	box-shadow: 0 0 0 2px #3adb76;
}

.generate-document-template-desc {
	min-height: 3rem;
}

/* Étapes */
.generate-document-steps {
	margin-bottom: 1rem;
	border-bottom: 1px solid #e6e6e6;
}

.generate-document-steps a.is-active {
	font-weight: bold;
	border-bottom: 3px solid #1779ba;
}

/* Étape Document de generate_document.php (rendu pur) : document en lecture seule, valeurs en gras surlignées */
.generate-document-render {
	background-color: #fff;
	border: 1px solid #e6e6e6;
	padding: 1.5rem;
	margin-bottom: 1rem;
	line-height: 1.6;
}

.generate-document-render-section {
	margin-bottom: 1rem;
}

.generate-document-render-section h6 {
	font-weight: bold;
	margin-bottom: 0.25rem;
}

.generate-document-value {
	background-color: #E4F4EE;
	padding: 0 0.2rem;
	border-radius: 3px;
}

.generate-document-value.is-empty {
	background-color: #fff3d9;
	color: #8a5a00;
}

.generate-document-free-clauses {
	border: 1px dashed #00970E;
	padding: 0.75rem 1rem;
	margin: 1rem 0;
}

.generate-document-free-clause .generate-document-section-header select {
	width: auto;
	margin-bottom: 0;
}

.generate-document-signature {
	border: 1px solid #cacaca;
	padding: 0.5rem 0.75rem;
	margin-bottom: 0.75rem;
	min-height: 6rem;
}

/* Champs regroupés par notion : un fieldset Foundation par groupe (DocumentTemplate::FIELD_GROUPS) */
.generate-document-group {
	background-color: #fff;
	margin: 0 0 1rem;
	padding: 0.75rem 1rem 0.25rem;
}

.generate-document-group legend {
	font-weight: bold;
	color: #00970E;
	background-color: #fff;
	padding: 0 0.5rem;
}

/* Calendrier du portail (Form::Datepicker) dans un champ de l'assistant : champ et bouton sur une ligne */
.generate-document-field .hasDatepicker {
	display: inline-block;
	width: calc(100% - 3rem);
}

.generate-document-field .ui-datepicker-trigger {
	margin-left: 0.25rem;
	vertical-align: top;
}

.generate-document-field {
	margin-bottom: 0.75rem;
}

.generate-document-meta {
	margin-top: -0.6rem;
	font-size: 0.8rem;
}

.generate-document-origin {
	display: inline-block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	vertical-align: bottom;
	color: #1779ba;
}

.generate-document-origin.is-modified {
	color: #8a5a00;
}

.generate-document-warning {
	display: block;
	color: #cc4b37;
}

.generate-document-save-property {
	display: block;
	font-size: 0.8rem;
}

.generate-document-checklist label {
	display: inline-block;
	margin-right: 1rem;
}

.generate-document-index-select {
	margin-top: -0.5rem;
}

.generate-document-step-actions {
	margin: 1rem 0;
}

/* Éditeur de clauses */
.generate-document-section {
	border: 1px solid #e6e6e6;
	padding: 0.5rem;
	margin-bottom: 0.5rem;
}

.generate-document-section-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.generate-document-section-header label {
	white-space: nowrap;
}

.generate-document-section-title {
	flex: 1 1 auto;
	margin-bottom: 0;
}

.generate-document-section-body {
	margin: 0.5rem 0 0;
	font-family: inherit;
}

/* Aperçu et impression */
.generate-document-preview {
	width: 100%;
	height: 80vh;
	border: 1px solid #e6e6e6;
}

.generate-document-print,
.generate-document-print-frame {
	margin: 0;
	width: 100%;
	height: 100vh;
	border: 0;
}

@media screen and (max-width: 39.9375em) {
	.generate-document-actions {
		white-space: normal;
	}
}

/* ==========================================================================
   Signature électronique (req_document_signature.php, document_sign.php, class.esign.php)
   ========================================================================== */

/* Polices du cachet, choisies par le navigateur selon l'écriture du nom (mêmes fichiers que le PDF : fonts/esign/, licence OFL) */
@font-face {
	font-family: "ESignHand";
	src: url("../fonts/esign/MarckScript-Regular.ttf") format("truetype");
	unicode-range: U+0000-024F, U+0400-052F, U+1E00-1EFF;
}
@font-face {
	font-family: "ESignHand";
	src: url("../fonts/esign/Amiri-Regular.ttf") format("truetype");
	unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
	font-family: "ESignHand";
	src: url("../fonts/esign/YujiSyuku-Regular.ttf") format("truetype");
	unicode-range: U+3040-30FF;
}
@font-face {
	font-family: "ESignHand";
	src: url("../fonts/esign/MaShanZheng-Regular.ttf") format("truetype");
	unicode-range: U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF;
}
@font-face {
	font-family: "ESignHand";
	src: url("../fonts/esign/NanumBrushScript-Regular.ttf") format("truetype");
	unicode-range: U+1100-11FF, U+3130-318F, U+AC00-D7AF;
}

/* Cadre de statut et de pilotage au-dessus de l'aperçu */
.esign-tracking-title {
	margin-bottom: 0.5rem;
	font-size: 1.05rem;
}
.esign-icon {
	width: 30px;
	height: 30px;
	vertical-align: middle;
}
.esign-icon-small {
	width: 20px;
	height: 20px;
	vertical-align: middle;
}
.esign-progress .progress {
	margin-bottom: 0.25rem;
}
.esign-progress-meter {
	width: 0;
	transition: width 0.4s ease;
}
.esign-progress-label {
	font-size: 0.85rem;
	margin-bottom: 0.75rem;
}
.esign-tracking-table {
	font-size: 0.85rem;
	margin-bottom: 0.75rem;
}
.esign-tracking-table td:last-child {
	white-space: nowrap;
}
.esign-email-missing {
	color: #cc4b37;
	font-weight: bold;
}
.esign-tracking-actions .button {
	margin-bottom: 0.25rem;
}
.esign-tracking-details {
	margin: 0;
	font-size: 0.85rem;
}

/* Étape Parties : une case par locataire ou caution */
.generate-document-persons {
	margin-bottom: 0.5rem;
}
.generate-document-person-row {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.9rem;
}

/* Détails de génération et de signature (fenêtre) */
.generate-document-details-table {
	font-size: 0.82rem;
	margin-bottom: 1rem;
}
.generate-document-details-table th {
	text-align: left;
	white-space: nowrap;
}
.generate-document-hash {
	font-family: monospace;
	word-break: break-all;
}

/* Page publique de signature */
.document-sign-summary h4 {
	margin-bottom: 0.25rem;
}
.document-sign-contact {
	border-left: 4px solid #00970E;
	padding-left: 0.75rem;
	margin: 0.75rem 0;
}
.document-sign-contact p {
	margin-bottom: 0.25rem;
}
.document-sign-preview {
	height: 70vh;
}
.document-sign-answer {
	margin-top: 1rem;
}
.document-sign-approve {
	margin: 0.75rem 0;
}
.esign-stamp-preview {
	border: 2px solid #193787;
	color: #193787;
	padding: 0.4rem 0.75rem;
	max-width: 22rem;
	font-size: 0.8rem;
	line-height: 1.4;
}
.esign-stamp-name {
	font-family: "ESignHand", "DejaVu Serif", serif;
	font-size: 1.6rem;
	line-height: 1.5;
	color: #193787;
}
.esign-initials-preview {
	font-size: 1.2rem;
}
/* Aperçu du cadre signé : « Lu et approuvé » calligraphié, puis la date, au-dessus du cachet */
.esign-approved-preview {
	font-size: 1.3rem;
}
.esign-approved-date-preview {
	color: #193787;
	font-size: 0.85rem;
	margin-bottom: 0.4rem;
}
/* Mention de la caution (acte de cautionnement) : modèle à recopier puis saisie */
.document-sign-mention {
	margin: 0.75rem 0;
}
.document-sign-mention-model {
	font-size: 0.9rem;
	border-left-color: #193787;
}
#document_sign_mention {
	font-family: "ESignHand", "DejaVu Serif", serif;
	font-size: 1.15rem;
	color: #193787;
}
