/**
 * DoliDiag Analyzer - Public pages CSS
 * Charte graphique alignée sur opendsi.fr
 */

/* ============================================
   RESET & BASE
   ============================================ */
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	background: #f4f5f7;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	color: #272626;
	font-size: 15px;
	line-height: 1.6;
}

body.page-report {
	display: block;
}

a {
	color: #474747;
	transition: all 0.2s ease;
}

a:hover {
	color: #272626;
}

/* ============================================
   HEADER
   ============================================ */
.opendsi-header {
	background: #ffffff;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	padding: 15px 0;
	flex-shrink: 0;
}

.opendsi-header-inner {
	max-width: 1170px;
	margin: 0 auto;
	padding: 0 20px;
	display: flex;
	align-items: center;
	gap: 15px;
}

.opendsi-header img {
	height: 40px;
	width: auto;
}

.opendsi-header-product {
	font-size: 1.1rem;
	font-weight: 500;
	color: #474747;
	padding-left: 15px;
	border-left: 1px solid rgba(0, 0, 0, 0.1);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.page-wrapper {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
}

.page-wrapper.page-wrapper--top {
	align-items: flex-start;
	padding-top: 40px;
}

.container {
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 6px 6px 9px rgba(0, 0, 0, 0.08);
	max-width: 700px;
	width: 100%;
	padding: 40px;
}

.container.container--wide {
	max-width: 1200px;
}

.container.container--narrow {
	max-width: 500px;
}

/* ============================================
   PAGE TITLE AREA
   ============================================ */
.page-title {
	text-align: center;
	margin-bottom: 30px;
}

.page-title h1 {
	color: #272626;
	font-size: 1.8rem;
	font-weight: 700;
	line-height: 1.2;
	margin-bottom: 10px;
}

.page-title p {
	color: #718096;
	font-size: 1rem;
	margin-top: 8px;
}

/* ============================================
   SECTION TITLES
   ============================================ */
.section-title {
	color: #272626;
	font-size: 1.1rem;
	font-weight: 600;
	margin: 25px 0 15px 0;
	padding-bottom: 10px;
	border-bottom: 2px solid #e2e8f0;
}

.section-title:first-of-type {
	margin-top: 0;
}

/* ============================================
   FORMS
   ============================================ */
.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 15px;
	margin-bottom: 15px;
}

.form-row.single {
	grid-template-columns: 1fr;
}

.form-group {
	display: flex;
	flex-direction: column;
}

.form-group label {
	color: #474747;
	font-size: 0.9rem;
	font-weight: 500;
	margin-bottom: 6px;
}

.form-group label .required {
	color: #be574b;
}

.form-group input,
.form-group textarea,
.form-group select {
	padding: 10px 14px;
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	font-size: 1rem;
	font-family: inherit;
	transition: all 0.3s ease;
	background: #ffffff;
	color: #272626;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
	outline: none;
	border-color: #7fde8f;
	box-shadow: 0 0 0 3px rgba(127, 222, 143, 0.15);
}

.form-group input.error {
	border-color: #be574b;
}

/* ============================================
   COMPANY SEARCH (SIRENE)
   ============================================ */
.company-search-wrapper {
	position: relative;
}

.company-search-wrapper input {
	width: 100%;
	padding-right: 45px;
}

.search-btn {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	background: #272626;
	color: #ffffff;
	border: none;
	border-radius: 8px;
	padding: 6px 10px;
	cursor: pointer;
	transition: all 0.3s ease;
}

.search-btn:hover {
	background: #474747;
}

.search-btn:disabled {
	background: #a0aec0;
	cursor: not-allowed;
}

.search-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #ffffff;
	border: 2px solid #e2e8f0;
	border-top: none;
	border-radius: 0 0 12px 12px;
	max-height: 300px;
	overflow-y: auto;
	z-index: 1000;
	display: none;
	box-shadow: 6px 6px 9px rgba(0, 0, 0, 0.1);
}

