/* ABOUTME: Styles of the sign-in screens: the BP Group logo, a hairline and one centred column with the form. */
/* ABOUTME: The logo parts are positioned for the opening in public/js/sign-in-intro.js; the password rules show a green tick or a red cross. */

:root {
    --green: #1f6f3f;
    --green-dark: #174f2e;
    --text: #1b1b1b;
    --muted: #5c5c5c;
    --border: #c8c8c8;
    --error: #b42318;
    --error-background: #fdecea;
    --status-background: #e8f3ec;
}

* {
    box-sizing: border-box;
}

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

body {
    background: #ffffff;
    color: var(--text);
    font-family: "Segoe UI", "Segoe UI Web (West European)", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

body {
    overflow-x: hidden;
}

/* A page inside the intranet's modal shows the modal's own background. */
body.framed {
    background: transparent;
}

.page {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%;
    padding: 12vh 16px 48px;
}

.lockup {
    width: min(300px, 70vw);
    margin-bottom: 24px;
}

.lockup svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

/* Every part turns and scales about the centre of the mark, in the logo's own units. */
.logo-part {
    transform-box: view-box;
    transform-origin: 396px 388px;
}

.rule {
    width: 100%;
    max-width: 360px;
    height: 1px;
    margin-bottom: 28px;
    background: #e2e4df;
}

.panel {
    width: 100%;
    max-width: 360px;
}

h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 600;
}

/* A form straight under the heading, with no introduction between them. */
h1 + form {
    margin-top: 24px;
}

.message {
    margin: 0 0 20px;
    padding: 10px 12px;
    border-left: 4px solid;
}

.message-error {
    border-color: var(--error);
    background: var(--error-background);
    color: var(--error);
}

.message-status {
    border-color: var(--green);
    background: var(--status-background);
    color: var(--green-dark);
}

.field {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 2px;
    font: inherit;
    color: inherit;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
    border-color: var(--green);
    outline: 2px solid var(--green);
    outline-offset: -1px;
}

.auth-pass {
    position: relative;
}

.auth-pass input {
    padding-right: 40px;
}

.auth-pass .auth-pass__eye {
    position: absolute;
    top: 50%;
    right: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-top: -18px;
    padding: 0;
    background: none;
    color: var(--muted);
}

.auth-pass .auth-pass__eye:hover {
    background: none;
    color: var(--green);
}

.auth-pass__eye svg {
    width: 20px;
    height: 20px;
}

.auth-pass__eye svg[hidden] {
    display: none;
}

.field-help {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.field-error {
    margin: 4px 0 0;
    color: var(--error);
    font-size: 14px;
}

.password-rules {
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
    font-size: 14px;
}

.password-rules li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.rule-icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rule-icon-met {
    display: none;
    color: var(--green);
}

.rule-icon-unmet {
    color: var(--error);
}

.password-rules li.is-met .rule-icon-met {
    display: block;
}

.password-rules li.is-met .rule-icon-unmet {
    display: none;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-weight: 400;
}

.checkbox input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--green);
}

button {
    width: 100%;
    padding: 10px 16px;
    border: 0;
    border-radius: 2px;
    background: var(--green);
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background: var(--green-dark);
}

button:disabled,
button:disabled:hover {
    background: var(--border);
    color: var(--muted);
    cursor: not-allowed;
}

button:focus-visible {
    outline: 2px solid var(--green-dark);
    outline-offset: 2px;
}

button.button-secondary {
    border: 1px solid var(--green);
    background: #ffffff;
    color: var(--green);
}

button.button-secondary:hover {
    background: var(--status-background);
    color: var(--green-dark);
}

.intro {
    margin: 0 0 20px;
}

.secondary-form {
    margin-top: 16px;
}

button.button-link {
    width: auto;
    padding: 0;
    background: none;
    color: var(--green);
    font-weight: 400;
    text-decoration: underline;
}

button.button-link:hover {
    background: none;
    color: var(--green-dark);
}

.hint {
    margin: 24px 0 0;
    color: var(--muted);
}

.hint a {
    color: var(--green);
}
