@font-face {
    font-family: "SB Sans Display";
    src: url("../fonts/SBSansDisplay-Semibold.woff2") format("woff2"),
        url("../fonts/SBSansDisplay-Semibold.woff") format("woff");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "SB Sans Text";
    src: url("../fonts/SBSansText-Regular.woff2") format("woff2"),
        url("../fonts/SBSansText-Regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "SB Sans Text";
    src: url("../fonts/SBSansText-Medium.woff2") format("woff2"),
        url("../fonts/SBSansText-Medium.woff") format("woff");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

:root {
    --auth-bg: #f2f3f5;
    --auth-card-bg: #ffffff;
    --auth-card-border: #e2e6ed;
    --auth-title: rgba(0, 0, 0, 0.9);
    --auth-text: rgba(0, 0, 0, 0.75);
    --auth-muted: rgba(0, 0, 0, 0.62);
    --auth-input-border: #d8dce3;
    --auth-focus: #8bb8ff;
    --auth-submit: #15171b;
    --auth-submit-hover: #090b0e;
    --auth-link: #0b6bdb;
    --auth-info-bg: #f7f9fc;
    --auth-info-border: #e5eaf3;
    --auth-error: #dc2626;
}

html,
body,
body.login-pf {
    min-height: 100%;
    background: var(--auth-bg) !important;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "SB Sans Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--auth-title);
}

#kc-header {
    position: fixed;
    top: 24px;
    left: 28px;
    width: auto;
    margin: 0;
    z-index: 10;
}

#kc-header-wrapper {
    width: 174px;
    height: 40px;
    color: transparent;
    font-size: 0;
    line-height: 0;
    background: url("../img/logo.png") no-repeat left top / contain;
}

.login-pf-page {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 100vh;
    padding: 96px 16px 24px;
    background: var(--auth-bg) !important;
}

#kc-content,
#kc-content-wrapper,
#kc-form,
#kc-form-wrapper {
    width: 100%;
    max-width: 100%;
    background: transparent !important;
}

.card-pf {
    width: min(100%, 448px);
    margin: 0 auto;
    padding: 24px;
    border: 1px solid var(--auth-card-border);
    border-radius: 16px;
    background: var(--auth-card-bg);
    box-shadow: 0 8px 24px rgba(12, 18, 28, 0.08);
}

.login-pf-header {
    display: block;
    margin: 0 0 16px;
}

