/* Roboto Font - Local Files */

/* roboto-100 - latin */
@font-face {
    font-display: swap;
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 100;
    src: url('../fonts/roboto-v30-latin-100.woff2') format('woff2');
}

/* roboto-100italic - latin */
@font-face {
    font-display: swap;
    font-family: 'Roboto';
    font-style: italic;
    font-weight: 100;
    src: url('../fonts/roboto-v30-latin-100italic.woff2') format('woff2');
}

/* roboto-300 - latin */
@font-face {
    font-display: swap;
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 300;
    src: url('../fonts/roboto-v30-latin-300.woff2') format('woff2');
}

/* roboto-regular - latin */
@font-face {
    font-display: swap;
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/roboto-v30-latin-regular.woff2') format('woff2');
}

/* roboto-italic - latin */
@font-face {
    font-display: swap;
    font-family: 'Roboto';
    font-style: italic;
    font-weight: 400;
    src: url('../fonts/roboto-v30-latin-italic.woff2') format('woff2');
}

/* roboto-500 - latin */
@font-face {
    font-display: swap;
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 500;
    src: url('../fonts/roboto-v30-latin-500.woff2') format('woff2');
}

/* roboto-700 - latin */
@font-face {
    font-display: swap;
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 700;
    src: url('../fonts/roboto-v30-latin-700.woff2') format('woff2');
}

/* roboto-900 - latin */
@font-face {
    font-display: swap;
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 900;
    src: url('../fonts/roboto-v30-latin-900.woff2') format('woff2');
}

/* Reset and base styles */
* {
    box-sizing: border-box;
}

html,
.login-page {
    height: 100%;
    margin: 0;
    padding: 0;
}

.login-subtitle {
    text-align: center;
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 30px;
    font-family: 'Roboto', sans-serif;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    padding-top: 100px; /* Add top padding to prevent overlap */
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Roboto', sans-serif;
    color: #333;
}

/* Add this to signin.css */
body::before {
    content: "";
    position: fixed;
    top: 80px;
    left: 80px;
    width: 300px;
    height: 120px;
    background-image: url("../img/IKNAIO-FULL-with-text.png");
    background-size: 300px auto;
    background-repeat: no-repeat;
    background-position: left top;
    z-index: -1;
}

/* Main login container */
.form-signin {
    width: 100%;
    max-width: 550px;
    padding: 40px;
    margin: auto;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    font-family: 'Roboto', sans-serif;
}

/* Hide default Keycloak header */
#kc-header {
    display: none;
}

/* Login card styling */
/* .login-card {
    margin: 0 auto;
    padding: 0;
    max-width: 100%;
    border: none;
    border-radius: 15px;
    box-shadow: none;
    background: transparent;
} */
/* 
Scoped Header with logo - specific to kc-header
#kc-header .login-header {
    margin-bottom: 30px;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    position: relative;
    padding-top: 20px;
    font-weight: bold;
    min-height: 60px;
    background-image: url("../img/IKNAIO-FULL-with-text.png");
    background-size: 150px auto;
    background-repeat: no-repeat;
    background-position: center top;
    padding-top: 80px;
}

/* Absolute positioned logo - scoped to kc-header */
/* #kc-header .login-logo {
    position: absolute;
    top: 40px;
    left: 40px;
    width: 150px;
    height: auto;
    z-index: 10;
} */ */

/* Generic login-header (for other areas) */
.login-header {
    /* margin-bottom: 30px; */
    text-align: center;
    font-family: 'Roboto', sans-serif;
    position: relative;
    font-weight: bold;
    /* padding-top: 20px; */
    min-height: 60px;
}

/* Add user icon to the form signin header */
.login-header::before {
    content: "";
    display: block;
    width: 60px;
    height: 60px;
    background-image: url("../img/user-icon.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0 auto 30px auto;
    border-radius: 50%;
    /* border: 3px solid rgb(40, 145, 221); */
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(40, 145, 221, 0.2);
    padding: 10px;
}

/* Form title */
.login-header h1,
.form-signin h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 10px;
    margin-top: 10px;
    text-align: center;
}

