/* ============================================================
   Theme: myKaarma design tokens via CSS custom properties
   Load theme first so primary, secondary, buttons, inputs use vars
   https://static.mykaarma.com/res/mkblue/css/theme.css
   ============================================================ */
@import url('https://static.mykaarma.com/res/mkblue/css/theme.css');

/* ============================================================
   Green theme override — restores mykaarma green button colors
   ============================================================ */
:root {
    --btn-primary-bg: #28a745;
    --btn-primary-border: #28a745;
}

/* ============================================================
   Design token reference (from theme.css)
   - Primary / links: var(--primary-color), var(--clickable-text)
   - Buttons: var(--btn-primary-bg), var(--btn-primary-border)
   - Inputs: var(--input-field-border), var(--font-inactive)
   - Gray: var(--Gray-100) to var(--Gray-800), var(--tertiary-color)
   - Font: var(--font-default), var(--font-contrast)
   ============================================================ */

/* Remove number input spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ============================================================
   Page Layout
   ============================================================ */
#loginPage {
    min-height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Lato', sans-serif;
}

#loginPage::before {
    background-color: var(--bg-main, #fff);
    background: url(https://static.mykaarma.com/res/global/img/login/bg.jpg) no-repeat center center;
    background-size: auto;
    opacity: 0.1;
    content: "";
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    position: absolute;
    z-index: -1;
}

/* ============================================================
   Card Wrapper
   ============================================================ */
#loginWrapper {
    background-color: var(--bg-main, #fff);
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    padding: 16px 24px;
    border-radius: 8px;
    width: 90vw;
    max-width: 430px;
    -moz-box-shadow: 0 0 10px #666;
    -webkit-box-shadow: 0 0 10px #666;
    box-shadow: 0 0 10px #666;
    position: relative;
}

/* ============================================================
   Logo
   ============================================================ */
#applicationLogo {
    height: 29px;
    width: 29px;
    background: url("https://static.mykaarma.com/res/mkblue/img/mklogo-small.svg") no-repeat center center;
    background-size: contain;
    flex-shrink: 0;
}

/* ============================================================
   Headings & Text
   ============================================================ */
.signInText {
    text-align: center;
    font-family: 'Lato', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--font-default, #000);
    width: 100%;
    margin: 0;
}

.page-subtitle {
    text-align: center;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--font-default, #000);
    margin: 0;
}

.heading-subheading-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    align-items: center;
}

.heading-subheading-group .signInText,
.heading-subheading-group .page-subtitle {
    margin: 0;
}

/* ============================================================
   Form Inputs (shared)
   ============================================================ */
