/*
 * effiQuo: the API's own pages (#246): its sign-in, the tools page, the error pages. effiQuo's brand only, the app's
 * tokens (angular/src/styles/tokens.css): the sign-in panel's dark blue ground and its acid-green wordmark, one card in
 * the app's light or dark surface, after the system's setting.
 */

/*
 * Lexend, the app's font (angular/src/styles/fonts/lexend.css), self-hosted: SIL Open Font License 1.1
 * (../Fonts/Lexend/OFL.txt). One variable font, weights 300-700; the browser fetches a file only for text in its range.
 */
@font-face {
    font-family: 'Lexend';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../Fonts/Lexend/lexend-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Lexend';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../Fonts/Lexend/lexend-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --ap-ground: #0d2c33; /* --auth-panel, the same in both themes */
    --ap-ground-text: #b2d1e9; /* --auth-panel-muted-foreground */
    --ap-brand: #b5f700; /* --brand-acid-green: the wordmark */
    --ap-card: #ffffff;
    --ap-text: #0d2c33;
    --ap-muted: #59676f;
    --ap-border: #dee4e7;
    --ap-input: #818f96;
    --ap-soft: #f4f7f9;
    --ap-hover: #e3f1f8;
    --ap-primary: #0e4056;
    --ap-on-primary: #ffffff;
    --ap-ring: #0b77ba;
    --ap-danger-soft: #ffebea; /* --destructive-soft */
    --ap-danger-soft-text: #a92227; /* --destructive-soft-foreground */
    --ap-shadow: 0 4px 8px -2px rgb(4 16 20 / 0.25), 0 24px 48px -12px rgb(4 16 20 / 0.5);
    --ap-font: 'Lexend', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        --ap-ground-text: #a1b7c8;
        --ap-card: #0d191e;
        --ap-text: #eef3f5;
        --ap-muted: #99a9b0;
        --ap-border: #233035;
        --ap-input: #5d6c72;
        --ap-soft: #18252a;
        --ap-hover: #1a2f37;
        --ap-primary: #80c8ee;
        --ap-on-primary: #0d2c33;
        --ap-ring: #4ba6ec;
        --ap-danger-soft: #461c1c;
        --ap-danger-soft-text: #fea6a2;
        color-scheme: dark;
    }
}

:root[data-theme='dark'] {
    --ap-ground-text: #a1b7c8;
    --ap-card: #0d191e;
    --ap-text: #eef3f5;
    --ap-muted: #99a9b0;
    --ap-border: #233035;
    --ap-input: #5d6c72;
    --ap-soft: #18252a;
    --ap-hover: #1a2f37;
    --ap-primary: #80c8ee;
    --ap-on-primary: #0d2c33;
    --ap-ring: #4ba6ec;
    --ap-danger-soft: #461c1c;
    --ap-danger-soft-text: #fea6a2;
    color-scheme: dark;
}

.ap-page {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--ap-ground);
    color: var(--ap-text);
    font-family: var(--ap-font);
    font-size: 15px;
    line-height: 23px;
    -webkit-font-smoothing: antialiased;
    container-type: inline-size;
}

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

/* The wordmark, the card and the foot, centred in the window. */
.ap-main {
    margin-block: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding-block: 56px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.ap-brand {
    display: block;
    height: 32px;
    color: var(--ap-brand);
    border-radius: 6px;
}

.ap-brand svg {
    display: block;
    height: 100%;
    width: auto;
}

.ap-card {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 32px;
    border-radius: 16px;
    background: var(--ap-card);
    box-shadow: var(--ap-shadow);
}

.ap-card--wide {
    max-width: 460px;
}

.ap-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ap-eyebrow {
    margin: 0;
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ap-muted);
    font-variant-numeric: tabular-nums;
}

.ap-title {
    margin: 0;
    font-size: 24px;
    line-height: 32px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.ap-text {
    margin: 0;
    color: var(--ap-muted);
    overflow-wrap: anywhere;
}

.ap-text strong {
    color: var(--ap-text);
    font-weight: 500;
}

/* The sign-in form. */
.ap-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ap-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ap-label {
    font-size: 13px;
    line-height: 18px;
    font-weight: 500;
}

.ap-hint {
    font-weight: 400;
    color: var(--ap-muted);
}

.ap-input {
    height: 40px;
    width: 100%;
    padding: 0 12px;
    border: 1px solid var(--ap-input);
    border-radius: 8px;
    background: var(--ap-card);
    color: var(--ap-text);
    font: inherit;
}

.ap-input::placeholder {
    color: var(--ap-muted);
}

.ap-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.ap-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--ap-primary);
}

/* Buttons and links. */
.ap-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ap-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--ap-primary);
    color: var(--ap-on-primary);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.ap-button:hover {
    background: color-mix(in oklab, var(--ap-primary) 88%, var(--ap-text));
}

.ap-button--block {
    width: 100%;
    margin-top: 8px;
}

.ap-button--quiet {
    background: transparent;
    border-color: var(--ap-border);
    color: var(--ap-text);
}

.ap-button--quiet:hover {
    background: var(--ap-hover);
}

.ap-input:focus-visible,
.ap-button:focus-visible,
.ap-check input:focus-visible,
.ap-tool:focus-visible {
    outline: 2px solid var(--ap-ring);
    outline-offset: 2px;
}

.ap-brand:focus-visible {
    outline: 2px solid var(--ap-brand);
    outline-offset: 4px;
}

/* The tools page's list. */
.ap-tools {
    display: flex;
    flex-direction: column;
    margin: 0 -12px;
    padding: 0;
    list-style: none;
}

.ap-tool {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.ap-tool:hover {
    background: var(--ap-hover);
}

.ap-tool-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.ap-tool-name {
    font-weight: 600;
}

.ap-tool-text {
    font-size: 13px;
    line-height: 19px;
    color: var(--ap-muted);
}

.ap-tool-go {
    flex: none;
    width: 16px;
    height: 16px;
    color: var(--ap-muted);
}

.ap-who {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--ap-border);
    font-size: 13px;
    line-height: 19px;
    color: var(--ap-muted);
}

.ap-who strong {
    color: var(--ap-text);
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* An error's details: validation messages, a technical detail. */
.ap-box {
    margin: 0;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--ap-soft);
    font-size: 14px;
    line-height: 21px;
    overflow-wrap: anywhere;
}

.ap-box ul {
    margin: 0;
    padding-left: 18px;
}

/* A refusal on a form: a wrong password, a wrong code. */
.ap-alert {
    margin: 0;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--ap-danger-soft);
    color: var(--ap-danger-soft-text);
    font-size: 14px;
    line-height: 21px;
    overflow-wrap: anywhere;
}

.ap-foot {
    margin: 0;
    font-size: 13px;
    line-height: 18px;
    color: var(--ap-ground-text);
    font-variant-numeric: tabular-nums;
}

@container (max-width: 480px) {
    .ap-main {
        gap: 24px;
        padding-block: 32px;
    }

    .ap-brand {
        height: 26px;
    }

    .ap-card {
        padding: 24px 20px;
    }

    .ap-title {
        font-size: 22px;
        line-height: 28px;
    }
}