.login-header p,
.form-signin p {
    color: #7f8c8d;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
}

/* Form groups */
.form-floating {
    position: relative;
    margin-bottom: 20px;
}

/* Input fields */
.form-control,
input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    outline: none;
}

.form-control:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    border-color: rgb(40, 145, 221);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(40, 145, 221, 0.1);
}

/* Labels */
.form-label {
    color: #34495e;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
    font-family: 'Roboto', sans-serif;
}

/* Primary button styles */
.btn-primary,
.btn.btn-primary,
button.btn-primary,
input[type="submit"].btn-primary {
    width: 100%;
    padding: 5px 16px;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
    background-color: rgb(40, 145, 221) !important;
    background-image: none !important;
    border: none !important;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
    height: 30px;
    line-height: 20px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary:hover,
.btn.btn-primary:hover,
button.btn-primary:hover,
input[type="submit"].btn-primary:hover {
    background-color: rgb(20, 108, 181) !important;
    background-image: none !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(20, 108, 181, 0.3);
}

.btn-primary:active,
.btn-primary:focus,
.btn-primary.active,
.btn.btn-primary:active,
.btn.btn-primary:focus,
button.btn-primary:active,
button.btn-primary:focus {
    background-color: rgb(20, 108, 181) !important;
    background-image: none !important;
    transform: translateY(0);
    box-shadow: 0 0 0 3px rgba(20, 108, 181, 0.3);
}

/* Secondary button styles */
.btn-secondary,
.btn-link {
    width: 100%;
    padding: 5px 16px;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
    background: transparent !important;
    border: 2px solid #e1e8ed !important;
    border-radius: 8px;
    color: #7f8c8d !important;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
    height: 30px;
    line-height: 18px; /* Slightly less to account for border */
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-secondary:hover,
.btn-link:hover {
    border-color: rgb(40, 145, 221) !important;
    color: rgb(40, 145, 221) !important;
    background: rgba(40, 145, 221, 0.05) !important;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(40, 145, 221, 0.2);
}

.btn-secondary:active,
.btn-secondary:focus,
.btn-link:active,
.btn-link:focus {
    border-color: rgb(40, 145, 221) !important;
    color: rgb(40, 145, 221) !important;
    background: rgba(40, 145, 221, 0.1) !important;
    transform: translateY(0);
    box-shadow: 0 0 0 3px rgba(40, 145, 221, 0.3);
}

/* Checkbox styling */
.checkbox {
    margin: 20px 0;
}

.checkbox input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.checkbox label {
    color: #7f8c8d;
    font-size: 14px;
    cursor: pointer;
}

/* Links */
a {
    color: rgb(40, 145, 221);
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    transition: color 0.3s ease;
}

a:hover {
    color: rgb(20, 108, 181);
    text-decoration: underline;
}

/* Social/Identity Providers - Simple text links */
.social-providers-simple {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e1e8ed;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: #7f8c8d;
}

.social-providers-label {
    margin-right: 5px;
}

.social-provider-link {
    color: rgb(40, 145, 221);
    text-decoration: none;
    font-size: 13px;
}

.social-provider-link:hover {
    text-decoration: underline;
    color: rgb(20, 108, 181);
}

/* Passkey login button in login form - style like social providers */
#authenticateWebAuthnButton {
    display: block;
    color: rgb(40, 145, 221);
    text-decoration: none;
    font-size: 13px;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 10px auto 0 auto !important;
    box-shadow: none !important;
    height: auto !important;
    width: auto !important;
    font-weight: normal !important;
    text-align: center;
}

#authenticateWebAuthnButton:hover {
    text-decoration: underline;
    color: rgb(20, 108, 181);
    transform: none;
    box-shadow: none !important;
}