.login-pf-page:has(#gigab2b-first-login-form) .login-pf-header,
body[data-page-id="login-gigab2b-first-login"] .login-pf-header,
.login-pf-page:has(#kc-otp-login-form) .login-pf-header,
body[data-page-id="login-otp"] .login-pf-header {
    display: none;
}

#kc-page-title,
.gigab2b-inline-title {
    margin: 0;
    color: var(--auth-title);
    font-family: "SB Sans Display", "SB Sans Text", "Segoe UI", Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 28px;
    letter-spacing: -0.18px;
    text-align: left;
}

form,
#kc-form-login,
#kc-passwd-update-form,
#kc-update-profile-form,
#kc-otp-login-form,
#gigab2b-first-login-form,
.gigab2b-totp-layout,
#kc-totp-settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: transparent !important;
    border: 0;
    box-shadow: none;
}

.gigab2b-login-subtitle,
.gigab2b-modal-subtitle,
.gigab2b-update-password-subtitle,
.gigab2b-flow-text {
    margin: 0;
    color: var(--auth-muted);
    font-family: "SB Sans Text", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: -0.3px;
}

body[data-page-id="login-config-totp"] .gigab2b-modal-subtitle,
.login-pf-page:has(#kc-totp-settings-form) .gigab2b-modal-subtitle {
    color: var(--auth-title);
}

body[data-page-id="login-update-password"] .gigab2b-update-password-subtitle,
.login-pf-page:has(#kc-passwd-update-form) .gigab2b-update-password-subtitle {
    color: var(--auth-title);
}

body[data-page-id="login-otp"] .gigab2b-modal-subtitle,
.login-pf-page:has(#kc-otp-login-form) .gigab2b-modal-subtitle {
    color: var(--auth-title);
}

.form-group,
.pf-v5-c-form__group,
.pf-c-form__group {
    margin: 0;
}

label,
.control-label,
.pf-v5-c-form__label,
.pf-c-form__label,
.pf-v5-c-form__label-text,
.pf-c-form__label-text {
    color: var(--auth-title);
    font-family: "SB Sans Text", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400 !important;
    line-height: 20px;
    letter-spacing: -0.3px;
}

.gigab2b-required-mark {
    color: var(--auth-error);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
.pf-v5-c-form-control,
.pf-c-form-control {
    box-sizing: border-box;
    width: 100%;
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--auth-input-border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: none;
    color: var(--auth-title);
    font-family: "SB Sans Text", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: -0.3px;
}

input::placeholder {
    color: #8b919c;
    opacity: 1;
}

input:focus,
input:focus-visible,
.pf-v5-c-form-control:focus,
.pf-v5-c-form-control:focus-visible,
.pf-c-form-control:focus,
.pf-c-form-control:focus-visible {
    border-color: var(--auth-focus) !important;
    outline: 0 !important;
    box-shadow: 0 0 0 3px rgba(139, 184, 255, 0.35) !important;
}

input[aria-invalid="true"] {
    border-color: var(--auth-error) !important;
    background-image: none !important;
    box-shadow: none !important;
}

[id^="input-error-"],
#input-error,
.pf-v5-c-form__helper-text,
.pf-v5-c-helper-text__item-text,
.pf-c-form__helper-text,
.pf-c-helper-text__item-text {
    display: block;
    margin-top: 6px;
    color: var(--auth-error) !important;
    font-family: "SB Sans Text", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: -0.3px;
}

.pf-v5-c-helper-text__item-icon,
.pf-v5-c-form__helper-text-item-icon,
.pf-c-helper-text__item-icon,
.pf-c-form__helper-text-item-icon,
.kc-feedback-text::before {
    display: none !important;
    content: none !important;
}

.gigab2b-password-input-group {
    position: relative;
    display: block;
}

.gigab2b-password-input-group input {
    padding-right: 72px;
}

.gigab2b-password-input-group button[data-password-toggle] {
    position: absolute;
    top: 50%;
    right: 40px;
    z-index: 2;
    width: 16px;
    min-width: 16px;
    height: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0;
    transform: translateY(-50%);
    border: 0 !important;
    border-left: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: 0 !important;
}

.gigab2b-password-toggle,
.gigab2b-password-toggle:hover,
.gigab2b-password-toggle:focus,
.gigab2b-password-toggle:active {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.gigab2b-password-toggle::after {
    content: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

.gigab2b-eye-show,
.gigab2b-eye-hide {
    display: inline-block;
    width: 16px;
    height: 13px;
    font-size: 0;
    line-height: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 13px;
}

.gigab2b-eye-show {
    background-image: url("../img/icon-eye-show.svg");
}

.gigab2b-eye-hide {
    background-image: url("../img/icon-eye-hide.svg");
}

#kc-form-buttons {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    float: none;
}

#kc-form-buttons input[type="submit"],
#kc-form-buttons button[type="submit"],
#kc-login,
.gigab2b-primary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100%;
    height: 40px;
    min-height: 40px;
    margin: 0 !important;
    padding: 8px 12px;
    border: 1px solid var(--auth-submit);
    border-radius: 12px;
    background: var(--auth-submit);
    box-shadow: none;
    color: #ffffff;
    font-family: "SB Sans Text", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: -0.3px;
    text-align: center;
    text-decoration: none;
}

#kc-form-buttons input[type="submit"]:hover,
#kc-form-buttons button[type="submit"]:hover,
#kc-login:hover,
.gigab2b-primary-link:hover,
.gigab2b-primary-link:focus {
    border-color: var(--auth-submit-hover);
    background: var(--auth-submit-hover);
    color: #ffffff;
    text-decoration: none;
}

#kc-form-buttons button[type="submit"][name="cancel-aia"] {
    border-color: var(--auth-info-border);
    background: var(--auth-info-bg);
    color: #385ee0;
}

a {
    color: var(--auth-link);
}

a:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible {
    outline: 2px solid rgba(139, 184, 255, 0.55);
    outline-offset: 2px;
}

body #kc-username,
body #kc-attempted-username,
body #reset-login,
body .kc-username,
body .kc-username-wrapper,
body #kc-select-try-another-way-form {
    display: none !important;
}

