/* --- 1. GLOBAL RESET & HIDING KEYCLOAK ARTIFACTS --- */
.brand-icon {
    width: 40px;
    height: 40px;
    background-color: #635BFF; /* The SaaS Blue */
    border-radius: 8px;        /* Rounded corners */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3); /* Subtle depth */
}

/* The Icon Itself */
.brand-icon svg {
    width: 24px;
    height: 24px;
    fill: #ffffff; /* Force icon to be white */
}

html, body {
    background: #121212 !important;
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* HIDE THE REALM TEXT (Correct Selector) */
header, .login-pf-header, #kc-header, #kc-header-wrapper, .kc-logo-text {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    position: absolute;
    pointer-events: none;
}

/* Hide the default Keycloak container box */
.login-pf-page .card-pf {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
}

.login-pf-page {
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* --- 2. YOUR SAAS CARD --- */
.login-card {
    background: #1b1b1b;
    border-radius: 12px;
    padding: 48px 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 400px;
    max-width: 90vw;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
}

/* Logo & Header */
.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}
.login-header h1 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    margin-top: 0;
}
.login-header p {
    color: #8792a2;
    text-align: center;
    font-size: 14px;
    margin-bottom: 24px;
    margin-top: 0;
}

/* --- 3. INPUTS & FLOATING LABELS (FIXED) --- */
.input-group {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}

.input-group input {
    width: 100%;
    background: #252525;
    border: 1px solid #333;
    border-radius: 6px;
    
    /* PADDING FIX: Equal on sides, but top is larger to push text down */
    padding: 24px 16px 8px 16px; 
    
    color: #ffffff;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    height: 56px; /* Slightly taller to accommodate label */
    box-sizing: border-box;
}

.input-group input:focus {
    border-color: #635BFF;
    background: #2a2a2a;
    box-shadow: 0 0 0 1px rgba(99, 91, 255, 0.2);
}

/* The Floating Label */
.input-group label {
    position: absolute;
    left: 16px; /* Matches input padding-left */
    top: 50%;
    transform: translateY(-50%);
    color: #8792a2;
    font-size: 15px;
    pointer-events: none;
    transition: all 0.2s ease;
    margin: 0;
    line-height: 1;
}

/* When input has focus OR has text (via placeholder hack) */
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: 12px; /* Move to top */
    transform: none;
    font-size: 11px;
    font-weight: 600;
    color: #635BFF;
}

/* Password Eye Icon - needs right padding on input so text doesn't hit it */
.input-group input[type="password"], .input-group input#password {
    padding-right: 45px; /* Extra space for the eye */
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #8792a2;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}
.password-toggle:hover { color: #e0e0e0; }

/* --- 4. BUTTONS & FOOTER --- */
.submit-btn {
    width: 100%;
    background: #635BFF;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}
.submit-btn:hover { background: #5046e5; }

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    font-size: 13px;
    color: #8792a2;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.checkbox-container input {
    accent-color: #635BFF; /* Makes the native checkbox purple */
    width: 16px;
    height: 16px;
}

.forgot-link { color: #635BFF; text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }

/* Alerts */
.alert {
    border-radius: 6px;
    padding: 12px;
    font-size: 13px;
    margin-bottom: 20px;
    text-align: center;
    background: rgba(220, 38, 38, 0.1);
    color: #ef4444;
    border: 1px solid rgba(220, 38, 38, 0.2);
}