/* Passkey hidden forms in login page */
form#webauth,
form#authn_select {
    display: none;
}

/* Info messages */
.login-info {
    background-color: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
    font-family: 'Roboto', sans-serif;
    color: #34495e;
    font-size: 14px;
}

/* Alert messages */
.alert {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    width: 100%;
}

.pf-c-alert__icon {
    margin-right: 10px;
    font-size: 20px;
}

.alert-error {
    background-color: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Locale/Language dropdown */
.locale-section {
    display: none; /* Hide default locale section */
}

.locale-dropdown {
    background: transparent;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    padding: 8px 12px;
    color: #7f8c8d;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
}

/* Simple Language Selector */
.language-selector-simple {
    margin-top: 20px;
    text-align: center;
}

.language-select {
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    padding: 8px 12px;
    color: #7f8c8d;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    min-width: 140px;
}

.language-select:hover {
    border-color: rgb(40, 145, 221);
    color: rgb(40, 145, 221);
    background: #ffffff;
}

.language-select:focus {
    border-color: rgb(40, 145, 221);
    box-shadow: 0 0 0 3px rgba(40, 145, 221, 0.1);
}

/* Option styling */
.language-select option {
    padding: 8px 12px;
    color: #333;
    background: white;
}

/* Remove all the complex dropdown CSS */
.language-selector-bottom,
.kc-dropdown,
#kc-current-locale-link,
.kc-dropdown-list {
    display: none !important;
}

/* Form validation */
.has-error .form-control {
    border-color: #e74c3c;
}

.help-block {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    font-family: 'Roboto', sans-serif;
}

/* Remember me section */
.login-utilities {
    /* display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0; */
    font-size: 14px;
}

.login-utilities a {
    color: #7f8c8d;
    font-size: 14px;
}

/* Social login buttons (if used) */
.social-login {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e8ed;
}

.social-login h4 {
    text-align: center;
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 15px;
}

.social-btn {
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
    background: white;
    color: #333;
    text-align: center;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: #f8f9fa;
    border-color: rgb(40, 145, 221);
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid rgb(40, 145, 221);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Password visibility toggle buttons */
.pf-c-button.pf-m-control,
.pf-c-form-control__utilities button,
.password-visibility-toggle,
.btn-eye,
.input-group-addon button,
.form-control-feedback button {
    width: auto !important;
    min-width: 40px;
    height: 30px;
    padding: 5px 12px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 2px solid rgb(40, 145, 221) !important;
    border-radius: 8px;
    color: rgb(40, 145, 221) !important;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
    line-height: 20px;
    position: relative;
    outline: none;
}

.pf-c-button.pf-m-control:hover,
.pf-c-form-control__utilities button:hover,
.password-visibility-toggle:hover,
.btn-eye:hover,
.input-group-addon button:hover,
.form-control-feedback button:hover {
    background-color: rgba(40, 145, 221, 0.05) !important;
    background-image: none !important;
    border-color: rgb(20, 108, 181) !important;
    color: rgb(20, 108, 181) !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(20, 108, 181, 0.2);
}

.pf-c-button.pf-m-control:active,
.pf-c-button.pf-m-control:focus,
.pf-c-form-control__utilities button:active,
.pf-c-form-control__utilities button:focus,
.password-visibility-toggle:active,
.password-visibility-toggle:focus,
.btn-eye:active,
.btn-eye:focus,
.input-group-addon button:active,
.input-group-addon button:focus,
.form-control-feedback button:active,
.form-control-feedback button:focus {
    background-color: rgba(40, 145, 221, 0.1) !important;
    background-image: none !important;
    border-color: rgb(40, 145, 221) !important;
    color: rgb(40, 145, 221) !important;
    transform: translateY(0);
    box-shadow: 0 0 0 3px rgba(40, 145, 221, 0.3);
}

/* Eye icon styling if using FontAwesome or similar */
.pf-c-button.pf-m-control i,
.password-visibility-toggle i,
.btn-eye i {
    font-size: 16px;
    line-height: 1;
}

/* Responsive design */
/* Prevent the fixed logo from being hidden behind the centered form card.
   The form is max-width 550px centered, so its left edge = (vw - 550) / 2.
   Below ~1320px that edge crosses the original 300px/left:80px logo; we
   shrink and tuck the logo into the corner so it stays visible. */
@media (max-width: 1320px) {
    body::before {
        width: 150px;
        height: 60px;
        top: 20px;
        left: 20px;
        background-size: 150px auto;
    }
}

/* Below 900px the 550px form's left edge would start to cross even the
   shrunken logo, so switch to the full-width mobile layout here. The
   body's padding-top then separates the logo vertically from the form. */
@media (max-width: 900px) {
    body {
        padding: 10px;
        padding-top: 80px;
    }

    body::before {
        width: 120px;
        height: 48px;
        top: 15px;
        left: 15px;
        background-size: 120px auto;
    }

    .form-signin {
        padding: 30px 20px;
        max-width: 100%;
    }

    .form-signin::before {
        width: 60px;
        height: 60px;
    }

    #kc-header .login-header {
        background-size: 120px auto;
        padding-top: 60px;
    }

    .login-header h1 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 100px;
    }
    
    body::before {
        width: 100px;
        height: 40px;
        top: 10px;
        left: 10px;
        background-size: 100px auto;
    }
    
    .form-signin {
        padding: 20px 15px;
    }
    
    .form-signin::before {
        width: 50px;
        height: 50px;
    }
    
    #kc-header .login-header {
        background-size: 100px auto;
        padding-top: 50px;
    }
    
    .btn-primary {
        padding: 3px 16px; /* Reduced padding for mobile */
        font-size: 14px;
        height: 28px; /* Slightly smaller on mobile */
        line-height: 18px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .form-signin {
        background-color: #34495e;
        color: #ecf0f1;
    }
    
    .form-control {
        background-color: #2c3e50;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .form-label {
        color: #bdc3c7;
    }
    
    .login-info {
        background-color: #2c3e50;
        border-color: #4a5f7a;
        color: #bdc3c7;
    }
}