body[data-page-id="login-update-password"] .alert-warning,
body[data-page-id="login-update-password"] .pf-v5-c-alert.pf-m-warning,
body[data-page-id="login-update-password"] .pf-c-alert.pf-m-warning,
.login-pf-page:has(#kc-passwd-update-form) .alert-warning,
.login-pf-page:has(#kc-passwd-update-form) .pf-v5-c-alert.pf-m-warning,
.login-pf-page:has(#kc-passwd-update-form) .pf-c-alert.pf-m-warning,
body[data-page-id="login-config-totp"] .alert-warning,
body[data-page-id="login-config-totp"] .pf-v5-c-alert.pf-m-warning,
body[data-page-id="login-config-totp"] .pf-c-alert.pf-m-warning {
    display: none !important;
}

.alert-error,
.pf-v5-c-alert.pf-m-danger,
.pf-c-alert.pf-m-danger {
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid rgba(220, 38, 38, 0.18);
    border-radius: 8px;
    background: rgba(220, 38, 38, 0.06);
    color: var(--auth-error);
}

body[data-page-id="login-login"] #kc-form-login {
    gap: 16px;
}

body[data-page-id="login-login"] .gigab2b-login-subtitle {
    margin-bottom: 8px;
}

body[data-page-id="login-login"] .login-pf-settings {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--auth-text);
    font-size: 14px;
    line-height: 20px;
}

body[data-page-id="login-login"] .checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

body[data-page-id="login-login"] #kc-registration,
body[data-page-id="login-login"] #kc-social-providers {
    margin-top: 16px;
    color: var(--auth-text);
    font-size: 14px;
    line-height: 20px;
    text-align: center;
}

body[data-page-id="login-login"] #kc-social-providers ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

body[data-page-id="login-login"] #kc-social-providers a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid var(--auth-info-border);
    border-radius: 10px;
    background: #fbfcff;
    text-decoration: none;
}

.gigab2b-name-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.gigab2b-name-field {
    min-width: 0;
}

.gigab2b-flow-info-card,
.gigab2b-password-requirements {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    border: 1px solid var(--auth-info-border);
    border-radius: 8px;
    background: var(--auth-info-bg);
}

.gigab2b-flow-info-title,
.gigab2b-password-requirements-title {
    margin: 0;
    color: var(--auth-muted);
    font-family: "SB Sans Text", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: -0.3px;
}

.gigab2b-flow-info-text,
.gigab2b-password-requirements-list {
    margin: 0;
    padding: 0;
    color: var(--auth-muted);
    font-family: "SB Sans Text", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: -0.3px;
    list-style: none;
}

body[data-page-id="login-config-totp"] .gigab2b-flow-info-title,
body[data-page-id="login-config-totp"] .gigab2b-flow-info-text,
.login-pf-page:has(#kc-totp-settings-form) .gigab2b-flow-info-title,
.login-pf-page:has(#kc-totp-settings-form) .gigab2b-flow-info-text {
    color: var(--auth-title);
}

.gigab2b-password-hint {
    margin: 4px 0 8px;
    max-width: 100%;
    color: var(--auth-muted);
    font-family: "SB Sans Text", "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 18px;
    letter-spacing: -0.2px;
    overflow-wrap: anywhere;
}

body[data-page-id="login-config-totp"] .card-pf,
.login-pf-page:has(#kc-totp-settings-form) .card-pf {
    width: min(100%, 448px);
}

.gigab2b-totp-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gigab2b-totp-panel-title {
    margin: 0;
    color: var(--auth-title) !important;
    font-family: "SB Sans Text", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: -0.3px;
}

.gigab2b-totp-qr-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    padding: 0;
    background: #ffffff;
}