.search-results.show {
	display: block;
}

.search-result-item {
	padding: 12px 15px;
	border-bottom: 1px solid #e2e8f0;
	cursor: pointer;
	transition: background 0.2s ease;
}

.search-result-item:hover {
	background: #f4f5f7;
}

.search-result-item:last-child {
	border-bottom: none;
}

.search-result-item .company-name {
	font-weight: 600;
	color: #272626;
}

.search-result-item .company-details {
	font-size: 0.85rem;
	color: #718096;
	margin-top: 4px;
}

.search-result-item .siret-badge {
	display: inline-block;
	background: #f4f5f7;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 0.8rem;
	font-family: monospace;
}

.search-loading,
.search-no-results {
	padding: 20px;
	text-align: center;
	color: #718096;
}

/* ============================================
   UPLOAD ZONE
   ============================================ */
.upload-zone {
	border: 3px dashed #cbd5e0;
	border-radius: 16px;
	padding: 40px 20px;
	text-align: center;
	transition: all 0.3s ease;
	cursor: pointer;
	background: #f4f5f7;
	margin-top: 20px;
}

.upload-zone:hover,
.upload-zone.dragover {
	border-color: #7fde8f;
	background: rgba(127, 222, 143, 0.06);
}

.upload-zone svg {
	width: 64px;
	height: 64px;
	color: #a0aec0;
	margin-bottom: 15px;
}

.upload-zone h3 {
	color: #272626;
	margin-bottom: 8px;
}

.upload-zone p {
	color: #718096;
	font-size: 0.9rem;
}

.upload-zone input[type="file"] {
	display: none;
}

/* ============================================
   FILE INFO
   ============================================ */
.file-info {
	background: #f4f5f7;
	border-radius: 12px;
	padding: 15px;
	margin-top: 20px;
	display: none;
}

.file-info.show {
	display: flex;
	align-items: center;
	gap: 15px;
}

.file-info .file-icon {
	width: 40px;
	height: 40px;
	background: #272626;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	flex-shrink: 0;
}

.file-info .file-details {
	flex: 1;
}

.file-info .file-name {
	font-weight: 600;
	color: #272626;
}

.file-info .file-size {
	font-size: 0.85rem;
	color: #718096;
}

.file-info .remove-file {
	color: #be574b;
	cursor: pointer;
	padding: 5px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
	display: inline-block;
	padding: 13px 28px;
	border: none;
	border-radius: 999px;
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.3s ease;
	text-decoration: none;
	text-align: center;
}

.btn-primary {
	background: #7fde8f;
	color: #121212;
}

.btn-primary:hover {
	background: #6bcf7c;
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(127, 222, 143, 0.35);
	color: #121212;
}

.btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.btn-secondary {
	background: transparent;
	color: #474747;
	border: 1px solid rgba(0, 0, 0, 0.15);
}

.btn-secondary:hover {
	background: #f4f5f7;
	border-color: rgba(0, 0, 0, 0.25);
	color: #272626;
}

.actions {
	margin-top: 25px;
	text-align: center;
}

/* ============================================
   MESSAGES
   ============================================ */