/* Logout Confirmation Page Styling */
#kc-logout-confirm {
    text-align: center;
    padding: 40px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.logout-icon {
    margin: 0 auto 30px;
    width: 80px;
    height: 80px;
    background-color: rgb(40, 145, 221);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logout-icon svg {
    width: 40px;
    height: 40px;
}

.logout-title {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    font-family: 'Roboto', sans-serif;
}

#kc-logout-confirm .instruction {
    font-size: 16px;
    color: #555;
    margin-bottom: 40px;
    line-height: 1.6;
    font-family: 'Roboto', sans-serif;
}

.logout-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 40px;
}

.logout-confirm-btn {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    min-width: 120px;
}

.logout-confirm-btn:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
}

.logout-cancel-btn {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
    text-decoration: none !important;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logout-cancel-btn:hover {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
    color: white !important;
}

.logout-footer {
    border-top: 1px solid #e1e8ed;
    padding-top: 20px;
    margin-top: 20px;
}

.logout-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

.logout-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.logout-link {
    color: rgb(40, 145, 221);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.logout-link:hover {
    text-decoration: underline;
}

.separator {
    color: #ccc;
    font-size: 14px;
}

/* Responsive design for logout page */
@media (max-width: 480px) {
    .logout-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .logout-buttons .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .logout-links {
        flex-direction: column;
        gap: 5px;
    }
    
    .separator {
        display: none;
    }
}

/* Language Selection Page Styling */
#kc-select-language {
    text-align: center;
    padding: 40px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.language-icon {
    margin: 0 auto 30px;
    width: 80px;
    height: 80px;
    background-color: rgb(40, 145, 221);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.language-icon svg {
    width: 40px;
    height: 40px;
}

.language-title {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    font-family: 'Roboto', sans-serif;
}

#kc-select-language .instruction {
    font-size: 16px;
    color: #555;
    margin-bottom: 40px;
    line-height: 1.6;
    font-family: 'Roboto', sans-serif;
}

.language-form {
    width: 100%;
}

.language-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.language-option {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fff;
}

.language-option:hover {
    border-color: rgb(40, 145, 221);
    background-color: #f8f9fa;
}

.language-option input[type="radio"]:checked + .language-content {
    color: rgb(40, 145, 221);
}

.language-option input[type="radio"]:checked {
    ~ .language-content {
        color: rgb(40, 145, 221);
    }
}

.language-option:has(input[type="radio"]:checked) {
    border-color: rgb(40, 145, 221);
    background-color: rgba(40, 145, 221, 0.05);
}

.language-radio {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    accent-color: rgb(40, 145, 221);
}

.language-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-grow: 1;
}

.language-label {
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 2px;
}

.language-code {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.language-submit {
    min-width: 120px;
}

/* Responsive design for language selection */
@media (max-width: 480px) {
    .language-options {
        gap: 10px;
    }
    
    .language-option {
        padding: 12px 15px;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .form-actions .btn {
        width: 100%;
        max-width: 200px;
    }
}

/* ============================================
   TOTP Configuration Page Styles
   ============================================ */

/* TOTP setup steps */
.totp-steps {
    padding-left: 20px;
    margin-bottom: 30px;
    counter-reset: step-counter;
    list-style: none;
}

.totp-steps > li {
    position: relative;
    padding-left: 40px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e8ed;
}

.totp-steps > li:last-child {
    border-bottom: none;
    margin-bottom: 15px;
}

.totp-steps > li::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background-color: rgb(40, 145, 221);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.totp-steps p {
    margin: 0 0 10px 0;
    color: #34495e;
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
}

/* Supported apps list */
.totp-apps-list {
    margin: 10px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.totp-apps-list li {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 5px;
}

/* QR Code container */
.totp-qr-container {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #e1e8ed;
}

.totp-qr-code {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Manual entry link */
.totp-manual-link {
    text-align: center;
    margin-top: 15px;
}

.totp-manual-link a,
#mode-barcode {
    color: rgb(40, 145, 221);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.totp-manual-link a:hover,
#mode-barcode:hover {
    color: rgb(20, 108, 181);
    text-decoration: underline;
}

/* Secret key display (manual mode) */
.totp-secret-key {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    border: 2px solid #e1e8ed;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    letter-spacing: 2px;
    word-break: break-all;
    text-align: center;
    color: #2c3e50;
    margin: 15px 0;
}

#kc-totp-secret-key {
    font-weight: 600;
    user-select: all;
}

/* TOTP configuration list (manual mode) */
.totp-config-list {
    background-color: #f8f9fa;
    padding: 15px 20px 15px 35px;
    border-radius: 8px;
    margin: 10px 0;
    list-style-type: disc;
}

.totp-config-list li {
    color: #7f8c8d;
    font-size: 13px;
    margin-bottom: 5px;
}

/* Device name hint */
.totp-device-name-hint {
    font-size: 13px;
    color: #95a5a6;
    font-style: italic;
}

/* TOTP form */
.totp-form {
    margin-top: 20px;
}

.totp-form .form-floating {
    margin-bottom: 20px;
}

/* Cancel button for TOTP */
.totp-cancel-btn {
    /* margin-top: 10px; */
    background-color: #95a5a6 !important;
}

.totp-cancel-btn:hover {
    background-color: #7f8c8d !important;
}

/* Input for OTP code - make it larger and centered for easier input */
#totp {
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
    font-family: 'Courier New', monospace;
}

#totp::placeholder {
    font-size: 14px;
    letter-spacing: normal;
}

/* Responsive TOTP styles */
@media (max-width: 480px) {
    .totp-steps > li {
        padding-left: 35px;
    }
    
    .totp-steps > li::before {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .totp-qr-code {
        max-width: 160px;
    }
    
    #totp {
        font-size: 20px;
        letter-spacing: 6px;
    }
}

/* ============================================
   OTP Login Page Styles
   ============================================ */

.otp-login-container {
    text-align: center;
}

/* OTP Icon */
.otp-icon-container {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.otp-icon {
    width: 80px;
    height: 80px;
    color: rgb(40, 145, 221);
}

/* OTP Instruction text */
.otp-instruction {
    color: #34495e;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 25px;
    text-align: center;
}

/* OTP Form */
.otp-form {
    margin-top: 20px;
}

.otp-form label {
    text-align: center;
    display: block;
    margin-bottom: 10px;
}

/* OTP Input field - large and centered */
.otp-input,
#otp {
    font-size: 28px !important;
    letter-spacing: 10px !important;
    text-align: center !important;
    font-family: 'Courier New', monospace !important;
    padding: 15px 20px !important;
    border: 2px solid #e1e8ed !important;
    border-radius: 12px !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
}

.otp-input:focus,
#otp:focus {
    border-color: rgb(40, 145, 221) !important;
    box-shadow: 0 0 0 3px rgba(40, 145, 221, 0.15) !important;
    outline: none !important;
}