.form-input {
    width: 100%;
    height: 36px;
    padding: 0 7px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    color: var(--font-default, #000);
    background-color: var(--input-field-bg, #fff);
    border: 1px solid var(--input-field-border, #dadada);
    border-radius: 8px;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: var(--font-inactive, #b8b8b8);
}

.form-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(3, 119, 179, 0.2);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.form-input[readonly],
.form-input[disabled] {
    background-color: var(--Gray-100, #f5f5f5);
    color: var(--Gray-600, #666);
}

/* Legacy text box (username page) */
.txtBox {
    width: 100%;
    height: 36px;
    padding: 0 7px;
    padding-right: 30px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    color: var(--font-default, #000);
    background-color: var(--input-field-bg, #fff);
    border: 1px solid var(--input-field-border, #dadada);
    border-radius: 8px;
    box-sizing: border-box;
}

.txtBox::placeholder {
    color: var(--font-inactive, #b8b8b8);
}

.txtBox:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(3, 119, 179, 0.2);
}

/* Username form input */
#usernameForm input[type="text"] {
    width: 100%;
    height: 36px;
    margin: 0;
    padding: 0 7px;
    padding-right: 30px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    color: var(--font-default, #000);
    border: 1px solid var(--input-field-border, #dadada);
    border-radius: 8px;
}

/* Login form inputs */
#loginForm input {
    width: 100%;
    height: 36px;
    margin: 0;
    padding: 0 7px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    border: 1px solid var(--input-field-border, #dadada);
    border-radius: 8px;
}

#loginForm label {
    display: block;
    margin: 0;
    font-size: 14px;
    color: var(--Gray-800, #252B37);
}

/* ============================================================
   Checkboxes — Figma design system: Brand-600 fill + white check
   ============================================================ */
input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--Gray-300, #D5D7DA);
    border-radius: 4px;
    background-color: var(--bg-main, #fff);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

input[type="checkbox"]:checked {
    background-color: var(--Brand-600, #02679B);
    border-color: var(--Brand-600, #02679B);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

#usernameForm input[type="checkbox"] {
    width: 16px;
    height: 16px;
    padding: 0;
    flex-shrink: 0;
}

#loginForm input[type="checkbox"] {
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 0 8px 0 0;
    /* border: none; */
    border-radius: 4px;
}

#remember_username_label {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    margin: 0;
    font-size: 14px;
    color: var(--Gray-800, #252B37);
}

.checkbox-label {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
    color: var(--Gray-700, #414651);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

.checkbox-label-username {
    color: var(--general-content-default, #252b37);
    line-height: 20px;
}

.checkbox-label-username input[type="checkbox"] {
    border: 1px solid var(--general-content-clickable, #0377b3);
}

.checkbox-label-username input[type="checkbox"]:checked {
    background-color: var(--general-active-background, #e9f1f8);
    border-color: var(--general-content-clickable, #0377b3);
}

.checkbox-label-username input[type="checkbox"]:checked::after {
    border-color: var(--general-content-clickable, #0377b3);
}

/* ============================================================
   Remember/Reset Row (username page)
   ============================================================ */
#rememberMeAndResetPassword {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    margin-top: 6px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-figma-primary {
    width: 100%;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--btn-primary-bg);
    border: 1px solid var(--btn-primary-border);
    border-radius: 8px;
    color: var(--btn-primary-font);
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: background-color 0.2s;
}

.btn-figma-primary:hover {
    background-color: var(--btn-primary-bg-hover, #fff);
    border-color: var(--btn-primary-border-hover, #7BADD3);
    color: var(--btn-primary-font-hover, #7BADD3);
}

.btn-figma-primary:disabled {
    background-color: var(--btn-disabled-bg);
    border-color: var(--btn-disabled-border);
    cursor: not-allowed;
}

.btn-figma-primary:focus,
.btn-figma-primary:focus-visible {
    outline: none;
    box-shadow: none;
}

/* Legacy .btn override for full width */
.btn {
    width: 100%;
}

/* ============================================================
   Links
   ============================================================ */
.link-primary {
    color: var(--clickable-text, var(--primary-color));
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.link-primary:hover {
    color: var(--Brand-700, #025784);
}

/* ============================================================
   Clear Button (username input)
   ============================================================ */
.bClear {
    position: absolute;
    display: block;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    cursor: pointer;
    height: 15px;
    width: 20px;
    background: url(https://app.mykaarma.com/images/tbreset_x_transparent.png) no-repeat center center;
    background-size: contain;
}

/* ============================================================
   Password Wrapper
   ============================================================ */
.password-wrapper {
    position: relative;
}

.password-wrapper .toggle-password,
.password-wrapper #togglePassword {
    position: absolute;
    top: 50%;
    right: 8px;
    cursor: pointer;
    transform: translateY(-50%);
    color: var(--Gray-600, #666);
    font-size: 18px;
}

/* ============================================================
   Error Label
   ============================================================ */
.errorlabel {
    color: var(--btn-error-bg, #D92D20);
    margin-top: 8px;
    font-size: 14px;
    text-align: center;
}

.errorlabel:empty {
    display: none;
}

.errorlabel:not(:empty) {
    margin-top: 12px;
}

.errorlabel--hidden {
    display: none;
}

.errorlabel--center {
    text-align: center;
}

.error-text {
    color: var(--btn-error-bg, #D92D20);
}

/* ============================================================
   MFA Page - Try Another Way / Resend links
   ============================================================ */
.link-try-another-way {
    color: var(--clickable-text, var(--primary-color));
    font-size: 0.9rem;
    text-decoration: none !important;
}

.resend-otp-link {
    display: inline-block;
    color: var(--clickable-text, var(--primary-color));
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.resend-otp-link:hover {
    color: var(--Brand-700, #025784);
    text-decoration: underline;
}

.resend-otp-link.disabled {
    cursor: not-allowed;
    color: var(--Brand-300, #a7c8e2);
    text-decoration: none;
}

/* ============================================================
   Back Link (MFA pages)
   ============================================================ */
.mfa-back-link {
    display: flex;
    gap: 4px;
    align-items: center;
    color: var(--tertiary-color, #535862);
    text-decoration: none;
    font-size: 12px;
    align-self: flex-start;
    position: absolute;
    top: 23px;
    left: 24px;
}

.mfa-back-link:hover {
    color: var(--Gray-800, #333);
    text-decoration: none;
}

/* ============================================================
   Help Text (MFA pages)
   ============================================================ */
.help-text {
    text-align: center;
    font-size: 12px;
    font-style: italic;
    color: var(--Gray-500, #717680);
    margin: 0;
    line-height: 16px;
    letter-spacing: 0.02em;
}

.help-text a {
    color: var(--Brand-600, #0377b3);
    text-decoration: none;
    font-size: inherit;
    font-style: italic;
}

.help-text a:hover {
    text-decoration: underline;
}

/* ============================================================
   MFA (App) Layout
   ============================================================ */
#mfaForm {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
}

.mfa-code-field {
    width: 100%;
    margin: 0;
}

.mfa-remember {
    align-self: flex-start;
    margin: 0;
}

.mfa-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-top: -8px;
}

.mfa-try-another-way {
    white-space: nowrap;
    font-size: 14px;
}

.mfa-form--text .mfa-remember-row {
    margin-top: -4px;
    gap: 8px;
}

.mfa-form--text .resend-otp-link.disabled {
    color: var(--Brand-300, #a7c8e2);
}

/* ============================================================
   Footer
   ============================================================ */
.mkpay-notice {
    text-align: center;
    padding-top: 10px;
    font-family: 'Lato', sans-serif;
    font-size: 12pt;
    font-weight: bold;
}

.mkpay-notice a {
    color: var(--clickable-text, var(--primary-color));
    text-decoration: none;
    font-weight: bold;
}

/* ============================================================
   Login Form - Keep me signed in (password page)
   ============================================================ */
#loginForm .form-check-label {
    white-space: nowrap;
    margin-bottom: 0;
    font-size: 14px;
}

#loginForm .form-check {
    margin-bottom: 0;
}

/* ============================================================
   Form layout helpers
   ============================================================ */

.login-username-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.username-input-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* ============================================================
   Username page (loginusername.twig)
   ============================================================ */
#loginWrapper.login-wrapper-username {
    max-width: 430px;
    padding: 10px;
}

.username-page-inner {
    width: 100%;
    height: 100%;
}

.sign-in-header-username {
    text-align: center;
    font-family: Lato, sans-serif;
    font-size: 14pt;
    color: var(--font-default, #000);
    padding-bottom: 5px;
    border-bottom: 1px solid var(--Gray-400, #808080);
    margin-bottom: 10px;
}

.username-form-inner {
    padding: 0 24px;
}

.username-input-wrap {
    position: relative;
    margin-top: 20px;
}

.username-input-wrap .txtBox {
    padding-right: 30px;
    padding-left: 12px;
    text-align: left;
    border: 1px solid var(--input-field-border, #ccc);
    border-radius: 4px;
    font-size: 1rem;
}

#rememberMeAndResetPassword.remember-row-username {
    padding-top: 5pt;
}

#remember_username_label.remember-label-username {
    text-align: left;
    float: left;
    line-height: 1.5;
    margin: 0;
}

#remember_username_label.remember-label-username input {
    width: auto;
    margin-right: 6px;
}

.reset-password-link-username {
    text-align: right;
    float: right;
    color: var(--clickable-text, var(--primary-color));
}

.btn-next-wrap {
    margin-top: 10px;
}

.btn-next-wrap .btn-success {
    width: 100%;
    height: 40px;
}

.footer-mkpay-wrap {
    text-align: center;
    padding-top: 10px;
    font-family: Lato, sans-serif;
    font-size: 12pt;
    font-weight: bold;
}

.footer-mkpay-wrap a,
.footer-mkpay-link {
    color: var(--clickable-text, var(--primary-color));
    text-decoration: none;
    font-weight: bold;
}

.noscript-message {
    width: 22em;
    position: absolute;
    left: 50%;
    margin-left: -11em;
    color: red;
    background-color: white;
    border: 1px solid red;
    padding: 4px;
    font-family: sans-serif;
}

/* ============================================================
   Login user/pass page (loginuserpass.twig)
   ============================================================ */
.login-userpass-logo {
    margin-bottom: 24px;
}

.login-userpass-title {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.5rem;
    font-weight: 600;
}

.login-userpass-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
}

.login-userpass-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--Gray-600, #666);
}

.login-userpass-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--Gray-300, #ddd);
    border-radius: 4px;
    font-size: 1rem;
}

.login-userpass-input.readonly {
    background-color: var(--Gray-100, #f5f5f5);
    color: var(--Gray-600, #666);
}

.login-userpass-password-wrap {
    position: relative;
}

.login-userpass-password-wrap .login-userpass-input {
    padding-right: 48px;
}

.login-userpass-password-wrap .form-input {
    padding-right: 48px;
}

.toggle-password-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--Gray-600, #666);
    font-size: 1.2rem;
}

.reset-password-link {
    color: var(--clickable-text, var(--primary-color));
    font-size: 0.9rem;
}

.reset-password-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -8px;
}

.remember-reset-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: -8px;
}

.reset-password-row .reset-password-link {
    font-size: 14px;
    text-decoration: none;
}

.remember-reset-row .reset-password-link {
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.login-userpass-easy-login {
    margin: 0;
    white-space: nowrap;
}

.login-userpass-easy-login img {
    height: 20px;
    margin-left: 3px;
}

.btn-continue-userpass {
    width: 100%;
    height: 48px;
    background-color: var(--btn-primary-bg);
    border-color: var(--btn-primary-border);
    color: var(--btn-primary-font);
    font-size: 1rem;
    font-weight: 600;
}

/* ============================================================
   Custom footer (custom_footer.twig)
   ============================================================ */
#trmsAndPrivacyDiv {
    text-align: center;
    padding-top: 10px;
    font-family: Lato, sans-serif;
}

#trmsAndPrivacyDiv a {
    margin-right: 5px;
}

#trmsAndPrivacyDiv a + a {
    margin-left: 5px;
    margin-right: 0;
}

#copyrightDiv {
    text-align: center;
    font-family: Lato, sans-serif;
}

#foot .noscript-message {
    width: 22em;
    position: absolute;
    left: 50%;
    margin-left: -11em;
    color: red;
    background-color: white;
    border: 1px solid red;
    padding: 4px;
    font-family: sans-serif;
}
