/*
 * Fortress's own pages (2FA code page, 2FA setup and manage, magic login
 * link, "too many attempts", Fortress's error pages) in the look of the new
 * login card (template-parts/auth/login-form.php, assets/css/auth-card.css).
 *
 * Fortress (Snicco, server-level via GridPane on soofos.com and soofos.nl;
 * not in this repo, not on the dev sites) renders these pages itself, outside
 * WordPress's theme: no wp_head(), no hooks. Its one way in is its
 * `theme_css_file` setting, loaded after its own Tailwind build (layout.css).
 * Set it in the site's Fortress config to this file's path:
 *   /wp-content/themes/soofos/assets/css/fortress.css
 * Markup checked against Fortress 1.0.0-beta.47 (src/Shared/.../views,
 * src/Auth/TOTP/.../views): the rules below restyle its utility classes.
 *
 * Tokens only (theme-root tokens.css). Fortress pages have no data-theme,
 * so they are always light.
 */

@import url("../../tokens.css");

/* Mulish, as in inc/performance.php (the page has no wp_head()). */
@font-face {
    font-family: "Mulish";
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url("../fonts/mulish-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;
}

@font-face {
    font-family: "Mulish";
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url("../fonts/mulish-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;
}

/* ---------- Quiet page: logo on top, the card in the middle ---------- */
body.custom {
    margin: 0;
    background: var(--canvas);
    color: var(--body);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

/* The logo, as on the login page (Fortress's header view is empty). */
body.custom::before {
    content: "";
    display: block;
    height: 56px;
    margin: 32px auto 0;
    background: url("../img/logo.svg") center / contain no-repeat;
}

body.custom > .container > .min-h-full {
    padding-top: 40px;
    padding-bottom: 80px;
}

/* ---------- Headings and text ---------- */
body.custom h1,
body.custom h2,
body.custom h3 {
    font-family: var(--font);
}

body.custom h2.text-3xl {
    margin-top: 0;
    color: var(--ink);
    font-size: 26px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: normal;
}

body.custom .text-gray-900,
body.custom .text-gray-800,
body.custom .text-gray-700 {
    color: var(--ink);
}

body.custom .text-gray-600,
body.custom .text-gray-500,
body.custom .text-gray-400 {
    color: var(--muted);
}

body.custom p {
    font-size: 16px;
    line-height: 1.5;
}

/* ---------- The card ---------- */
body.custom .bg-white {
    background-color: var(--white);
}

body.custom .shadow,
body.custom .shadow-sm.sm\:rounded-lg,
body.custom .sm\:rounded-lg.shadow {
    box-shadow: var(--shadow-float);
}

body.custom .bg-white.shadow {
    padding: 36px 40px;
    border-radius: var(--r-card-lg);
}

body.custom .sm\:max-w-md {
    max-width: 440px;
}

/* ---------- Fields ---------- */
body.custom label {
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

body.custom input[type="text"],
body.custom input[type="email"],
body.custom input[type="password"],
body.custom input[type="number"] {
    box-sizing: border-box;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--field-line);
    border-radius: var(--r-btn);
    background: var(--white);
    box-shadow: none;
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
}

body.custom input[type="text"]:hover,
body.custom input[type="email"]:hover,
body.custom input[type="password"]:hover,
body.custom input[type="number"]:hover {
    border-color: var(--muted);
}

body.custom input:focus {
    border-color: var(--deep-blue);
    outline: none;
    box-shadow: 0 0 0 1px var(--deep-blue), 0 0 0 4px var(--blue-fill);
}

/* The authentication code: big, even digits. */
body.custom #totp {
    font-size: 20px;
    font-variant-numeric: tabular-nums;
    letter-spacing: .2em;
}

/* ---------- Buttons ---------- */
/* Primary action: the red button with a white label of the login card (ADR-017). */
body.custom .bg-primary {
    min-height: 46px;
    align-items: center;
    border: 0;
    border-radius: var(--r-btn);
    background-color: var(--red);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--red) 24%, transparent);
    color: var(--on-navy);
    font-family: var(--font);
    font-size: 16px;
    font-weight: 800;
}

body.custom .bg-primary:hover,
body.custom .hover\:bg-primary-dark:hover {
    background-color: var(--red-hover);
}

body.custom .bg-primary:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
    box-shadow: none;
}

/* The padlock inside the button: no icons in buttons. */
body.custom button.bg-primary > span.absolute {
    display: none;
}

/* Secondary buttons (white with a border). */
body.custom button.border-gray-300,
body.custom a.border-gray-300 {
    min-height: 44px;
    border-color: var(--field-line);
    border-radius: var(--r-btn);
    color: var(--ink);
    font-weight: 700;
}

/* ---------- Links ---------- */
body.custom a.text-primary,
body.custom .text-primary,
body.custom a.font-medium {
    color: var(--deep-blue);
    font-weight: 700;
}

body.custom a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

body.custom a:focus-visible,
body.custom button:focus-visible {
    outline: 2px solid var(--deep-blue);
    outline-offset: 2px;
}

/* Text inside the primary colour (Fortress's icons and accents). */
body.custom .text-primary-light {
    color: var(--deep-blue);
}

/* ---------- Messages ---------- */
/* A wrong code: the error colour of the login card. */
body.custom .bg-red-50 {
    border-radius: var(--r-card-sm);
    background-color: var(--red-fill);
}

body.custom .text-red-800,
body.custom .text-red-700,
body.custom .text-red-400 {
    color: var(--error);
}

body.custom .bg-red-50 h3 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
}

/* Waits and warnings: amber, as in the login card's notices. */
body.custom .bg-yellow-50 {
    border-radius: var(--r-card-sm);
    background-color: var(--amber-fill);
}

body.custom .text-yellow-800,
body.custom .text-yellow-700,
body.custom .text-yellow-400 {
    color: var(--ink);
}

/* Done: green. */
body.custom .bg-green-50 {
    border-radius: var(--r-card-sm);
    background-color: var(--green-fill);
}

body.custom .text-green-800,
body.custom .text-green-700,
body.custom .text-green-400 {
    color: var(--green-ink);
}

/* ---------- Phone ---------- */
@media (max-width: 640px) {
    body.custom::before {
        height: 48px;
        margin-top: 20px;
    }

    body.custom > .container > .min-h-full {
        padding-top: 24px;
        padding-bottom: 48px;
    }

    body.custom .bg-white.shadow {
        padding: 26px 22px;
        border-radius: var(--r-card);
    }

    body.custom h2.text-3xl {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.custom * {
        transition: none !important;
    }
}