.otp-input::placeholder,
#otp::placeholder {
    font-size: 14px !important;
    letter-spacing: normal !important;
    color: #95a5a6 !important;
}

/* OTP Help text */
.otp-help-text {
    margin-top: 25px;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
}

.otp-help-text p {
    margin: 0;
    font-size: 13px;
    color: #7f8c8d;
    text-align: left;
    line-height: 1.5;
}

/* Responsive OTP styles */
@media (max-width: 480px) {
    .otp-icon {
        width: 60px;
        height: 60px;
        padding: 14px;
    }
    
    .otp-input,
    #otp {
        font-size: 22px !important;
        letter-spacing: 6px !important;
        padding: 12px 15px !important;
    }
    
    .otp-instruction {
        font-size: 14px;
    }
}

/* ================================================
   Login Error Message Styling
   ================================================ */

/* Field-level error messages (inline validation) */
#input-error,
span[id="input-error"],
span[id^="input-error-"] {
    display: block;
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #c33;
    font-family: 'Roboto', sans-serif;
    text-align: center;
    line-height: 1.5;
}

/* Error icon before the message */
#input-error::before,
span[id="input-error"]::before,
span[id^="input-error-"]::before {
    /* content: "❗ "; */
    font-size: 16px;
}

/* ================================================
   Alert Box Styling (top-level messages)
   ================================================ */