.message {
	padding: 15px 20px;
	border-radius: 12px;
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.message svg {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

.message.success {
	background: rgba(127, 222, 143, 0.15);
	color: #22543d;
	border: 1px solid rgba(127, 222, 143, 0.3);
}

.message.error {
	background: rgba(190, 87, 75, 0.1);
	color: #742a2a;
	border: 1px solid rgba(190, 87, 75, 0.2);
}

.message.warning {
	background: #feebc8;
	color: #744210;
	border: 1px solid rgba(237, 137, 54, 0.2);
}

/* ============================================
   SUCCESS BOX
   ============================================ */
.success-box {
	text-align: center;
	padding: 30px;
}

.success-box svg {
	width: 80px;
	height: 80px;
	color: #7fde8f;
	margin-bottom: 20px;
}

.success-box h2 {
	color: #272626;
	margin-bottom: 15px;
}

.success-box p {
	color: #718096;
	margin-bottom: 25px;
}

.token-box {
	background: #f4f5f7;
	border-radius: 12px;
	padding: 15px;
	font-family: monospace;
	font-size: 1.1rem;
	color: #272626;
	word-break: break-all;
	margin-bottom: 20px;
}

.email-box {
	background: rgba(127, 222, 143, 0.1);
	border: 2px solid #7fde8f;
	border-radius: 12px;
	padding: 15px 25px;
	font-size: 1.2rem;
	color: #272626;
	margin: 20px 0;
}

.small-text {
	font-size: 0.85rem;
	color: #a0aec0;
}

.resend-link {
	font-size: 0.9rem;
}

.resend-link a {
	color: #474747;
	text-decoration: underline;
}

.resend-link a:hover {
	color: #272626;
}

/* ============================================
   INFO BOX
   ============================================ */
.info-box {
	background: #f4f5f7;
	border-left: 4px solid #7fde8f;
	padding: 15px 20px;
	margin-top: 25px;
	border-radius: 0 12px 12px 0;
}

.info-box h4 {
	color: #272626;
	margin-bottom: 8px;
	font-weight: 600;
}

.info-box p {
	color: #474747;
	font-size: 0.9rem;
}

.info-box ul {
	color: #474747;
	padding-left: 20px;
}

.info-box li {
	margin-bottom: 5px;
}

/* ============================================
   REPORT PAGE - HEADER
   ============================================ */
.container > .report-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 2px solid #e2e8f0;
}

.container > .report-header h1 {
	color: #272626;
	font-size: 1.8rem;
	font-weight: 700;
}

.header-actions {
	display: flex;
	gap: 10px;
}

/* ============================================
   REPORT PAGE - SUMMARY CARDS
   ============================================ */
.summary-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	margin-bottom: 30px;
}

.card {
	background: #f4f5f7;
	border-radius: 12px;
	padding: 20px;
	border-left: 4px solid #272626;
}

.card h3 {
	color: #718096;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 8px;
	font-weight: 500;
}

.card .value {
	color: #272626;
	font-size: 1.5rem;
	font-weight: 700;
}

.card.success {
	border-left-color: #7fde8f;
}

.card.warning {
	border-left-color: #ed8936;
}

.card.danger {
	border-left-color: #be574b;
}

/* ============================================
   REPORT PAGE - SECTIONS
   ============================================ */
.section {
	margin-bottom: 30px;
}

.section h2 {
	color: #272626;
	font-size: 1.3rem;
	font-weight: 700;
	margin-bottom: 15px;
	padding-bottom: 10px;
	border-bottom: 1px solid #e2e8f0;
}

.info-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 15px;
}

.info-item {
	display: flex;
	justify-content: space-between;
	padding: 12px 15px;
	background: #f4f5f7;
	border-radius: 8px;
}

.info-item .label {
	color: #718096;
	font-weight: 500;
}

.info-item .value {
	color: #272626;
	font-weight: 600;
}

/* ============================================
   REPORT PAGE - TABLES
   ============================================ */
.modules-table {
	width: 100%;
	border-collapse: collapse;
}

.modules-table th,
.modules-table td {
	padding: 12px 15px;
	text-align: left;
	border-bottom: 1px solid #e2e8f0;
}

.modules-table th {
	background: #f4f5f7;
	color: #474747;
	font-weight: 600;
	font-size: 0.85rem;
	text-transform: uppercase;
}

.modules-table tr:hover {
	background: #f4f5f7;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 600;
}

.badge-success {
	background: rgba(127, 222, 143, 0.2);
	color: #22543d;
}

.badge-warning {
	background: #feebc8;
	color: #744210;
}

