/* ─── Variables ─── */
:root {
  --bg:          #2b1e1a;
  --surface:     #35241f;
  --surface2:    #3d2e29;
  --surface3:    #4a3a34;
  --border:      #4a3a34;
  --border-lite: #5a4a44;
  --text:        #f3e9dc;
  --text-muted:  #c8b6a6;
  --text-dim:    #9a8a7a;
  --accent:      #d9b99b;
  --accent-dark: #c9a98b;
  --accent-deep: #8a7a6a;
  --green:       #a8c4a0;
  --red:         #d4a5a5;
  --yellow:      #e6d0a0;
  --cyan:        #a0c0c8;
  --radius:      2px;
  --shadow-bevel-in:  inset 1px 1px 0 hsla(0,0%,100%,.08), inset -1px -1px 0 rgba(0,0,0,.3);
  --shadow-bevel-out: 1px 1px 0 hsla(0,0%,100%,.06), 2px 2px 4px rgba(0,0,0,.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  /* Dot pattern like liam-lefebvre.fr */
  background-image: radial-gradient(circle at 1px 1px, rgba(217,185,155,.18) 1px, transparent 0);
  background-size: 24px 24px;
  color: var(--text);
  font-family: Verdana, Tahoma, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── TOPNAV ─── */
.topnav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px;
  background: linear-gradient(180deg, var(--surface3), var(--surface2));
  border-bottom: 2px solid var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted); text-decoration: none; font-size: 12px;
  padding: 4px 10px;
  background: linear-gradient(180deg, var(--surface3), var(--surface2) 40%, var(--bg));
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-bevel-in), 1px 1px 2px rgba(0,0,0,.3);
  transition: all .15s;
}
.back-btn:hover {
  color: var(--text);
  background: linear-gradient(180deg, var(--border-lite), var(--surface3) 40%, var(--surface2));
}
.back-btn:active { transform: translateY(1px); box-shadow: inset -1px -1px 0 hsla(0,0%,100%,.05), inset 1px 1px 0 rgba(0,0,0,.4); }
.topnav > span { color: var(--text-muted); font-size: 12px; font-weight: 700; text-shadow: 1px 1px 0 rgba(0,0,0,.4); }

/* ─── TOOL PAGE ─── */
.tool-page { max-width: 860px; margin: 0 auto; padding: 32px 20px 80px; }

.tool-header { text-align: center; margin-bottom: 32px; }
.tool-icon { font-size: 2.5rem; margin-bottom: 10px; display: block; }
.tool-header h1 {
  font-size: 1.6rem; font-weight: 700;
  color: var(--accent);
  text-shadow: 1px 1px 0 rgba(0,0,0,.5), 2px 2px 0 rgba(0,0,0,.2);
  margin-bottom: 8px;
}
.tool-desc { color: var(--text-muted); font-size: 12px; }
.tool-body { display: flex; flex-direction: column; gap: 16px; }

/* ─── CARD / PANEL ─── */
.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-bevel-in), 2px 2px 6px rgba(0,0,0,.35);
}
.card-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}

/* Frame style (Windows 95 panel) */
.frame {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-bevel-out);
}
.frame-header {
  background: linear-gradient(180deg, var(--surface3), var(--surface2));
  padding: 6px 12px;
  font-weight: 700; font-size: 12px;
  color: var(--text);
  text-shadow: 1px 1px 0 rgba(0,0,0,.4);
  border-bottom: 2px solid var(--border);
}

/* ─── FORM ELEMENTS ─── */
label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; font-weight: 700; }

input[type="text"], input[type="url"], input[type="number"], input[type="email"],
textarea, select {
  width: 100%;
  background: #241a16;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 8px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  box-shadow: inset 1px 1px 3px rgba(0,0,0,.4), inset -1px -1px 0 hsla(0,0%,100%,.03);
  outline: none;
  transition: border-color .15s;
}
input[type="text"]:focus, input[type="url"]:focus, input[type="number"]:focus,
textarea:focus, select:focus {
  border-color: var(--accent);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: .6; }
textarea { resize: vertical; min-height: 100px; }
select { cursor: pointer; }
select option { background: var(--surface2); }

