/* FusionK Enterprise Keycloak Theme - Material-UI Style */

/* ===== Google Fonts Import ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS Variables ===== */
:root {
    /* Primary palette (FusionK Enterprise amber/brown) */
    --enterprise-primary: #92400e;
    --enterprise-primary-dark: #78350f;
    --enterprise-primary-light: #b45309;
    --enterprise-primary-contrast: #ffffff;

    /* Text colors */
    --enterprise-text-primary: #1C1917;
    --enterprise-text-secondary: #57534E;
    --enterprise-text-disabled: #A8A29E;

    /* Background */
    --enterprise-bg-paper: #FFFFFF;
    --enterprise-bg-default: #FAFAF9;

    /* Borders & Dividers */
    --enterprise-divider: rgba(0, 0, 0, 0.12);
    --enterprise-border: rgba(0, 0, 0, 0.23);

    /* Status colors */
    --enterprise-error: #EF4444;
    --enterprise-warning: #F59E0B;
    --enterprise-success: #10B981;
    --enterprise-info: #06B6D4;

    /* Shadows */
    --enterprise-shadow-3: 0px 3px 3px -2px rgba(0,0,0,0.2), 0px 3px 4px 0px rgba(0,0,0,0.14), 0px 1px 8px 0px rgba(0,0,0,0.12);
    --enterprise-shadow-4: 0px 2px 4px -1px rgba(0,0,0,0.2), 0px 4px 5px 0px rgba(0,0,0,0.14), 0px 1px 10px 0px rgba(0,0,0,0.12);

    /* Typography */
    --enterprise-font: Poppins, "JetBrains Mono", -apple-system, "system-ui", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";

    /* Border radius */
    --enterprise-radius: 12px;
    --enterprise-radius-input: 8px;
}

/* ===== Global Reset ===== */
.enterprise-html,
.enterprise-body {
    font-family: var(--enterprise-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.enterprise-body {
    background-color: var(--enterprise-bg-default) !important;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* ===== Hide Default Keycloak Elements ===== */
#kc-header,
#kc-header-wrapper,
.kc-logo-text,
#kc-locale,
#kc-page-title,
.login-pf-signup,
#kc-info,
#kc-info-wrapper,
.pf-c-alert,
.alert-error,
.alert-warning,
.alert-success,
.alert-info,
#kc-content-wrapper > .alert,
.kc-feedback-text:not(.enterprise-alert *) {
    display: none !important;
}

/* ===== Login Container ===== */
.enterprise-login,
#kc-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    box-sizing: border-box;
    width: 100%;
}

#kc-content-wrapper,
.enterprise-card,
.enterprise-header {
    width: 100%;
    max-width: 480px;
    display: flex;
    justify-content: center;
}

/* ===== Paper Card ===== */
.enterprise-paper {
    background-color: var(--enterprise-bg-paper);
    border-radius: var(--enterprise-radius);
    box-shadow: var(--enterprise-shadow-3);
    padding: 48px 64px;
    width: 480px;
    min-width: 480px;
    box-sizing: border-box;
}

/* ===== Logo Container ===== */
.enterprise-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.enterprise-logo {
    width: 263px;
    max-width: 263px;
    height: auto;
    margin-bottom: 16px;
}

.enterprise-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--enterprise-text-primary);
    margin: 0;
    line-height: 1.6;
}

/* ===== Form Fields ===== */
.enterprise-form-field {
    margin-bottom: 20px;
}

.enterprise-field-label {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--enterprise-text-secondary);
    margin: 0 0 8px 0;
    line-height: 1.43;
    letter-spacing: 0.01071em;
}

.enterprise-input-container {
    position: relative;
}

.enterprise-text-input {
    font-family: var(--enterprise-font);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.4375em;
    color: var(--enterprise-text-primary);
    box-sizing: border-box;
    width: 100%;
    padding: 16.5px 14px;
    border: 1px solid var(--enterprise-border);
    border-radius: var(--enterprise-radius-input);
    background-color: transparent;
    outline: none;
    transition: border-color 200ms cubic-bezier(0.0, 0, 0.2, 1);
}

.enterprise-text-input:hover {
    border-color: var(--enterprise-text-primary);
}

.enterprise-text-input:focus {
    border-color: var(--enterprise-primary);
    border-width: 2px;
    padding: 15.5px 13px;
}

.enterprise-text-input::placeholder {
    color: var(--enterprise-text-disabled);
    opacity: 1;
}

/* ===== Remember Me & Forgot Password ===== */
.enterprise-remember-me {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 8px;
}

.enterprise-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--enterprise-text-secondary);
}

.enterprise-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--enterprise-primary);
}

.enterprise-forgot-link {
    color: var(--enterprise-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.enterprise-forgot-link:hover {
    text-decoration: underline;
}

/* ===== Submit Button (Primary - Contained) ===== */
.enterprise-submit-button {
    font-family: var(--enterprise-font);
    font-weight: 500;
    font-size: 0.9375rem;
    line-height: 1.75;
    letter-spacing: 0.02857em;
    text-transform: uppercase;
    min-height: 48px;
    padding: 10px 24px;
    border-radius: var(--enterprise-radius-input);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: none;
    color: var(--enterprise-primary-contrast);
    background-color: var(--enterprise-primary);
    box-shadow: 0px 3px 1px -2px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12);
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.enterprise-submit-button:hover {
    background-color: var(--enterprise-primary-dark);
    box-shadow: var(--enterprise-shadow-4);
}

.enterprise-submit-button:active {
    box-shadow: 0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12);
}

.enterprise-submit-button:disabled {
    color: var(--enterprise-text-disabled);
    background-color: rgba(0, 0, 0, 0.12);
    box-shadow: none;
    cursor: not-allowed;
}

/* ===== Divider with "OR" ===== */
.enterprise-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
}