/* Warning messages - must come BEFORE error styles for proper cascade */
.alert.alert-warning,
.alert.pf-m-warning,
.pf-c-alert.pf-m-warning {
    background-color: #fffbeb !important;
    border: 2px solid #f59e0b !important;
    border-radius: 8px;
    padding: 12px 16px;
    color: #b45309 !important;
    font-family: 'Roboto', sans-serif;
}

.alert.alert-warning ,
.alert.pf-m-warning ,
.pf-c-alert.pf-m-warning ,
.alert.alert-warning .pf-c-alert__title,
.alert.pf-m-warning .pf-c-alert__title,
.pf-c-alert.pf-m-warning .pf-c-alert__title {
    /* background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important; */
    color: #b45309 !important;
    font-weight: 500;
}

/* Error messages in alert boxes */
.alert.alert-error ,
.alert.pf-m-danger ,
.pf-c-alert.pf-m-danger  {
    /* background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important; */
    color: #c33 !important;
    font-weight: 500;
}

/* Info messages - blue style without nested red box */
.alert.alert-info,
.alert.pf-m-info,
.pf-c-alert.pf-m-info,
.alert-info.alert,
.alert-info.alert.pf-m-info,
div.alert-info,
div.alert.pf-m-info {
    background-color: #e0f2fe !important;
    border: 2px solid #0ea5e9 !important;
    border-radius: 8px;
    padding: 12px 16px;
    color: #0369a1 !important;
    font-family: 'Roboto', sans-serif;
}

