* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bleu-france: #000091;
  --bleu-light: #3558A2;
  --bleu-hover: #1212FF;
  --rouge: #E1000F;
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #161616;
  --text-mid: #3A3A3A;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #DDDDDD;
  --success: #18753C;
  --warning: #B34000;
  --error: #CE0500;
  --radius: 8px;
}

body {
  font-family: 'Nunito Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== HEADER ===== */
.fr-header {
  background: var(--card);
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, #000091 33.33%, #fff 33.33%, #fff 66.66%, #E1000F 66.66%) 1;
  border-bottom: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.fr-header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.fr-logo-img {
  height: 80px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.fr-header-service {
  border-left: 2px solid var(--bleu-france);
  padding-left: 20px;
}

.fr-header-service-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--bleu-france);
  line-height: 1.3;
}

.fr-header-service-tagline {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
  margin-top: 4px;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

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

.page-title h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--bleu-france);
  line-height: 1.25;
  margin-bottom: 10px;
}

.page-title p {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto;
}

/* ===== CARDS ===== */
.fr-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.fr-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.fr-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #E8EDFF;
  color: var(--bleu-france);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fr-card-icon.orange {
  background: #FFE8D7;
  color: var(--warning);
}

.fr-card-title h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* ===== FORM INPUTS ===== */
.fr-input-group {
  margin-bottom: 16px;
}

.fr-input-group > label,
.fr-form-group > label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.fr-input-hint {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.fr-input {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-bottom: 2px solid var(--text-mid);
  border-radius: 4px 4px 0 0;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .2s;
}

.fr-input:focus {
  outline: none;
  border-color: var(--bleu-france);
  border-bottom-color: var(--bleu-france);
  box-shadow: 0 2px 0 0 var(--bleu-france);
}

.fr-input[readonly] {
  background: #f0f0f0;
  border-bottom-color: var(--border);
  color: var(--text-mid);
}

.fr-input::placeholder { color: var(--text-muted); }

textarea.fr-input {
  resize: vertical;
  min-height: 60px;
}

select.fr-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Icon inside input */
.fr-input-icon-wrap {
  position: relative;
}

.fr-input-icon-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-light);
}

.fr-input-icon-wrap .fr-input {
  padding-left: 40px;
}

/* SIRET row */
.siret-row {
  display: flex;
  gap: 8px;
}

.siret-row .fr-input-icon-wrap {
  flex: 1;
}

.siret-help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-light);
}

.siret-help a {
  color: var(--bleu-france);
}

/* ===== FORM GRID ===== */
.fr-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.fr-form-group.full {
  grid-column: 1 / -1;
}

.fr-form-group label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.required { color: var(--error); }

/* ===== BUTTONS ===== */
.fr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background .15s;
}

.fr-btn-search {
  background: var(--bleu-france);
  color: #fff;
  padding: 11px 18px;
  white-space: nowrap;
}

.fr-btn-search:hover { background: var(--bleu-hover); }

.fr-btn-success {
  background: var(--success);
  color: #fff;
}

.fr-btn-success:hover { background: #136433; }

.fr-btn-full {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
}

/* ===== LOADER ===== */
.loader {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  color: var(--text-light);
  font-size: 14px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--bleu-france);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== ERROR ===== */
.error-msg {
  padding: 12px 16px;
  background: #FFDAD9;
  border-left: 4px solid var(--error);
  color: var(--error);
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
}

/* ===== COMPANY FOUND BANNER ===== */
.company-found {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #d1fae5;
  border-left: 4px solid var(--success);
  color: var(--success);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  border-radius: 0 4px 4px 0;
}

.company-found strong { color: var(--text); }

/* ===== CONSENT ===== */
.fr-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.5;
  transition: border-color .2s;
}

.fr-consent:hover { border-color: var(--bleu-france); }

.fr-consent input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--bleu-france);
  flex-shrink: 0;
}

/* ===== SUCCESS ===== */
.success-container {
  text-align: center;
  padding: 16px 0;
}

.success-checkmark {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: #d1fae5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn .4s ease;
}

@keyframes scaleIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.success-container h2 {
  font-size: 22px;
  color: var(--success);
  margin-bottom: 8px;
}

.success-container > p {
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.recap-box {
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 16px;
}

.recap-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.recap-row:last-child { border-bottom: none; }
.recap-label { color: var(--text-light); }
.recap-value { font-weight: 700; color: var(--text); text-align: right; max-width: 55%; }

.success-note {
  font-size: 13px;
  color: var(--text-light);
  font-style: italic;
}

/* ===== FOOTER ===== */
.fr-footer {
  background: var(--card);
  border-top: 2px solid var(--bleu-france);
  padding: 20px 0;
}

.fr-footer-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.fr-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.fr-trust-badges {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.fr-trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
}

.fr-trust-item svg { color: var(--bleu-france); }

.fr-footer-date {
  font-size: 12px;
  color: var(--text-light);
}

.fr-footer-bottom {
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-light);
}

/* ===== OVERLAY RECHERCHE ===== */
.search-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 50, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.search-overlay-content {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.search-overlay-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--bleu-france);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 24px;
}

.search-overlay-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--bleu-france);
  margin-bottom: 8px;
}

.search-overlay-text {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 24px;
  line-height: 1.5;
}

.search-overlay-progress {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.search-overlay-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--bleu-france), #6366f1);
  border-radius: 3px;
  width: 0%;
  transition: width .6s ease;
}

/* ===== HIDDEN ===== */
.hidden { display: none !important; }

/* ===== MOBILE ===== */
@media (max-width: 640px) {
  .fr-header-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .fr-header-service {
    border-left: none;
    padding-left: 0;
    border-top: 2px solid var(--bleu-france);
    padding-top: 12px;
  }

  .fr-logo-img { height: 65px; }

  .fr-header-service-title { font-size: 16px; }
  .fr-header-service-tagline { font-size: 12px; }

  .container { padding: 20px 14px; }

  .page-title h1 { font-size: 22px; }
  .page-title p { font-size: 14px; }

  .fr-card { padding: 20px 16px; }

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

  .siret-row { flex-direction: column; }
  .fr-btn-search { width: 100%; }

  .fr-card-title { gap: 10px; }
  .fr-card-icon { width: 38px; height: 38px; }
  .fr-card-title h2 { font-size: 16px; }

  .fr-footer-top { flex-direction: column; align-items: flex-start; }

  .recap-row { flex-direction: column; gap: 2px; }
  .recap-value { text-align: left; max-width: 100%; }
}