.field { display: flex; flex-direction: column; gap: 4px; }
.field-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 130px; }

/* Range */
input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 4px;
  background: var(--surface3); border-radius: 0; outline: none;
  border: 1px solid var(--border); cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px;
  background: linear-gradient(180deg, var(--border-lite), var(--surface3));
  border: 2px solid var(--accent-deep);
  box-shadow: var(--shadow-bevel-in);
  cursor: pointer;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 14px;
  font-size: 12px; font-weight: 700; font-family: inherit;
  cursor: pointer; border-radius: var(--radius);
  transition: all .1s; text-decoration: none; white-space: nowrap;
  text-shadow: 1px 1px 0 rgba(0,0,0,.3);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(180deg, #e8c9ab, var(--accent) 50%, var(--accent-dark));
  border: 2px solid var(--accent-deep);
  color: #2b1e1a;
  text-shadow: none;
  box-shadow: var(--shadow-bevel-in), 1px 1px 2px rgba(0,0,0,.4);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #f0d5bb, #e8c9ab 50%, var(--accent));
}
.btn-primary:active {
  box-shadow: inset -1px -1px 0 hsla(0,0%,100%,.1), inset 1px 1px 0 rgba(0,0,0,.4);
}

.btn-secondary {
  background: linear-gradient(180deg, var(--surface3), var(--surface2) 40%, var(--bg));
  border: 2px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-bevel-in), 1px 1px 2px rgba(0,0,0,.3);
}
.btn-secondary:hover {
  background: linear-gradient(180deg, var(--border-lite), var(--surface3) 40%, var(--surface2));
}

.btn-danger {
  background: linear-gradient(180deg, #c4a5a5, var(--red) 50%, #b49595);
  border: 2px solid #8a6a6a;
  color: #2b1e1a;
  text-shadow: none;
  box-shadow: var(--shadow-bevel-in), 1px 1px 2px rgba(0,0,0,.4);
}

.btn-lg { padding: 10px 20px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ─── DROPZONE ─── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  background: #241a16;
  box-shadow: inset 1px 1px 3px rgba(0,0,0,.3);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  border-style: solid;
  background: rgba(217,185,155,.06);
}
.dropzone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.dropzone-icon { font-size: 2rem; margin-bottom: 10px; display: block; }
.dropzone-text { color: var(--text-muted); font-size: 12px; }
.dropzone-text strong { color: var(--text); }

/* ─── FILE LIST ─── */
.file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  background: #241a16; border: 2px solid var(--border);
  border-radius: var(--radius); padding: 6px 10px;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,.3);
}
.file-item-name { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { color: var(--text-dim); font-size: 11px; white-space: nowrap; }
.file-item-remove {
  background: none; border: none; color: var(--red); cursor: pointer;
  font-size: 1rem; padding: 2px 6px; border-radius: var(--radius);
  transition: background .15s;
}
.file-item-remove:hover { background: rgba(212,165,165,.15); }

/* ─── PROGRESS ─── */
.progress-wrap {
  background: #241a16; border: 2px solid var(--border);
  border-radius: var(--radius); height: 14px; overflow: hidden;
  box-shadow: inset 1px 1px 3px rgba(0,0,0,.5);
}
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent), #e8c9ab);
  transition: width .3s;
}

