/* =============================================================================
   LÄK-BW login theme
   Sections:  Tokens · Fonts · Base · Layout · Components
   Conventions: use the --tokens below instead of hardcoding values; keep new
   rules in the matching section. See themes/bw/README.md.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Tokens
   ----------------------------------------------------------------------------- */
:root {
    /* Brand */
    --color-primary: #103941;
    --color-primary-hover: #0d4c59;
    --color-accent: #0076fe;

    /* Neutrals */
    --color-white: #fff;
    --color-greeting: rgb(90, 94, 104);
    --color-text-muted: #333;

    /* Safeguard note (credential-error warning) */
    --color-note-bg: #fff9db;
    --color-note-border: #f1c40f;

    /* OTP device cards */
    --color-card-border: #ddd;
    --color-card-border-hover: #809193;
    --color-card-bg-hover: #f8f8f8;

    /* Shape & type
       NOTE: two separate families on purpose — "Inter" (regular) and
       "Inter Semi-Bold". Merging them into one family with font-weight
       descriptors would render real semibold glyphs instead of today's
       synthesized bold, i.e. a visual change. */
    --radius: 4px;
    --font-family-base: "Inter", sans-serif;
    --font-family-heading: "Inter Semi-Bold", sans-serif;
}

/* -----------------------------------------------------------------------------
   Fonts
   ----------------------------------------------------------------------------- */
@font-face {
    font-family: "Inter";
    src: url(../fonts/Inter.woff) format("woff"), url(../fonts/Inter.woff2) format("woff2"), url(../fonts/Inter.ttf) format("truetype")
}

@font-face {
    font-family: "Inter Semi-Bold";
    src: url(../fonts/InterSemiBold.woff) format("woff"), url(../fonts/InterSemiBold.woff2) format("woff2"), url(../fonts/InterSemiBold.ttf) format("truetype")
}

/* -----------------------------------------------------------------------------
   Base
   ----------------------------------------------------------------------------- */
body {
    font-family: var(--font-family-base);
    font-size: 1rem;
    line-height: 1.5;
}

/* -----------------------------------------------------------------------------
   Layout
   ----------------------------------------------------------------------------- */
.login-pf body {
    background: unset;
}

.login-pf-header h1 {
    color: var(--color-primary);
    font-size: 2rem;
    line-height: 2.25rem;
    font-family: var(--font-family-heading);
    font-weight: 600;
}

.kc-logo-text {
    display: none;
}

#kc-header {
    padding-top: 2em;
    display: flex;
}

#kc-header-wrapper {
    background-image: url(../img/logo-laek-bw.webp);
    background-repeat: no-repeat;
    background-size: contain;
    height: 50px;
    width: 200px;
    margin: auto;
    overflow: hidden;
}

#kc-info-wrapper {
    background-color: var(--color-white);
}

.greeting {
    box-sizing: border-box;
    color: var(--color-greeting);
    display: block;
    font-weight: 400;
    letter-spacing: -0.6px;
    line-height: 36px;
    text-align: left;
}

/* Attempted username shown above the greeting on re-auth screens (e.g. OTP);
   spacing so the greeting below it isn't cramped. */
#kc-attempted-username {
    display: inline-block;
    margin-bottom: 12px;
}

.card-pf {
    border-top: none;
}

@media (max-width: 450px) {
    .login-pf-page .login-pf-header h1 {
        font-size: 12px;
    }

    .greeting {
        font-size: 14px;
    }
}

@media (min-width: 450px) and (max-width: 768px) {
    .login-pf-page .login-pf-header h1 {
        font-size: 16px;
    }

    .greeting {
        font-size: 18px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .card-pf {
        max-width: 500px;
        height: 750px;
        border-top: none;
    }

    .greeting {
        font-size: 22px;
    }
}

@media (min-width: 1024px) {
    .card-pf {
        max-width: 1000px;
        min-height: 750px;
        border-top: none;
        padding-left: 540px !important;
        background-size: 500px 750px;
        background-image: url(../img/desk.jpg);
        background-repeat: no-repeat;
        background-color: var(--color-white);
        background-position: left top;
    }

    .greeting {
        font-size: 22px;
    }
}

/* -----------------------------------------------------------------------------
   Components
   ----------------------------------------------------------------------------- */

/* Primary buttons (PatternFly) */
.pf-c-button {
    --pf-c-button--m-primary--BackgroundColor: var(--color-primary);
    --pf-c-button--m-primary--hover--BackgroundColor: var(--color-primary-hover);
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    vertical-align: middle;
    white-space: nowrap;
}

/* Footer */
.footer {
    padding-top: 2em;
    font-size: 12px;
}

/* OTP device selection cards */
.otp-device-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
}

