/*
 * The developer portal's sign-in pages (BREAK-91): /portal/login, the emailed
 * link, adding the first passkey, recovery, recovery codes and invitations.
 * Everything after signing in is the Filament panel (PortalPanelProvider),
 * styled by Filament.
 *
 * A plain file, not a build output: the production image has no asset-build
 * stage. Colours and buttons are the public website's (public/css/site.css),
 * so signing in looks like the site it starts from.
 *
 * Every action is a real button - filled or outlined, never bare text - the
 * same rule the Android app holds itself to (docs/design-rules.md there).
 */

:root {
    color-scheme: light;

    /* Brand, as on the website. */
    --book: #0C60FC;
    --blue: #0052F2;
    --navy: #001A82;

    --ink: #111a33;
    --muted: #465170;
    --paper: #ffffff;
    --soft: #f2f5fd;
    --line: #d5dcee;

    --danger: #b3261e;
    --danger-bg: #fdecea;
    --note-bg: #eaf0ff;

    --radius: 14px;
    --focus: 3px solid #001A82;
}

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--soft);
}

:focus-visible { outline: var(--focus); outline-offset: 3px; border-radius: 6px; }

.bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem 0;
}

.logo-link { display: inline-flex; padding: 0.25rem; border-radius: 8px; }
.logo-link img { display: block; height: 48px; width: auto; }

.page {
    width: 100%;
    max-width: 30rem;
    margin: 1.5rem auto 2.5rem;
    padding-inline: 1rem;
    flex: 1 0 auto;
}

.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    box-shadow: 0 1px 2px rgb(0 26 130 / 0.06), 0 8px 24px rgb(0 26 130 / 0.06);
}

.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

h1 { margin: 0 0 1rem; font-size: 1.5rem; line-height: 1.25; color: var(--navy); }
h2 { margin: 0; font-size: 1.1rem; color: var(--navy); }
p { margin: 0 0 1rem; }

a { color: var(--blue); text-underline-offset: 0.15em; }
a:hover { color: var(--navy); }

.muted { color: var(--muted); }

.stack { display: grid; gap: 0.9rem; }

label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.95rem; }

input[type="email"],
input[type="text"] {
    font: inherit;
    font-weight: 400;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    width: 100%;
    background: var(--paper);
    color: var(--ink);
}

input:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 40%, transparent); outline-offset: 1px; border-color: var(--blue); }

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.actions form { margin: 0; }

/* -- Buttons: the website's ------------------------------------------------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.6rem 1.25rem;
    font: inherit;
    font-weight: 650;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    color: #ffffff;
    background: var(--blue);
    border: 2px solid var(--blue);
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.button:hover { background: var(--navy); border-color: var(--navy); color: #ffffff; }

.button.secondary { color: var(--blue); background: var(--paper); }
.button.secondary:hover { background: var(--soft); color: var(--navy); border-color: var(--navy); }

.button.wide { width: 100%; }

.button.danger { color: #ffffff; background: var(--danger); border-color: var(--danger); }

.button:disabled { opacity: 0.6; cursor: progress; }

.divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
    margin: 1.5rem 0;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--line);
}

.notice {
    padding: 0.75rem 0.95rem;
    border-radius: 10px;
    background: var(--note-bg);
    border: 1px solid #c4d3ff;
    color: var(--navy);
}

.notice.error {
    color: var(--danger);
    background: var(--danger-bg);
    border-color: #f3b8b3;
}

.codes {
    columns: 2;
    padding-left: 1.5rem;
    font-size: 1.05rem;
}

.codes code { letter-spacing: 0.06em; }

code { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }

[hidden] { display: none !important; }

/* -- Footer: plain links are allowed here ----------------------------------- */

.foot {
    padding: 1.25rem 1rem 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted);
}

.foot ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.25rem; list-style: none; margin: 0; padding: 0; }

@media (max-width: 420px) {
    .card { padding: 1.4rem 1.1rem; }
    .actions .button, .actions form, .actions form .button { width: 100%; }
    .codes { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