.alert.alert-info ,
.alert.pf-m-info ,
.pf-c-alert.pf-m-info ,
.alert.alert-info .pf-c-alert__title,
.alert.pf-m-info .pf-c-alert__title,
.pf-c-alert.pf-m-info .pf-c-alert__title,
.alert-info.alert ,
.alert-info.alert .pf-c-alert__title,
.alert-info ,
.alert-info .pf-c-alert__title,
div.alert-info ,
div.alert-info .pf-c-alert__title,
div.alert.pf-m-info ,
div.alert.pf-m-info .pf-c-alert__title,
.pf-m-info .pf-c-alert__title,
.pf-m-info span.pf-c-alert__title,
.pf-m-info span {
    /* background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important; */
    color: #0369a1 !important;
    font-weight: 500;
}

/* ================================================
   Update Password Page Styling
   ================================================ */

.update-password-form {
    max-width: 400px;
    margin: 0 auto;
}

.password-field-group {
    margin-bottom: 24px;
}

.password-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-family: 'Roboto', sans-serif;
}

.password-input-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.password-input {
    width: 100%;
    padding: 12px 50px 12px 16px;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    background-color: #f8fafc;
    color: #1f2937;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.password-input:focus {
    border-color: rgb(40, 145, 221);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(40, 145, 221, 0.1);
}

.password-input::placeholder {
    color: #9ca3af;
}

.password-toggle-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.password-toggle-btn:hover {
    background-color: rgba(40, 145, 221, 0.1);
    color: rgb(40, 145, 221);
}

.password-toggle-btn:focus {
    outline: none;
    background-color: rgba(40, 145, 221, 0.15);
    color: rgb(40, 145, 221);
}

.password-toggle-btn .eye-icon {
    width: 20px;
    height: 20px;
}

.password-error {
    display: block;
    background-color: #fef2f2;
    border: 2px solid #ef4444;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #dc2626;
    font-family: 'Roboto', sans-serif;
    line-height: 1.4;
}

.password-error::before {
    content: "⚠ ";
}

/* Logout sessions checkbox */
.logout-sessions-group {
    margin-bottom: 24px;
    padding: 16px;
    background-color: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e1e8ed;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    accent-color: rgb(40, 145, 221);
    cursor: pointer;
}

.checkbox-text {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.4;
}

/* Submit buttons */
.password-form-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.password-submit-btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, rgb(40, 145, 221) 0%, rgb(20, 108, 181) 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
}

.password-submit-btn:hover {
    background: linear-gradient(135deg, rgb(20, 108, 181) 0%, rgb(10, 80, 140) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 145, 221, 0.35);
}

.password-submit-btn:active {
    transform: translateY(0);
}

.password-submit-btn-full {
    width: 100%;
}

.password-cancel-btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
    background: #ffffff;
    color: #6b7280;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.password-cancel-btn:hover {
    border-color: #9ca3af;
    color: #374151;
    background-color: #f9fafb;
}

/* Responsive update password styles */
@media (max-width: 480px) {
    .password-form-buttons {
        flex-direction: column;
    }
    
    .password-submit-btn,
    .password-cancel-btn {
        width: 100%;
    }
}

/* ================================================
   Terms and Conditions Page Styling
   ================================================ */

/* Terms text container - add spacing between text and form elements */
#kc-terms-text,
.kc-terms-text,
[id*="terms-text"] {
    margin-bottom: 24px;
    padding: 16px;
    background-color: #f8fafc;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
}

