/* The hosted sign-in and passkeys pages. Shown inside the Windows ERP and the Excel
   add-in (a small WebView2 window) and in a browser for the ERP website. One file, no
   inline styles: the page's Content-Security-Policy allows none. */

:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --text: #1f1f1f;
    --muted: #5f6368;
    --line: #dadce0;
    --brand: #1a73e8;
    --brand-strong: #1557b0;
    --danger: #d93025;
    --ok: #188038;
    --radius: 8px;
    --font: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1720;
        --surface: #18222e;
        --text: #e8eaed;
        --muted: #9aa0a6;
        --line: #3c4043;
        --brand: #8ab4f8;
        --brand-strong: #aecbfa;
        --danger: #f28b82;
        --ok: #81c995;
    }
}

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

html, body { margin: 0; min-height: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    display: grid;
    place-items: start center;   /* the card sits at the top: the host window follows its height */
    padding: 24px 16px;
    -webkit-text-size-adjust: 100%;
}

.card {
    width: min(100%, 420px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 28px 24px;
}

.card--wide { width: min(100%, 560px); }

/* The host's help: a "?" at the top right of the card, shown only inside the ERP and the add-in. */
.card { position: relative; }
.help {
    position: absolute; top: 14px; right: 14px;
    width: 28px; height: 28px; padding: 0; border-radius: 50%;
    background: transparent; color: var(--muted); border: 1px solid var(--line);
    font-size: .9375rem; font-weight: 600; line-height: 1;
}
.help:hover { background: var(--bg); color: var(--text); }

h1 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 600; }

.sub { margin: 0 0 20px; color: var(--muted); font-size: .9375rem; }

p { margin: 0 0 16px; }

.status { min-height: 1.5em; }
.status--error { color: var(--danger); }
.status--ok { color: var(--ok); }

button {
    font: inherit;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    background: var(--brand);
    color: #fff;
}
button:hover { background: var(--brand-strong); }
button:disabled { opacity: .6; cursor: default; }
button.quiet { background: transparent; color: var(--brand); border-color: var(--line); }
button.quiet:hover { background: rgba(26, 115, 232, .08); }
button.danger { background: transparent; color: var(--danger); border-color: var(--line); }
button.danger:hover { background: rgba(217, 48, 37, .08); }
button.small { padding: 6px 12px; font-size: .875rem; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.list { list-style: none; margin: 0 0 18px; padding: 0; border-top: 1px solid var(--line); }
.list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list .name { flex: 1 1 160px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.list .meta { flex: 1 1 100%; color: var(--muted); font-size: .8125rem; }
.list .empty { color: var(--muted); justify-content: center; }

.add { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.add input {
    flex: 1 1 180px;
    font: inherit;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}
.add input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.hint { color: var(--muted); font-size: .8125rem; margin: 14px 0 0; }

/* The setup form (setup.html). */
.fields { display: grid; gap: 4px 12px; margin: 0; }
.fields label { font-size: .8125rem; font-weight: 600; color: var(--muted); margin-top: 10px; }
.fields input {
    font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--text); min-width: 0; width: 100%;
}
.fields input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.fields #code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.fields .status { margin: 12px 0 6px; }
.fields .actions { margin-top: 8px; align-items: center; }
.link { font-size: .9375rem; color: var(--brand); text-decoration: none; }
.link:hover { text-decoration: underline; }
.actions .link { margin-left: auto; }

[hidden] { display: none !important; }