.badge-danger {
	background: rgba(190, 87, 75, 0.15);
	color: #742a2a;
}

.badge-info {
	background: #bee3f8;
	color: #2a4365;
}

.badge-external {
	background: rgba(148, 99, 174, 0.15);
	color: #553c9a;
}

/* ============================================
   ENTITY SECTION
   ============================================ */
.entity-section {
	background: #f4f5f7;
	border-radius: 12px;
	padding: 20px;
	margin-bottom: 20px;
}

.entity-section h3 {
	color: #272626;
	margin-bottom: 15px;
}

/* ============================================
   RECOMMENDATIONS
   ============================================ */
.recommendations {
	background: rgba(127, 222, 143, 0.08);
	border-radius: 12px;
	padding: 20px;
	border-left: 4px solid #7fde8f;
}

.recommendations h3 {
	color: #272626;
	margin-bottom: 15px;
	font-weight: 600;
}

.recommendations ul {
	list-style: none;
	padding: 0;
}

.recommendations li {
	padding: 8px 0;
	padding-left: 25px;
	position: relative;
	color: #474747;
}

.recommendations li:before {
	content: ">";
	position: absolute;
	left: 0;
	color: #7fde8f;
	font-weight: bold;
}

/* ============================================
   GENERATED REPORT
   ============================================ */
.generated-report {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 30px;
	margin-bottom: 30px;
}

.generated-report h1 {
	color: #272626;
	font-size: 1.8rem;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 2px solid #7fde8f;
}

.generated-report h2 {
	color: #474747;
	font-size: 1.4rem;
	margin: 25px 0 15px 0;
}

.generated-report h3 {
	color: #9463ae;
	font-size: 1.1rem;
	margin: 20px 0 10px 0;
}

.generated-report p {
	color: #474747;
	line-height: 1.7;
	margin-bottom: 15px;
}

.generated-report ul,
.generated-report ol {
	margin: 15px 0;
	padding-left: 25px;
}

.generated-report li {
	color: #474747;
	line-height: 1.6;
	margin-bottom: 8px;
}

.generated-report table {
	width: 100%;
	border-collapse: collapse;
	margin: 20px 0;
}

.generated-report th,
.generated-report td {
	padding: 12px 15px;
	text-align: left;
	border: 1px solid #e2e8f0;
}

.generated-report th {
	background: #f4f5f7;
	font-weight: 600;
	color: #474747;
}

.generated-report blockquote {
	background: rgba(127, 222, 143, 0.08);
	border-left: 4px solid #7fde8f;
	padding: 15px 20px;
	margin: 20px 0;
	border-radius: 0 12px 12px 0;
}

.generated-report code {
	background: #f4f5f7;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 0.9em;
}

.generated-report hr {
	border: none;
	border-top: 1px solid #e2e8f0;
	margin: 25px 0;
}

/* ============================================
   REPORT PENDING / GENERATING
   ============================================ */
.report-pending {
	text-align: center;
	padding: 40px;
	background: #f4f5f7;
	border-radius: 16px;
	border: 1px solid #e2e8f0;
}

.report-pending h3 {
	color: #272626;
	margin-bottom: 10px;
}

.report-pending p {
	color: #474747;
	margin-bottom: 20px;
}

.spinner {
	width: 60px;
	height: 60px;
	margin: 0 auto 20px;
	border: 4px solid #e2e8f0;
	border-top: 4px solid #7fde8f;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.progress-bar {
	width: 100%;
	max-width: 300px;
	height: 6px;
	background: #e2e8f0;
	border-radius: 3px;
	margin: 20px auto;
	overflow: hidden;
}

