:root {
  --bg: #f4f8fc;
  --ink: #10243e;
  --muted: #4a5d76;
  --belnet-blue: #0b5cab;
  --belnet-blue-deep: #033a74;
  --belnet-cyan: #3aaed8;
  --belnet-accent: #ff8f1f;
  --ok: #1d7d4a;
  --ko: #a5283f;
  --surface: #ffffff;
  --border: #d8e2ec;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 420px at 70% -20%, #d9ecff 0%, transparent 55%),
    radial-gradient(760px 300px at 0% 8%, #e7f8ff 0%, transparent 60%),
    var(--bg);
}

.site-header {
  background: linear-gradient(120deg, var(--belnet-blue-deep), var(--belnet-blue));
  color: #fff;
  padding-bottom: 1rem;
  box-shadow: 0 8px 28px rgba(3, 58, 116, 0.28);
}

.topbar {
  width: min(1200px, 95vw);
  margin: 0 auto;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.belnet-logo {
  height: 52px;
  width: auto;
  display: block;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.results-header h2 {
  margin: 0;
}

.entity-filter {
  display: flex;
  gap: 0.35rem;
}

.results-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 200px;
}

.search-box input {
  flex: 1;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  background: transparent;
  color: inherit;
}

.search-box input:focus {
  outline: 2px solid var(--color-accent, #1e40af);
  outline-offset: 1px;
}

.search-error {
  font-size: 0.78rem;
  color: #dc2626;
  white-space: nowrap;
}

.modal-content--wide {
  max-width: min(900px, 95vw);
  width: 100%;
}

.modal-content--help {
  max-width: min(700px, 95vw);
  width: 100%;
}

.help-intro {
  font-size: 0.97rem;
  margin: 0 0 1.2rem;
  line-height: 1.6;
}

.help-steps {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}

.help-step {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--color-accent, #1e40af);
  background: rgba(0, 0, 0, 0.03);
  border-radius: 0 6px 6px 0;
}

.help-step h4 {
  margin: 0 0 0.3rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.help-step p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--color-muted, #4b5563);
}

.help-tip {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--color-muted, #6b7280);
  margin: 0;
}

.modal-content--wide.maximized {
  max-width: 100vw;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}

.modal-content--wide.maximized .modal-body {
  flex: 1;
  overflow: auto;
}

.modal-content--wide.maximized .modal-body textarea {
  height: 100%;
  resize: none;
}

.modal-content--wide textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.modal-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: inherit;
  opacity: 0.6;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: opacity 0.15s;
}

.modal-expand-btn:hover {
  opacity: 1;
  background: rgba(0,0,0,0.06);
}

.corrected-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  align-items: center;
}

.btn-copy {
  padding: 0.4rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--color-accent, #1e40af);
  background: transparent;
  color: var(--color-accent, #1e40af);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.btn-copy:hover {
  background-color: var(--color-accent, #1e40af);
  color: #fff;
}

.btn-copy.copied {
  background-color: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.filter-btn {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--color-border, #d1d5db);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  color: inherit;
}

.filter-btn:hover {
  background-color: var(--color-hover, #f3f4f6);
}

.filter-btn.active {
  background-color: var(--color-accent, #1e40af);
  border-color: var(--color-accent, #1e40af);
  color: #fff;
}

.lang-switcher {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.lang-btn {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.lang-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.lang-btn.active {
  background-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
}

.help-btn {
  padding: 0.28rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.help-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.brand-text {
  font-weight: 700;
}

.hero {
  width: min(1200px, 95vw);
  margin: 0 auto;
  padding: 0.8rem 0 0.4rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.4vw, 2.25rem);
}

.hero p {
  margin: 0.45rem 0 0;
  max-width: 900px;
  color: #e5f2ff;
}

.layout {
  width: min(1200px, 95vw);
  margin: 1.1rem auto 2rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 10px 24px rgba(8, 37, 76, 0.08);
  padding: 1rem 1.2rem;
}

h1,
h2,
h3,
h4 {
  margin-top: 0;
}

.subtitle,
.hint {
  color: var(--muted);
}

.results-panel h2,
.form-panel h2 {
  border-left: 4px solid var(--belnet-accent);
  padding-left: 0.55rem;
}

form {
  display: grid;
  gap: 0.8rem;
}

fieldset {
  border: 1px solid #cddbec;
  border-radius: 10px;
  padding: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  background: #f8fbff;
}

label {
  display: block;
  font-weight: 500;
}

textarea,
input[type="file"],
input[type="text"] {
  width: 100%;
  border: 1px solid #c5d7ea;
  border-radius: 8px;
  padding: 0.7rem;
  font: inherit;
  background: white;
}

textarea:focus,
input[type="file"]:focus,
input[type="text"]:focus {
  outline: 3px solid rgba(58, 174, 216, 0.2);
  border-color: var(--belnet-cyan);
}

button {
  width: fit-content;
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 1.3rem;
  font: inherit;
  font-weight: 700;
  color: white;
  background: linear-gradient(90deg, var(--belnet-blue), #1476cc);
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(11, 92, 171, 0.25);
}

button:hover {
  filter: brightness(1.05);
}

.error {
  margin-top: 0.7rem;
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid #f5b6c3;
  background: #fff0f4;
  color: #7f162d;
}

.cards {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  border: 1px solid #cfdced;
  border-radius: 12px;
  padding: 0.75rem;
  background: linear-gradient(160deg, #ffffff, #f6fbff);
}

.card h3 {
  color: var(--belnet-blue-deep);
}

.compliance-block {
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}

.entity {
  margin-bottom: 0.8rem;
  border-left: 4px solid;
  border-radius: 8px;
  padding: 0.55rem 0.7rem 0.7rem;
  background: #ffffff;
  border-top: 1px solid #e4edf7;
  border-right: 1px solid #e4edf7;
  border-bottom: 1px solid #e4edf7;
}

.entity.ok {
  border-color: var(--ok);
}

.entity.ko {
  border-color: var(--ko);
}

.entity header {
  font-weight: 700;
  word-break: break-word;
}

.status-pill {
  display: inline-block;
  margin: 0.45rem 0 0;
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-pill.ok {
  background: #e6f6ee;
  color: var(--ok);
}

.status-pill.ko {
  background: #fde9ed;
  color: var(--ko);
}

.entity ul {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
}

.wizard-box {
  margin-top: 1rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.8rem;
}

.wizard-box form {
  margin-top: 0.6rem;
  padding: 0.8rem;
  border: 1px solid #d6e1ed;
  border-radius: 10px;
  background: #f8fbff;
}

.wizard-box details {
  margin-top: 0.6rem;
}

.corrected-panel {
  margin-top: 1rem;
}

.entity-actions {
  margin-top: 0.7rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-fix,
.btn-download {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-fix {
  background: linear-gradient(90deg, var(--belnet-cyan), #2a9cc8);
  color: white;
  box-shadow: 0 4px 12px rgba(58, 174, 216, 0.25);
}

.btn-fix:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 16px rgba(58, 174, 216, 0.35);
}

.btn-download {
  background: linear-gradient(90deg, var(--belnet-accent), #ff9f2f);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 143, 31, 0.25);
}

.btn-download:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 16px rgba(255, 143, 31, 0.35);
}

.btn-view {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  background: linear-gradient(90deg, #6c6cdb, #8b5cf6);
  color: white;
  box-shadow: 0 4px 12px rgba(108, 108, 219, 0.25);
}

.btn-view:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 16px rgba(108, 108, 219, 0.35);
}

@media (min-width: 980px) {
  .layout {
    grid-template-columns: 390px 1fr;
    align-items: start;
  }

  .form-panel {
    position: sticky;
    top: 1rem;
  }
}

/* Modal styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  background: linear-gradient(90deg, var(--belnet-blue-deep), var(--belnet-blue));
  color: white;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: white;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.modal-body {
  padding: 20px;
}

.modal-body label {
  margin-top: 12px;
}

.modal-body fieldset {
  margin-top: 12px;
}

.modal-body details {
  margin-top: 12px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 20px;
  border-top: 1px solid #e0e0e0;
  background-color: #f8fbff;
  justify-content: flex-end;
  border-radius: 0 0 12px 12px;
}

.modal-footer button {
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.modal-footer .btn-submit {
  background: linear-gradient(90deg, var(--belnet-blue), #1476cc);
  color: white;
  box-shadow: 0 4px 12px rgba(11, 92, 171, 0.25);
}

.modal-footer .btn-submit:hover {
  filter: brightness(1.05);
}

.modal-footer .btn-cancel {
  background-color: #e0e0e0;
  color: #333;
}

.modal-footer .btn-cancel:hover {
  background-color: #d0d0d0;
}
