:root {
    --bg: #0f1419;
    --card: #1a2332;
    --card-border: #2a3a4f;
    --text: #e1e8f0;
    --text-muted: #8a9bab;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --error: #ef4444;
    --input-bg: #0f1419;
    --input-border: #2a3a4f;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f3f5f8;
        --card: #ffffff;
        --card-border: #d8dee8;
        --text: #1a2332;
        --text-muted: #5a6878;
        --input-bg: #ffffff;
        --input-border: #c8d0db;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
}

.card {
    width: 100%;
    max-width: 440px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}

header { text-align: center; margin-bottom: 24px; }

h1 {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 700;
}

.subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

label {
    display: block;
    margin: 16px 0 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 11px 14px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.15s;
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.input-group {
    display: flex;
    align-items: stretch;
}
.input-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .suffix {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: var(--card-border);
    border: 1px solid var(--input-border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

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

button {
    width: 100%;
    margin-top: 24px;
    padding: 12px 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
button:hover { background: var(--accent-hover); }
button:active { transform: translateY(1px); }

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.alert-success {
    background: rgba(16,185,129,0.12);
    border: 1px solid var(--success);
    color: var(--success);
}
.alert-error {
    background: rgba(239,68,68,0.12);
    border: 1px solid var(--error);
    color: var(--error);
}

footer {
    margin-top: 28px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}
footer p { margin: 0; }

/* === Section tuto (dépliable) === */
.tuto {
    margin-top: 24px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0,0,0,0.03);
}
@media (prefers-color-scheme: dark) {
    .tuto { background: rgba(255,255,255,0.03); }
}
.tuto > summary {
    padding: 14px 18px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    list-style: none;
    user-select: none;
    transition: background 0.15s;
}
.tuto > summary::-webkit-details-marker { display: none; }
.tuto > summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 10px;
    transition: transform 0.2s;
    color: var(--accent);
}
.tuto[open] > summary::before {
    transform: rotate(90deg);
}
.tuto > summary:hover {
    background: rgba(0,0,0,0.05);
}

.tuto-content {
    padding: 4px 18px 20px;
    font-size: 0.9rem;
    line-height: 1.6;
}
.tuto-content h3 {
    margin: 18px 0 8px;
    font-size: 1rem;
    font-weight: 600;
}
.tuto-content p {
    margin: 6px 0;
    color: var(--text-muted);
}
.tuto-content ol,
.tuto-content ul {
    margin: 8px 0;
    padding-left: 24px;
}
.tuto-content li {
    margin: 4px 0;
    color: var(--text);
}
.tuto-content li.indent {
    list-style: none;
    margin-left: 8px;
}
.tuto-content code {
    background: var(--card-border);
    padding: 2px 7px;
    border-radius: 4px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.85em;
    color: var(--text);
    word-break: break-all;
}
.tuto-content a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
}
.tuto-content a:hover {
    text-decoration: underline;
}

/* === Onglets de navigation === */
.tabs {
    display: flex;
    gap: 4px;
    margin: 0 -4px 22px;
    padding: 0 4px;
    border-bottom: 1px solid var(--card-border);
}
.tab {
    flex: 1;
    padding: 11px 10px;
    text-align: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    border-radius: 0;
}
.tab:hover { color: var(--text); }
.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* === Honeypot (cache aux humains, visible aux bots) === */
.honeypot {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}
@media (max-width: 480px) {
    .honeypot { display: none; }
}

/* === Quota info === */
.quota-info {
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 8px;
    padding: 10px 14px;
    margin: 0 0 18px;
    font-size: 0.85rem;
    color: var(--text);
}
.quota-full {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-style: italic;
}