/* ─── ALERTS ─── */
.alert {
  padding: 8px 12px; border-radius: var(--radius);
  font-size: 12px; display: flex; align-items: flex-start; gap: 8px;
  border: 2px solid; font-weight: 700;
}
.alert-success { background: rgba(168,196,160,.1); border-color: #7a9a72; color: var(--green); }
.alert-error   { background: rgba(212,165,165,.1); border-color: #9a7272; color: var(--red); }
.alert-info    { background: rgba(160,192,200,.1); border-color: #7a9aaa; color: var(--cyan); }

/* ─── BADGE ─── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: var(--radius);
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  background: var(--surface2); border: 2px solid var(--border);
  color: var(--text-muted);
  box-shadow: 1px 1px 0 rgba(0,0,0,.3);
  text-shadow: 1px 1px 0 rgba(0,0,0,.2);
}
.badge-purple { background: rgba(217,185,155,.15); border-color: var(--accent-deep); color: var(--accent); }
.badge-cyan   { background: rgba(160,192,200,.1);  border-color: #7a9aaa; color: var(--cyan); }
.badge-green  { background: rgba(168,196,160,.1);  border-color: #7a9a72; color: var(--green); }

/* ─── COPY FIELD ─── */
.copy-field { display: flex; gap: 6px; align-items: stretch; }
.copy-field input { flex: 1; }
.copy-field .btn { flex-shrink: 0; }

/* ─── RESULT BOX ─── */
.result-box {
  background: #1a1210; border: 2px solid var(--border);
  border-radius: var(--radius); padding: 10px;
  font-family: 'Courier New', ui-monospace, monospace; font-size: 12px;
  white-space: pre-wrap; word-break: break-all; color: var(--text);
  box-shadow: inset 1px 1px 3px rgba(0,0,0,.5);
  min-height: 50px;
}

/* ─── TABLE ─── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th {
  text-align: left; padding: 6px 10px;
  color: var(--text-muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; font-weight: 700;
  background: linear-gradient(180deg, var(--surface3), var(--surface2));
  border-bottom: 2px solid var(--border);
  border-top: 2px solid var(--border);
}
td { padding: 7px 10px; border-bottom: 1px dashed var(--border); color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(217,185,155,.05); }

/* ─── MISC ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }

.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-small  { font-size: 11px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.flex        { display: flex; }
.flex-wrap   { flex-wrap: wrap; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full      { width: 100%; }

/* ─── FILE CARD (download page) ─── */
.file-card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center;
  box-shadow: var(--shadow-bevel-in), 2px 2px 6px rgba(0,0,0,.4);
}
.file-name { font-size: 1.1rem; font-weight: 700; word-break: break-all; color: var(--accent); text-shadow: 1px 1px 0 rgba(0,0,0,.3); }
.file-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }

/* ─── SPINNER ─── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--surface3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── TABS ─── */
.tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}
.tab-btn {
  padding: 6px 14px;
  background: linear-gradient(180deg, var(--surface2), var(--surface));
  border: 2px solid var(--border); border-bottom: none;
  cursor: pointer; color: var(--text-muted);
  font-size: 12px; font-weight: 700; font-family: inherit;
  margin-bottom: -2px;
  transition: all .1s;
}
.tab-btn:hover { background: linear-gradient(180deg, var(--surface3), var(--surface2)); color: var(--text); }
.tab-btn.active {
  background: var(--surface);
  color: var(--accent);
  border-bottom-color: var(--surface);
  text-shadow: 1px 1px 0 rgba(0,0,0,.3);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── SWATCH ─── */
.swatch {
  width: 40px; height: 40px; cursor: pointer;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-bevel-out);
  transition: transform .1s;
  flex-shrink: 0;
}
.swatch:hover { transform: scale(1.1); }
.swatch:active { transform: scale(.95); }

/* ─── DIFF ─── */
.diff-line { padding: 1px 8px; font-family: 'Courier New', monospace; font-size: 12px; }
.diff-add  { background: rgba(168,196,160,.15); color: var(--green); border-left: 3px solid var(--green); }
.diff-rem  { background: rgba(212,165,165,.15); color: var(--red);   border-left: 3px solid var(--red); }
.diff-eq   { color: var(--text-dim); }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track {
  background: var(--bg);
  border: 1px solid var(--border);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--text-muted), var(--border));
  border: 1px solid var(--border-lite);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--accent), var(--surface3)); }
::-webkit-scrollbar-corner { background: var(--bg); }

/* ─── SEPARATOR ─── */
hr { border: none; border-top: 2px dashed var(--border); margin: 12px 0; }

/* ─── CODE ─── */
code {
  font-family: 'Courier New', ui-monospace, monospace;
  background: #1a1210; border: 1px solid var(--border);
  padding: 1px 5px; font-size: 11px; color: var(--accent);
}

/* ─── Icônes Lucide (remplacent les emojis) ─── */
svg.lic {
  width: 1em; height: 1em;
  display: inline-block; vertical-align: -0.125em;
  flex-shrink: 0; stroke-width: 2;
}
i.lic { display: inline-block; width: 1em; height: 1em; } /* avant rendu */
