/*
 * BuyCasts login theme. Matches the landing app (BuyCasts brand guide): a navy top bar with the
 * logo, the form on a light ground at the left, the brand panel at the right.
 * Environments can still override any color in /resources/auth/css/colors.css.
 */
:root {
    /* brand */
    --ground-cl: #FBFCFA;
    --panel-cl: #EFF3F6;
    --navy-cl: #26304A;
    --body-cl: #545E78;
    --match-teal-cl: #1F6C7B;
    --bright-teal-cl: #3FC1C9;
    --teal-tint-cl: #BFE3E6;
    --teal-pressed-cl: #14505C;
    --teal-label-cl: #12333A;
    --coral-cl: #F2845E;
    --coral-pressed-cl: #A8452C;
    --coral-tint-cl: #F7D9CF;
    --coral-label-cl: #3A1508;

    /* roles */
    --layout-bg-cl: var(--ground-cl);
    --header-bg-cl: var(--navy-cl);
    --text-cl: var(--navy-cl);
    --muted-text-cl: var(--body-cl);
    --stage-bg-cl: var(--panel-cl);
    --input-background-cl: var(--ground-cl);
    --input-border-cl: var(--body-cl);
    --input-focus-cl: var(--match-teal-cl);
    --input-focus-ring-cl: var(--teal-tint-cl);
    --link-cl: var(--match-teal-cl);
    /* buyer market accent (brand identity PDF, "Two markets": buyer is the coral set) */
    --button-cl: var(--coral-cl);
    --button-text-cl: var(--coral-label-cl);
    --button-pressed-cl: var(--coral-pressed-cl);
    --button-pressed-text-cl: var(--ground-cl);
    --validation-message-bg-cl: var(--coral-pressed-cl);
    --validation-message-text-cl: var(--ground-cl);
    --alert-error-bg-cl: var(--coral-tint-cl);
    --alert-info-bg-cl: var(--teal-tint-cl);
    --mark-buyer-cl: var(--coral-cl);
    --mark-match-cl: var(--navy-cl);
    --mark-seller-cl: var(--match-teal-cl);

    --border-radius: 8px;
    --input-height: 44px;

    --common-font-family: 'General Sans', sans-serif;
    --heading-font-family: 'Sentient', Georgia, serif;

    --normal-font-weight: 400;
    --medium-font-weight: 500;
    --bold-font-weight: 600;

    --title-font-size: clamp(32px, 3.4vw, 56px);
    --statement-font-size: clamp(24px, 2.4vw, 36px);
    --text-normal-font-size: 16px;
    --text-large-font-size: 18px;
    --text-small-font-size: 15px;
}

* {
    font-family: var(--common-font-family) !important;
}

body {
    font-size: var(--text-normal-font-size);
    color: var(--text-cl);
}

span.fa.fa-fw.fa-exclamation-triangle,
span.fa.fa-fw.fa-check-circle,
span.fa.fa-fw.fa-info-circle,
i.fa.fa-eye,
i.fa.fa-eye-slash,
i.fa,
span.fa,
[class^="pficon"],
[class*=" pficon"] {
    font-family: FontAwesome !important;
}

[class^="pficon"],
[class*=" pficon"] {
    font-family: pficon !important;
}

/* PatternFly paints the html element dark; it shows below a short body. */
html.login-pf,
.login-pf body {
    background: var(--layout-bg-cl);
}

/* ---------- Page frame ---------- */
.login-pf-page {
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-pf #kc-header {
    margin: 0;
    padding: 0 20px;
    height: 80px;
    display: flex;
    align-items: center;
    background: var(--header-bg-cl);
    opacity: 1;
}

.login-pf #kc-header-wrapper {
    padding: 0;
    height: auto;
    visibility: visible;
    line-height: 1;
}

.bcai-logo {
    display: block;
    width: 156px;
    height: 32px;
    background: url(../img/buycasts-horizontal-reversed.svg) left center / contain no-repeat;
}

.bcai-layout {
    flex: 1;
    width: 100%;
    max-width: 1392px;
    margin: 0 auto;
    padding: 24px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 24px;
}

/* ---------- The form ---------- */
.login-pf-page .card-pf {
    width: 100%;
    max-width: 560px;
    margin: 0;
    padding: 48px;
    justify-self: center;
    align-self: center;
    box-sizing: border-box;
    background: transparent;
    color: var(--text-cl);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: none;
}

