/* Keycloak Custom Theme Styles */

/* Base body styling */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    margin: 0;
    padding: 0;
    background-color: white;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Background wrapper overrides */
.login-pf,
.login-pf body {
    background: white !important;
}

/* Center the login container */
#kc-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Avatar styling - positioned above login box */
.kc-logo {
    text-align: center;
    margin-bottom: -70px;
    z-index: 10;
    position: relative;
}

.kc-logo img {
    width: 190px;
    max-width: 190px;
    height: auto;
    object-fit: cover;
}

/* Remove default card styling */
.card-pf {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none !important;
    border-radius: 0;
}

/* Main login box styling */
#kc-content {
    background: white;
    border-radius: 5px;

    border: 2px solid #c1c1c1;
    padding: 40px 80px;
    width: 500px;
    max-width: 650px;
    min-width: 400px;
    margin: 0 auto;
}

/* Inner content wrapper - transparent */
#kc-content-wrapper {
    background: transparent;
    border: none;

    padding: 0;
    margin: 0;
    max-width: none;
}

/* Form styling */
#kc-form {
    margin: 0;
}

#kc-form-login {
    margin-bottom: 20px;
}

/* Input field styling */
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.pf-c-form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.pf-c-form-control:focus {
    outline: none;
    border-color: #007bff;

}

/* Password input group - input + show/hide toggle side by side */
.pf-c-input-group {
    display: flex !important;
    margin-bottom: 15px;
}

.pf-c-input-group .pf-c-form-control {
    border-radius: 4px 0 0 4px !important;
    margin-bottom: 0 !important;
    flex: 1;
}

.pf-c-input-group .pf-c-button.pf-m-control {
    padding: 12px !important;
    border: 1px solid #ddd !important;
    border-left: none !important;
    border-radius: 0 4px 4px 0 !important;
    background-color: #f8f9fa !important;
    font-size: 14px !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    width: auto !important;
    --pf-c-button--PaddingTop: 12px;
    --pf-c-button--PaddingRight: 12px;
    --pf-c-button--PaddingBottom: 12px;
    --pf-c-button--PaddingLeft: 12px;
}

/* Primary button styling */
#kc-login,
.btn-primary,
.pf-c-button.pf-m-primary {
    background-color: #007bff;
    border: none;
    color: white;
    padding: 12px 24px;
    font-size: 14px;
    font-family: inherit;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

#kc-login:hover,
.btn-primary:hover,
.pf-c-button.pf-m-primary:hover {
    background-color: #0056b3;
}

/* Secondary buttons */
.btn-default,
.pf-c-button.pf-m-secondary {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    color: #333;
    padding: 12px 24px;
    font-size: 14px;
    font-family: inherit;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.btn-default:hover,
.pf-c-button.pf-m-secondary:hover {
    background-color: #e9ecef;
}

/* Labels */
.control-label,
.pf-c-form__label-text {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
    display: block;
}

/* Header/Title styling */
#kc-page-title,
.login-pf .container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-weight: 400;
}

/* Links styling */
#kc-content a {
    color: #007bff;
    text-decoration: none;
    transition: text-decoration 0.2s ease;
}

#kc-content a:hover {
    text-decoration: underline;
}

/* Alert messages */
.alert-error,
.pf-c-alert.pf-m-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success,
.pf-c-alert.pf-m-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-info,
.pf-c-alert.pf-m-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Social Provider Styling */
#kc-social-providers {
    margin-top: 30px;
}

/* Separator styling */
.separator {
    border: 0;
    height: 1px;
    background: #e0e0e0;
    margin: 30px 0 20px 0;
    position: relative;
}

.or-text {
    text-align: center;
    color: #666;
    font-weight: normal;
    font-size: 14px;
    margin: -35px auto 20px auto;
    background: white;
    padding: 0 15px;
    width: fit-content;
    position: relative;
}

/* Social providers list */
#kc-social-providers ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#kc-social-providers li {
    margin-bottom: 10px;
}

/* Social login buttons */
.social-google,
.social-github,
.social-microsoft,
#kc-social-providers a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #dadce0;
    border-radius: 5px;
    background-color: white;
    color: #3c4043;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

/* Google specific styling */
.social-google {
    background-color: white;
    color: #3c4043;
}

.social-google:hover {
    background-color: #f8f9fa;

    text-decoration: none;
}

/* GitHub specific styling */
.social-github {
    background-color: #24292e;
    color: white;
    border-color: #24292e;
}

.social-github:hover {
    background-color: #1a1e22;
    border-color: #1a1e22;
    text-decoration: none;
}

.social-github .social-text {
    color: white;
}

/* Microsoft specific styling */
.social-microsoft {
    background-color: white;
    color: #5e5e5e;
}

.social-microsoft:hover {
    background-color: #f8f9fa;

    text-decoration: none;
}

/* Social icon styling */
.social-icon {
    margin-right: 12px;
    vertical-align: middle;
    flex-shrink: 0;
}

.google-icon {
    width: 18px;
    height: 18px;
}

.github-icon {
    width: 18px;
    height: 18px;
}

.microsoft-icon {
    width: 18px;
    height: 18px;
}

.social-text {
    flex-grow: 1;
    text-align: left;
}

/* Registration link */
#kc-registration-container {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

#kc-registration {
    font-size: 14px;
    color: #666;
}

#kc-registration a {
    color: #007bff;
    font-weight: 500;
}

/* Responsive design */
@media (max-width: 600px) {
    #kc-content {
        padding: 30px 20px;
        margin: 10px;
        max-width: calc(100vw - 20px);
        width: auto;
        min-width: auto;
    }

    .kc-logo img {
        width: 150px;
        max-width: 150px;
    }

    .kc-logo {
        margin-bottom: -50px;
    }

    .social-google,
    .social-github,
    .social-microsoft,
    #kc-social-providers a {
        padding: 14px 20px;
        font-size: 15px;
    }
}