/* Checkbox wrapper for terms acceptance */
.pf-c-check,
.checkbox-wrapper,
.terms-acceptance {
    margin-top: 20px;
    margin-bottom: 24px;
}

/* Form actions spacing after terms */
#kc-form-buttons,
.kc-form-buttons {
    margin-top: 24px;
}

/* Terms page specific form group spacing */
.form-signin .pf-c-check,
.form-signin [class*="checkbox"] {
    margin-bottom: 24px;
}

/* Ensure proper spacing before submit button in terms page */
.form-signin form > div:last-of-type {
    margin-top: 16px;
}

/* ================================================
   WebAuthn Registration Page Styling
   ================================================ */

/* WebAuthn container */
.webauthn-register-container {
    padding: 10px 0;
}

/* Benefits section */
.webauthn-benefits {
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(40, 145, 221, 0.05) 0%, rgba(40, 145, 221, 0.1) 100%);
    border-radius: 12px;
    border: 1px solid rgba(40, 145, 221, 0.2);
}

.webauthn-description {
    color: #374151;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
    text-align: center;
}

.webauthn-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.webauthn-benefits-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.benefit-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.benefit-text {
    color: #4b5563;
    font-size: 14px;
    font-weight: 500;
}

/* WebAuthn action area */
.webauthn-action-area {
    margin: 24px 0;
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: stretch;
}

/* WebAuthn register button */
.webauthn-register-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    background: linear-gradient(135deg, rgb(40, 145, 221) 0%, rgb(20, 108, 181) 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    height: auto !important;
    line-height: 1.4 !important;
}

.webauthn-register-btn:hover {
    background: linear-gradient(135deg, rgb(20, 108, 181) 0%, rgb(10, 80, 140) 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 145, 221, 0.4);
}

.webauthn-register-btn:active {
    transform: translateY(0);
}

.webauthn-register-btn.disabled,
.webauthn-register-btn:disabled {
    background: #9ca3af !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.webauthn-register-btn .btn-icon {
    font-size: 22px;
}

/* WebAuthn cancel button */
.webauthn-cancel-form {
    flex: 1;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    max-width: none !important;
    width: auto !important;
}

.webauthn-cancel-btn {
    width: 100%;
    padding: 14px 24px !important;
    font-size: 16px !important;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
    background: #ffffff !important;
    color: #6b7280 !important;
    border: 2px solid #e1e8ed !important;
    border-radius: 10px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
}

.webauthn-cancel-btn:hover {
    border-color: #9ca3af !important;
    color: #374151 !important;
    background-color: #f9fafb !important;
}

/* WebAuthn help text */
.webauthn-help {
    margin-top: 20px;
    padding: 16px;
    background-color: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid rgb(40, 145, 221);
}

.webauthn-help p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

/* WebAuthn unsupported browser warning */
.webauthn-unsupported {
    margin-top: 20px;
}

.webauthn-unsupported .alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 10px;
}

.webauthn-unsupported .alert-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.webauthn-unsupported .alert p {
    margin: 0;
    color: #92400e;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}

/* Responsive WebAuthn styles */
@media (max-width: 480px) {
    .webauthn-action-area {
        flex-direction: column;
    }
    
    .webauthn-register-btn {
        padding: 14px 20px !important;
        font-size: 15px !important;
    }
    
    .webauthn-register-btn .btn-icon {
        font-size: 20px;
    }
}

/* WebAuthn nested form reset - prevent form-signin styles from applying */
.webauthn-register-container form#register {
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

.webauthn-register-container form#register .logout-sessions-group,
.webauthn-register-container .pf-c-check {
    margin: 0 0 16px 0 !important;
    padding: 12px 16px !important;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

.webauthn-register-container .checkbox-label,
.webauthn-register-container .pf-c-check__label {
    font-size: 14px;
    color: #4b5563;
}