.login-pf-page .login-pf-header {
    margin-bottom: 32px;
    text-align: left;
}

h1#kc-page-title {
    margin: 0;
    font-family: var(--heading-font-family) !important;
    font-size: var(--title-font-size);
    font-weight: var(--normal-font-weight);
    line-height: 1.05;
    letter-spacing: -0.02em;
    text-align: left;
    color: var(--text-cl);
}

#kc-content-wrapper {
    margin-top: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label.pf-c-form__label.pf-c-form__label-text,
.form-group label {
    display: block;
    margin: 0 0 6px;
    color: var(--muted-text-cl);
    font-size: var(--text-small-font-size);
    font-weight: var(--normal-font-weight);
    line-height: 24px;
}

.form-group input.pf-c-form-control {
    height: var(--input-height);
    padding: 0 14px;
    background: var(--input-background-cl);
    color: var(--text-cl);
    font-size: var(--text-normal-font-size);
    border: 1px solid var(--input-border-cl);
    border-radius: var(--border-radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input.pf-c-form-control:focus,
.form-group input.pf-c-form-control:focus-visible {
    outline: none;
    border: 1px solid var(--input-focus-cl);
    box-shadow: 0 0 0 3px var(--input-focus-ring-cl);
}

/* Browser autofill paints inputs light blue; keep the theme's field colors.
   The inset shadow covers the autofill background; the outer one is the focus ring. */
.form-group input.pf-c-form-control:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--input-background-cl) inset;
    -webkit-text-fill-color: var(--text-cl);
    caret-color: var(--text-cl);
}

.form-group input.pf-c-form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--input-background-cl) inset, 0 0 0 3px var(--input-focus-ring-cl);
}

.form-group .pf-c-input-group input.pf-c-form-control:-webkit-autofill,
.form-group .pf-c-input-group input.pf-c-form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--input-background-cl) inset;
}

.form-group input.pf-c-form-control[aria-invalid="true"] {
    border-color: var(--validation-message-bg-cl);
}

