/*
    A hand-written port of CandidateUI's account-view look, so that a user bounced here to sign in
    does not leave the product and come back to it.

    CandidateUI builds this from Bootstrap 4 + bootstrap-vue + SCSS. This project has no build
    pipeline on purpose (see the csproj comment on DisableTransitiveProjectReferences), so only the
    rules these three pages actually use are written out here - this is not a Bootstrap dependency,
    it is the subset, with the class names kept so the two are recognisably the same design.

    Source of truth for every value below, under Code/CandidateUI/src/style:
      morrisby/_variables.scss          tokens and the brand gradient
      theme.scss                        .apex-cover
      custom/views/_accountView.scss    the container / logo / card layout
      bootstrap-add-ons/components/_buttons.scss, _cards.scss

    Note CandidateUI's breakpoints are not Bootstrap's defaults: sm 768px, md 1024px, lg 1280px.
*/
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700&display=swap");

:root {
    --primary: #2078cb;
    --primary-dark: #1b64a8;
    --primary-lightest: #e9f2fa;      /* mix(white, $primary, 90%) - bg-primary-lightest */
    --night-sky: #003b61;
    --danger: #db3300;
    --danger-lightest: #fbebe6;       /* mix(white, $danger, 90%) - bg-danger-lightest */
    --success: #1e8667;
    --success-lightest: #e9f3f0;      /* mix(white, $success, 90%) */
    --text-muted: #4f6577;            /* night-sky lightened, kept >= 4.5:1 on primary-lightest */
    --link-hover: #d64000;            /* $warning; CandidateUI sets $link-hover-color to it */
    --morrisby-light-grey: #ebf1f5;
    --radius: 0.5rem;                 /* $morrisby-border-radius */
}

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

html {
    background-color: var(--morrisby-light-grey);
}

body {
    margin: 0;
    font-family: "Poppins", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--night-sky);
    -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: "Nunito", "Segoe UI", Arial, sans-serif;
    font-weight: 700;
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--primary);
}

a:hover,
a:focus {
    color: var(--link-hover);
}

/* ---- Page frame ------------------------------------------------------- */

.account-view-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 1rem 0;
    /* .morrisby-gradient-to-bottom-right: $sunrise, $sunset, $sunshine */
    background-image: linear-gradient(to bottom right, #f74f79, #ff7840, #ffae3b);
}

/*
    The animated layer. The SVG's three triangles counter-rotate and pulse with SMIL, which keeps
    running when the file is used as a CSS background - scripts would not, which is also why this is
    a background rather than an inline <svg>.
*/
.apex-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("../img/background-move.svg");
    background-repeat: no-repeat;
    background-size: cover;
}

/* Both stack above the absolutely positioned apex layer. */
.account-view-header,
.account-view-form {
    position: relative;
}

.account-view-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0.5rem;
    text-align: center;
}

.morrisby-logo {
    width: 100%;
    max-width: 14rem;
    height: auto;
}

.account-view-strapline {
    margin: 0.25rem 0 1rem;
    font-size: 1.75rem;               /* $h3-font-size */
    color: #fff;
}

.account-view-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 94%;
    padding: 1.5rem 1rem;
    background-color: #fff;
    border-radius: var(--radius);
}

.account-view-form h2 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
}

@media (min-width: 768px) {
    .morrisby-logo {
        width: 90%;
        max-width: 26rem;
    }

    .account-view-form {
        width: calc(100% - 2rem);
        max-width: 768px;
        padding: 2rem 3rem;
    }
}

@media (min-width: 1024px) {
    .account-view-container {
        padding: 2.4rem 0;
    }

    .account-view-form {
        width: 48rem;
    }
}

@media (min-width: 1280px) {
    .account-view-container {
        padding: 5rem 0;
    }
}

/* ---- Form ------------------------------------------------------------- */

/* The tinted inner card: b-card bg-variant primary-lightest / danger-lightest. */
.form-card {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background-color: var(--primary-lightest);
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: var(--radius);
}

.form-card.has-error {
    background-color: var(--danger-lightest);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: inline-block;
    margin-bottom: 0.5rem;
}

.form-control {
    display: block;
    width: 100%;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: var(--radius);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #7cb6e9;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(32, 120, 203, 0.25);
}

.form-check {
    display: flex;
    align-items: flex-start;
    margin-top: 1rem;
}

.form-check-input {
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
    margin: 0.25rem 0.5rem 0 0;
    accent-color: var(--primary);
}

.form-check-label {
    margin: 0;
}

/* Page-level message - the sign-in failure, the bad code. */
.form-error {
    margin: 0 0 1rem;
    color: var(--danger);
    font-weight: 600;                 /* $font-weight-bold */
}

/* Page-level confirmation - a reset email sent, a password changed. */
.form-notice {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background-color: var(--success-lightest);
    border-left: 4px solid var(--success);
    border-radius: var(--radius);
}

/* A field's help text - b-form-group's description. */
.form-hint {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

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

.account-list {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

/* The "-or-" between alternative ways in, as on CandidateUI's forgotten-password page. */
.account-separator {
    margin: -0.5rem 0 1rem;
    text-align: center;
    color: var(--text-muted);
}

/* Secondary navigation below a form - "Forgotten your password?", "Back to sign in". */
.account-links {
    margin-top: 1.5rem;
    text-align: center;
}

/* A form submit that reads as a link - "Lost your device?" has to POST, but isn't the page's main action. */
.btn-link {
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    color: var(--primary);
    text-decoration: underline;
    border: 0;
    border-radius: 0;
}

.btn-link:hover,
.btn-link:focus {
    color: var(--link-hover);
}

/* ---- Buttons ---------------------------------------------------------- */

.btn {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 1em;
    cursor: pointer;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
                border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    border-radius: 1em;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.account-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.account-actions .btn {
    min-width: 10rem;
}

/* ---- Accessibility ---------------------------------------------------- */

:focus-visible {
    outline: 2px solid var(--night-sky);
    outline-offset: 2px;
}

.account-view-header :focus-visible {
    outline-color: #fff;
}

/*
    The apex SVG animates with SMIL, which CSS cannot pause - so the whole decorative layer goes for
    anyone who has asked for less motion. The gradient underneath keeps the brand.
*/
@media (prefers-reduced-motion: reduce) {
    .apex-cover {
        display: none;
    }

    * {
        transition: none !important;
    }
}