.enterprise-divider::before,
.enterprise-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--enterprise-divider);
}

.enterprise-divider-text {
    padding: 0 16px;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--enterprise-text-secondary);
}

/* ===== Social/SSO Button (Outlined) ===== */
.enterprise-social-providers {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.enterprise-social-button {
    font-family: var(--enterprise-font);
    font-weight: 500;
    font-size: 0.9375rem;
    line-height: 1.75;
    letter-spacing: 0.02857em;
    text-transform: uppercase;
    min-height: 48px;
    padding: 10px 24px;
    border-radius: var(--enterprise-radius-input);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
    color: var(--enterprise-primary);
    background-color: transparent;
    border: 1px solid rgba(146, 64, 14, 0.5);
    box-sizing: border-box;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1), border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.enterprise-social-button:hover {
    background-color: rgba(146, 64, 14, 0.04);
    border-color: var(--enterprise-primary);
    text-decoration: none;
}

/* ===== Register Link ===== */
.enterprise-register-link {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--enterprise-text-secondary);
}

.enterprise-register-link a {
    color: var(--enterprise-primary);
    text-decoration: none;
    font-weight: 500;
}

.enterprise-register-link a:hover {
    text-decoration: underline;
}

/* ===== Alert Messages ===== */
.enterprise-alert {
    padding: 14px 18px;
    border-radius: var(--enterprise-radius-input);
    margin-bottom: 16px;
    font-size: 0.875rem;
    line-height: 1.43;
}

.enterprise-alert-error {
    background-color: rgb(253, 237, 237);
    color: rgb(95, 33, 32);
}

.enterprise-alert-warning {
    background-color: rgb(255, 244, 229);
    color: rgb(102, 60, 0);
}

.enterprise-alert-success {
    background-color: rgb(237, 247, 237);
    color: rgb(30, 70, 32);
}

.enterprise-alert-info {
    background-color: rgb(229, 246, 253);
    color: rgb(1, 67, 97);
}

/* ===== Description Text ===== */
.enterprise-description {
    font-size: 0.9375rem;
    color: var(--enterprise-text-secondary);
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.enterprise-description-center {
    text-align: center;
}

.enterprise-title-center {
    text-align: center;
    margin-bottom: 16px;
}

/* ===== Info Message ===== */
.enterprise-info-message {
    text-align: center;
    margin: 24px 0;
}

/* ===== Button Link ===== */
.enterprise-button-link {
    display: flex;
    text-decoration: none;
}

/* ===== Back Link ===== */
.enterprise-back-link {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
}

.enterprise-back-link a {
    color: var(--enterprise-primary);
    text-decoration: none;
    font-weight: 500;
}

.enterprise-back-link a:hover {
    text-decoration: underline;
}

/* ===== Form Actions ===== */
.enterprise-form-actions {
    margin-top: 24px;
}

/* ===== Logout Form ===== */
.enterprise-logout-form {
    text-align: center;
}

/* ===== Override Keycloak Default Styles ===== */
.login-pf body,
.login-pf-page {
    background-color: var(--enterprise-bg-default) !important;
    background-image: none !important;
}

#kc-form,
#kc-form-wrapper {
    margin: 0;
    padding: 0;
}

.card-pf {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0;
}

.login-pf .container {
    padding: 0;
}

#kc-form-buttons {
    margin-top: 0;
}

/* Hide default social section styling */
#kc-social-providers {
    margin: 0;
    padding: 0;
}

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

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .enterprise-paper {
        padding: 24px 16px;
        box-shadow: 0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12);
    }

    .enterprise-remember-me {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Locale Selector (top-right, viewport-fixed) ===== */
#kc-locale {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
}

#kc-locale-wrapper {
    position: relative;
}

#kc-locale-dropdown {
    position: relative;
}

#kc-current-locale-link {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-indent: -9999px;
    line-height: 1;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

#kc-current-locale-link:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

#kc-current-locale-link::before {
    text-indent: 0;
    float: left;
    width: 100%;
    height: 100%;
    font-size: 22px;
    line-height: 40px;
    text-align: center;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
    color: initial;
}

html[lang="en"] #kc-current-locale-link::before { content: "ðºð¸"; }
html[lang="pt-BR"] #kc-current-locale-link::before { content: "ð§ð·"; }
html[lang="es"] #kc-current-locale-link::before { content: "ðªð¸"; }
html[lang="fr"] #kc-current-locale-link::before { content: "ð«ð·"; }
html[lang="de"] #kc-current-locale-link::before { content: "ð©ðª"; }
html[lang="it"] #kc-current-locale-link::before { content: "ð®ð¹"; }
html[lang="ja"] #kc-current-locale-link::before { content: "ð¯ðµ"; }
html[lang="zh-CN"] #kc-current-locale-link::before { content: "ð¨ð³"; }

#language-switch1 {
    position: absolute;
    top: 48px;
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    display: none;
}

#kc-current-locale-link[aria-expanded="true"] + ul#language-switch1 {
    display: block;
}

#language-switch1 li {
    padding: 0;
}

#language-switch1 a {
    display: block;
    padding: 8px 16px;
    color: #0F3D30;
    text-decoration: none;
    font-size: 14px;
    font-family: "Poppins", sans-serif;
}

#language-switch1 a:hover {
    background: rgba(0, 168, 107, 0.08);
}