.gigab2b-totp-qr-wrap img {
    display: block;
    width: 146px;
    height: 150px;
    max-width: 100%;
}

.gigab2b-totp-switch-link {
    margin: 2px 0 0;
    text-align: center;
}

.gigab2b-totp-switch-link a {
    display: inline;
    width: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--auth-link);
    font-family: "SB Sans Text", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: -0.3px;
    text-decoration: none;
}

.gigab2b-totp-secret-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #ffffff;
}

.gigab2b-totp-secret-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 76px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #ffffff;
}

.gigab2b-totp-secret-value {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    color: var(--auth-title);
    font-family: "SB Sans Text", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: 0.1em;
    text-align: center;
    text-transform: uppercase;
    word-break: normal;
}

.gigab2b-totp-secret-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    min-height: 20px;
}

.gigab2b-totp-secret-row + .gigab2b-totp-secret-row {
    margin-top: 6px;
}

.gigab2b-totp-secret-group {
    display: inline-block;
    min-width: 4ch;
}

.gigab2b-totp-code-group {
    margin: 0;
}

#kc-totp-settings-form {
    gap: 12px;
}

#kc-totp-settings-form #kc-form-buttons {
    margin-top: 2px;
}

.gigab2b-totp-code-input {
    text-align: left;
    font-variant-numeric: tabular-nums;
}

body[data-page-id="login-otp"] .card-pf,
.login-pf-page:has(#kc-otp-login-form) .card-pf {
    width: min(100%, 448px);
}

body[data-page-id="login-otp"] #kc-otp-login-form,
.login-pf-page:has(#kc-otp-login-form) #kc-otp-login-form {
    gap: 16px;
}

.gigab2b-otp-credentials {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gigab2b-otp-credential-option {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-text);
    font-size: 14px;
    line-height: 20px;
}

.gigab2b-otp-logout-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--auth-title);
    font-family: "SB Sans Text", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: -0.3px;
}

.gigab2b-otp-logout-option input[type="checkbox"] {
    width: 16px;
    min-width: 16px;
    height: 16px;
    min-height: 16px;
    margin: 0;
}

.gigab2b-otp-help {
    margin: 0;
    color: var(--auth-muted);
    font-family: "SB Sans Text", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: -0.3px;
}

body[data-page-id="login-update-password"] .gigab2b-password-requirements,
.login-pf-page:has(#kc-passwd-update-form) .gigab2b-password-requirements {
    margin: 0;
}

body[data-page-id="login-update-password"] .checkbox,
.login-pf-page:has(#kc-passwd-update-form) .checkbox {
    margin: 0;
    color: var(--auth-title);
    font-size: 14px;
    line-height: 20px;
}

body[data-page-id="login-update-password"] .checkbox label,
.login-pf-page:has(#kc-passwd-update-form) .checkbox label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-left: 0 !important;
}

body[data-page-id="login-update-password"] .checkbox input[type="checkbox"],
.login-pf-page:has(#kc-passwd-update-form) .checkbox input[type="checkbox"] {
    position: static !important;
    float: none !important;
    width: 16px;
    min-width: 16px;
    height: 16px;
    min-height: 16px;
    margin: 0 !important;
}

body[data-page-id="login-info"] #kc-info-message p,
.login-pf-page:has(#kc-info-message) #kc-info-message p {
    margin: 0;
}

@media (max-width: 640px) {
    #kc-header {
        top: 14px;
        left: 16px;
    }

    #kc-header-wrapper {
        width: 158px;
        height: 36px;
    }

    .login-pf-page {
        align-items: flex-start;
        padding: 112px 12px 24px;
    }

    .card-pf {
        width: min(100%, 448px);
        padding: 20px 16px;
    }

    .gigab2b-name-row {
        grid-template-columns: 1fr;
    }

    .gigab2b-totp-qr-wrap {
        min-height: 156px;
    }

    .gigab2b-totp-qr-wrap img {
        width: 132px;
        height: 136px;
    }
}