.progress-bar-inner {
	height: 100%;
	background: linear-gradient(90deg, #7fde8f, #9463ae);
	border-radius: 3px;
	animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
	0% { width: 0%; }
	50% { width: 70%; }
	100% { width: 100%; }
}

.notification-prompt {
	background: rgba(127, 222, 143, 0.1);
	border: 1px solid rgba(127, 222, 143, 0.3);
	border-radius: 12px;
	padding: 15px;
	margin-top: 20px;
	display: none;
}

.notification-prompt.show {
	display: block;
}

.notification-prompt p {
	color: #474747;
	margin-bottom: 10px;
	font-size: 0.9rem;
}

.btn-notification {
	background: #7fde8f;
	color: #121212;
	padding: 8px 20px;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 600;
	font-family: inherit;
	transition: all 0.3s ease;
}

.btn-notification:hover {
	background: #6bcf7c;
}

.status-message {
	font-size: 0.85rem;
	color: #718096;
	margin-top: 15px;
}

/* ============================================
   REPORT ERROR
   ============================================ */
.report-error {
	text-align: center;
	padding: 40px;
	background: rgba(190, 87, 75, 0.08);
	border-radius: 16px;
	border: 1px solid rgba(190, 87, 75, 0.2);
}

.report-error h3 {
	color: #be574b;
	margin-bottom: 10px;
}

.report-error p {
	color: #742a2a;
}

/* ============================================
   NOT FOUND
   ============================================ */
.not-found {
	text-align: center;
	padding: 60px 20px;
}

.not-found svg {
	width: 80px;
	height: 80px;
	color: #a0aec0;
	margin-bottom: 20px;
}

.not-found h2 {
	color: #272626;
	margin-bottom: 10px;
}

.not-found p {
	color: #718096;
	margin-bottom: 25px;
}

/* ============================================
   TOKEN FORM
   ============================================ */
.token-form {
	max-width: 400px;
	margin: 30px auto 0;
}

.token-form input {
	width: 100%;
	padding: 12px 15px;
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	font-size: 1rem;
	font-family: inherit;
	margin-bottom: 15px;
	color: #272626;
}

.token-form input:focus {
	outline: none;
	border-color: #7fde8f;
	box-shadow: 0 0 0 3px rgba(127, 222, 143, 0.15);
}

/* ============================================
   VALIDATE PAGE - ICON
   ============================================ */
.icon {
	width: 80px;
	height: 80px;
	margin: 0 auto 20px;
}

.icon.success {
	color: #7fde8f;
}

.icon.error {
	color: #be574b;
}

/* ============================================
   FOOTER
   ============================================ */
.opendsi-footer {
	background: #121212;
	padding: 30px 0;
	flex-shrink: 0;
}

.opendsi-footer-inner {
	max-width: 1170px;
	margin: 0 auto;
	padding: 0 20px;
	text-align: center;
}

.opendsi-footer a {
	color: #7fde8f;
	text-decoration: none;
	font-weight: 600;
	font-size: 1rem;
}

.opendsi-footer a:hover {
	color: #ffffff;
}

.opendsi-footer-separator {
	color: rgba(255, 255, 255, 0.3);
	margin: 0 10px;
}

.opendsi-footer-partner {
	color: rgba(255, 255, 255, 0.6);
	font-size: 0.9rem;
}

.opendsi-footer p {
	color: rgba(255, 255, 255, 0.4);
	font-size: 0.85rem;
	margin-top: 10px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
	.form-row {
		grid-template-columns: 1fr;
	}

	.container {
		padding: 25px;
		border-radius: 12px;
	}

	.page-wrapper {
		padding: 20px 15px;
	}

	.page-title h1 {
		font-size: 1.4rem;
	}

	.container > .report-header {
		flex-direction: column;
		gap: 15px;
		text-align: center;
	}

	.summary-cards {
		grid-template-columns: 1fr 1fr;
	}

	.generated-report {
		padding: 20px;
	}

	.opendsi-header-product {
		display: none;
	}
}

@media (max-width: 480px) {
	.summary-cards {
		grid-template-columns: 1fr;
	}

	.container {
		padding: 20px;
	}
}
