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

:root {
    --bg:       #0b0f0e;
    --surface:  #121816;
    --border:   #223028;
    --accent:   #10b981;
    --accent-h: #34d399;
    --green:    #22c55e;
    --red:      #ef4444;
    --amber:    #f59e0b;
    --text:     #e5f2ec;
    --muted:    #7e9187;
    --radius:   12px;
    --shadow:   0 4px 32px rgba(0,0,0,.4);
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
}

a { color: var(--accent); }

/* ── Layout ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
    margin: auto;
}
.card-wide { max-width: 760px; }

.logo {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 2rem;
}
.logo svg { flex-shrink: 0; }
.logo-text { font-size: 1.35rem; font-weight: 700; letter-spacing: -.5px; }
.logo-text span { color: var(--accent); }

h1 { font-size: 1.1rem; font-weight: 600; margin-bottom: .35rem; }
h2 { font-size: 1rem; font-weight: 700; margin-bottom: .75rem; }
.subtitle { font-size: .875rem; color: var(--muted); margin-bottom: 2rem; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    color: var(--muted);
    text-decoration: none;
    margin-bottom: 1.25rem;
}
.back-link:hover { color: var(--text); }

/* ── Form ── */
.field { margin-bottom: 1.25rem; }
label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin-bottom: .5rem;
}

input[type=text],
input[type=email],
input[type=password],
input[type=search],
textarea,
select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: .95rem;
    padding: .75rem 1rem;
    transition: border-color .15s;
    outline: none;
    font-family: inherit;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 2.8rem; }
.pw-toggle {
    position: absolute;
    right: .9rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--muted); cursor: pointer;
    line-height: 1; padding: 0;
}
.pw-toggle:hover { color: var(--text); }

/* ── Search ── */
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap svg {
    position: absolute;
    left: .9rem; top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}
.search-wrap input[type=search] { padding-left: 2.6rem; }
.search-wrap input[type=search]::-webkit-search-cancel-button { cursor: pointer; }

.hint { font-size: .78rem; color: var(--muted); margin-top: .4rem; }

/* ── Button ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: var(--accent);
    color: #06120d;
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 700;
    padding: .8rem 1.5rem;
    cursor: pointer;
    transition: background .15s, transform .1s;
    width: 100%;
    text-decoration: none;
    text-align: center;
}
.btn:hover  { background: var(--accent-h); }
.btn:active { transform: scale(.98); }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-sm { font-size: .85rem; padding: .55rem 1rem; width: auto; }
.btn-row { display: flex; gap: .6rem; }

/* ── Alert ── */
.alert {
    border-radius: 8px;
    padding: .85rem 1rem;
    font-size: .875rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
}
.alert-error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.12);  border: 1px solid rgba(34,197,94,.3);  color: #86efac; }
.alert-info    { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3); color: #6ee7b7; }
.alert-warn    { background: rgba(245,158,11,.1);  border: 1px solid rgba(245,158,11,.3); color: #fcd34d; }

/* ── Key warning box ── */
.key-warning {
    background: rgba(245,158,11,.08);
    border: 1px solid rgba(245,158,11,.3);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: .85rem;
    color: #fcd34d;
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    line-height: 1.6;
}
.key-warning svg { flex-shrink: 0; margin-top: 2px; }

/* ── Secret reveal ── */
.secret-wrap {
    background: var(--bg);
    border: 1px solid var(--green);
    border-radius: 8px;
    padding: 1.2rem 1.25rem;
    margin: 1.25rem 0;
}
.secret-label {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--green); margin-bottom: .5rem;
}
.secret-value {
    font-family: 'Courier New', monospace;
    font-size: 1.05rem;
    word-break: break-all;
    user-select: all;
    color: var(--text);
}

/* ── Dashboard header ── */
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}
.dash-header .logo { margin-bottom: 0; }
.dash-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Entries table ── */
.entries { display: flex; flex-direction: column; gap: .75rem; }
.entry-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    flex-wrap: wrap;
}
.entry-main { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.entry-icon {
    position: relative;
    width: 34px; height: 34px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--muted);
}
.entry-icon img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    background: #fff;
}
.entry-info { min-width: 0; }
.entry-label { font-weight: 600; font-size: .95rem; margin-bottom: .2rem; }
.entry-user { font-size: .8rem; color: var(--muted); }
.entry-url {
    display: block;
    font-size: .76rem;
    color: var(--muted);
    text-decoration: none;
    margin-top: .1rem;
}
.entry-url:hover { color: var(--accent); text-decoration: underline; }
.entry-actions { display: flex; gap: .4rem; flex-shrink: 0; flex-wrap: wrap; }
.entry-actions a, .entry-actions button {
    font-size: .78rem;
    padding: .45rem .8rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}
.entry-actions a:hover, .entry-actions button:hover { color: var(--text); border-color: var(--accent); }

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--muted);
    font-size: .9rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* ── Badge ── */
.badge {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    padding: .3rem .65rem; border-radius: 999px;
    background: rgba(16,185,129,.15); color: var(--accent);
}

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Footer ── */
footer {
    margin-top: 2rem;
    font-size: .78rem;
    color: var(--muted);
    text-align: center;
}

/* Copied feedback */
.copied-feedback {
    font-size: .78rem; color: var(--green);
    display: none; align-items: center; gap: .3rem; margin-top: .5rem;
}
.copied-feedback.show { display: flex; }

/* ── Petits écrans (mobile) ── */
@media (max-width: 480px) {
    body { padding: 1rem; }
    .card { padding: 1.5rem; }
    .dash-actions { width: 100%; }
    .dash-actions .btn-sm { flex: 1; }
}