.otp-device-item {
    position: relative;
    width: 100%;
}

.otp-device-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.otp-device-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border: 2px solid var(--color-card-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: var(--color-white);
    text-align: center;
    min-height: 120px;
    width: 100%;
    margin-bottom: 0;
}

.otp-device-card:hover {
    border-color: var(--color-card-border-hover);
    background-color: var(--color-card-bg-hover);
}

.otp-device-radio:checked + .otp-device-card {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px var(--color-accent);
}

.otp-device-icon {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 8px;
    display: block;
}

.otp-device-name {
    font-weight: 500;
    color: var(--color-text-muted);
    overflow-wrap: break-word;
    word-break: normal;
    font-size: 14px;
    line-height: 1.2;
}

/* OTP help: info/support label + button */
.otp-help-link {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 1em 0;
    text-align: left;
    /* Match the footer's size so the links look identical regardless of where
       they are rendered (footer on the OTP login page vs. inside #kc-content on
       the OTP enable / TOTP setup pages). */
    font-size: 12px;
}

/* Let the pre-text wrap across lines so the button can sit to its right. */
.otp-help-link strong {
    flex: 0 1 auto;
    min-width: 0;
}

.otp-help-link .otp-help-button {
    flex: 0 0 auto;
}

.otp-help-button,
.otp-help-button:link,
.otp-help-button:visited {
    display: inline-block;
    box-sizing: border-box;
    min-width: 170px;
    padding: 10px 18px;
    border: 2px solid var(--color-primary);
    border-radius: var(--radius);
    background-color: var(--color-white);
    text-align: center;
    /* !important: the base theme colours links blue via an ID-scoped selector
       (#kc-content a), which otherwise overrides these. */
    color: var(--color-primary) !important;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.otp-help-button:hover,
.otp-help-button:focus,
.otp-help-button:active {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: var(--color-white) !important;
    text-decoration: none;
}

/* Standard email options (standard-email.ftl) */
.email-options-container {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.email-option-group {
    margin-bottom: 1.5rem;
}

.email-option-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.email-option-radio {
    /* !important: overrides the base theme's radio margin. */
    margin-right: 16px !important;
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
}

.email-option-text {
    line-height: 1.5;
}

.email-suggested-value {
    color: var(--color-primary);
    font-weight: 600;
}

#standardEmailInputWrapper {
    margin-top: 0.5rem;
    display: none;
}

#standardEmailInputWrapper.visible {
    display: block;
}

.email-description-area {
    margin-top: 2rem;
}

.email-description-text {
    max-width: 100%;
    width: 100%;
    line-height: 1.5;
}

.form-actions {
    margin-top: 2rem;
}

.standard-email-input {
    margin-top: 1.5rem;
}

/* Footer: registration link + safeguard note (footer.ftl) */
.additional-info-link {
    margin: 1em 0;
    text-align: center;
}

#loginSafeguardNotes {
    margin: 1em 0;
    padding: 12px 16px;
    border: 2px solid var(--color-note-border);
    border-radius: 6px;
    background-color: var(--color-note-bg);
    color: var(--color-text-muted);
}

/* OTP enable prompt (otp-enable.ftl) */
.otp-enable-info {
    margin-top: 1rem;
    padding-left: 0;
}

.otp-enable-info-text {
    max-width: 100%;
    width: 100%;
}

.otp-enable-confirm {
    margin-top: 1.5rem;
}

.otp-help-links {
    margin-top: 2rem;
}