/* Password fields: the input and the eye button share one bordered box. */
.form-group .pf-c-input-group {
    background: var(--input-background-cl);
    border: 1px solid var(--input-border-cl);
    border-radius: var(--border-radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group .pf-c-input-group:focus-within {
    border-color: var(--input-focus-cl);
    box-shadow: 0 0 0 3px var(--input-focus-ring-cl);
}

.form-group .pf-c-input-group input.pf-c-form-control,
.form-group .pf-c-input-group input.pf-c-form-control:focus,
.form-group .pf-c-input-group input.pf-c-form-control:focus-visible {
    height: calc(var(--input-height) - 2px);
    border: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    background: transparent;
    box-shadow: none;
}

.form-group .pf-c-input-group button.pf-c-button.pf-m-control {
    margin-left: 0;
    padding: 0 14px;
    background: transparent;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    color: var(--muted-text-cl);
}

.pf-c-button.pf-m-control::after {
    border: none;
}

.pf-c-form__helper-text.pf-m-error {
    display: inline-block;
    margin-top: 8px;
    padding: 7px 12px;
    border-radius: var(--border-radius);
    background-color: var(--validation-message-bg-cl);
    color: var(--validation-message-text-cl);
    font-size: var(--text-small-font-size);
}

/* Remember me and Forgot password on one row. */
.login-pf-page .login-pf-settings {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -4px;
}

.login-pf-page .login-pf-settings div {
    align-self: center;
    margin: 0;
}

.checkbox label {
    color: var(--text-cl);
    font-size: var(--text-small-font-size);
}

.checkbox input[type=checkbox] {
    accent-color: var(--match-teal-cl);
    width: 16px;
    height: 16px;
    margin-top: 3px;
}

/* ---------- Links and buttons ---------- */
a,
.login-pf a {
    color: var(--link-cl);
    font-size: var(--text-small-font-size);
    font-weight: var(--medium-font-weight);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.login-pf a:hover,
.login-pf a:focus {
    color: var(--text-cl);
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input[type=submit]:focus-visible {
    outline: 2px solid var(--text-cl);
    outline-offset: 2px;
}

div#kc-form-buttons {
    margin-top: 28px;
}

.login-pf-page .pf-c-button.pf-m-primary,
.form-group input.pf-c-button.pf-m-primary.pf-m-block.btn-lg {
    height: 48px;
    background: var(--button-cl);
    color: var(--button-text-cl);
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--text-normal-font-size);
    font-weight: var(--bold-font-weight);
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.login-pf-page .pf-c-button.pf-m-primary:hover {
    opacity: 0.9;
}

.login-pf-page .pf-c-button.pf-m-primary:active {
    background: var(--button-pressed-cl);
    color: var(--button-pressed-text-cl);
    transform: translateY(1px);
}

.login-pf-page .pf-c-button.pf-m-primary::after {
    border: none;
}

.rfc-registration-link-wrapper {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: baseline;
}

.rfc-registration-link-title {
    color: var(--muted-text-cl);
    font-size: var(--text-small-font-size);
    line-height: 24px;
}

a.rfc-registration-link {
    line-height: 24px;
}

/* Page notes under the form (for example on Forgot password). */
.login-pf-page #kc-info,
.login-pf-page .login-pf-signup {
    margin-top: 24px;
    padding: 0;
    text-align: left;
    color: var(--muted-text-cl);
    font-size: var(--text-small-font-size);
    line-height: 1.5;
}

/* ---------- Messages ---------- */
.login-pf-page .pf-c-alert {
    margin-bottom: 24px;
    padding: 12px 16px;
    border: none;
    border-radius: var(--border-radius);
    background: var(--alert-info-bg-cl);
    color: var(--text-cl);
    box-shadow: none;
}

.login-pf-page .pf-c-alert::before {
    display: none;
}

.login-pf-page .pf-c-alert.pf-m-danger,
.login-pf-page .pf-c-alert.pf-m-warning {
    background: var(--alert-error-bg-cl);
}

.login-pf-page .pf-c-alert .pf-c-alert__icon,
.login-pf-page .pf-c-alert .pf-c-alert__title {
    color: var(--text-cl);
}

/* ---------- The brand panel ---------- */
.bcai-stage {
    padding: 56px;
    border-radius: var(--border-radius);
    background: var(--stage-bg-cl);
    color: var(--text-cl);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bcai-mark {
    width: auto;
    height: clamp(160px, 24vh, 260px);
    align-self: flex-start;
    margin-bottom: 48px;
}

.bcai-mark-buyer {
    fill: var(--mark-buyer-cl);
}

.bcai-mark-match {
    fill: var(--mark-match-cl);
}

.bcai-mark-seller {
    fill: var(--mark-seller-cl);
}

h2.bcai-stage-title {
    margin: 0;
    font-family: var(--heading-font-family) !important;
    font-size: var(--statement-font-size);
    font-weight: var(--normal-font-weight);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-cl);
}

.bcai-stage-text {
    margin: 20px 0 0;
    max-width: 30em;
    font-size: var(--text-large-font-size);
    line-height: 1.5;
}

div.rfc-trusted-by-clients {
    margin-top: 48px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 96px));
    align-items: center;
    gap: 24px 28px;
}

div.rfc-trusted-by-logo {
    width: 100%;
    height: 28px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
}

.rfc-trusted-by-logo.rfc-impact {
    background-image: url(../img/impact-logo.svg);
}

.rfc-trusted-by-logo.rfc-redeem {
    background-image: url(../img/redeem-logo.svg);
}

.rfc-trusted-by-logo.rfc-solid {
    background-image: url(../img/solid-logo.svg);
}

.rfc-trusted-by-logo.rfc-americas {
    background-image: url(../img/americas-logo.svg);
}

/* ---------- Tablet ---------- */
@media screen and (max-width: 1100px) {
    .bcai-layout {
        grid-template-columns: 1fr;
    }

    .bcai-mark {
        display: none;
    }
}

/* ---------- Phone ---------- */
@media screen and (max-width: 768px) {
    :root {
        --title-font-size: 9vw;
        --statement-font-size: 24px;
    }

    .bcai-layout {
        padding: 16px;
        gap: 16px;
    }

    .login-pf-page .card-pf {
        max-width: none;
        padding: 24px 4px;
    }

    .bcai-stage {
        padding: 32px 20px;
    }

    div.rfc-trusted-by-clients {
        grid-template-columns: repeat(2, minmax(0, 120px));
        gap: 20px 28px;
    }
}
