/* CREATE·OS Keycloak Login Theme
 * Clean, professional design with Logo.png full width
 */

/* ==================== CSS Variables ==================== */
:root {
    --createos-bg-dark: #0a0a14;
    --createos-bg-secondary: #12121f;
    --createos-pink: #e94786;
    --createos-magenta: #c445a0;
    --createos-cyan: #3da3eb;
    --createos-gradient: linear-gradient(135deg, var(--createos-pink) 0%, var(--createos-magenta) 50%, var(--createos-cyan) 100%);
    --createos-text-primary: #ffffff;
    --createos-text-secondary: #b8c0cc;
    --createos-text-muted: #8892a0;
    --createos-border: rgba(255, 255, 255, 0.08);
    --createos-card-bg: rgba(16, 16, 28, 0.95);
    --createos-input-bg: transparent;
    --createos-input-border: rgba(255, 255, 255, 0.12);
}

/* ==================== Base Styles ==================== */
html, body,
html.login-pf,
.login-pf body {
    background: var(--createos-bg-dark) !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Subtle background glow - more subtle */
.login-pf body {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(233, 71, 134, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(61, 163, 235, 0.12) 0%, transparent 50%),
        var(--createos-bg-dark) !important;
}

/* ==================== Hide Keycloak Branding ==================== */
#kc-header,
#kc-header-wrapper,
.login-pf-page-header,
.login-pf-brand-name,
.kc-logo-text,
.pf-c-brand {
    display: none !important;
}

/* ==================== Login Container ==================== */
.login-pf-page {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

/* ==================== Card - Wider with subtle shadow ==================== */
.login-pf-page .card-pf,
.card-pf,
#kc-form-wrapper {
    background: var(--createos-card-bg) !important;
    border: 1px solid var(--createos-border) !important;
    border-radius: 20px !important;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 60px -20px rgba(233, 71, 134, 0.15),
        0 0 60px -20px rgba(61, 163, 235, 0.15) !important;
    padding: 48px !important;
    max-width: 480px !important;
    width: 100% !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

/* ==================== Logo - Full card width, auto height ==================== */
.login-pf-page .card-pf::before {
    content: '' !important;
    display: block !important;
    width: 100% !important;
    height: 280px !important;
    background-image: url('../images/logo.png') !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    margin-bottom: 16px !important;
}

/* ==================== Page Title - HIDDEN ==================== */
#kc-page-title {
    display: none !important;
}

/* ==================== Form Styling ==================== */
.login-pf form {
    width: 100% !important;
}

.login-pf .form-group {
    margin-bottom: 20px !important;
}

/* Labels */
.login-pf label,
.login-pf .control-label {
    color: var(--createos-text-secondary) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    margin-bottom: 8px !important;
    display: block !important;
}

/* Regular input fields (username, email) */
.login-pf input[type="text"],
.login-pf input[type="email"],
#username {
    background: rgba(255, 255, 255, 0.05) !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: none !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    padding: 14px 16px !important;
    font-size: 1rem !important;
    outline: none !important;
}

/* Password field WRAPPER - this is the outer container with show/hide button */
.pf-c-input-group {
    background: rgba(255, 255, 255, 0.05) !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: none !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    --pf-c-input-group--BackgroundColor: rgba(255, 255, 255, 0.05) !important;
}

/* Password INPUT inside wrapper - transparent so wrapper bg shows */
.pf-c-input-group input,
.pf-c-input-group .pf-c-form-control,
.pf-c-input-group input[type="password"],
#password {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    color: #ffffff !important;
    padding: 14px 16px !important;
    font-size: 1rem !important;
    outline: none !important;
    --pf-c-form-control--BackgroundColor: transparent !important;
}

/* Show/hide password button */
.pf-c-input-group .pf-c-button,
.pf-c-input-group button,
button[data-password-toggle] {
    background: transparent !important;
    border: none !important;
    color: #666 !important;
    padding: 0 12px !important;
}

.login-pf input:focus,
.login-pf .form-control:focus,
.pf-c-form-control:focus,
#username:focus,
#password:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: none !important;
    box-shadow: 0 0 0 2px rgba(233, 71, 134, 0.3) !important;
    outline: none !important;
}

.login-pf input::placeholder {
    color: var(--createos-text-muted) !important;
}

/* ==================== Primary Button - Dark/Subtle ==================== */
.login-pf .btn-primary,
.login-pf input[type="submit"],
.login-pf button[type="submit"] {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    color: var(--createos-text-primary) !important;
    padding: 14px 24px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    width: 100% !important;
    transition: all 0.2s ease !important;
}

.login-pf .btn-primary:hover,
.login-pf input[type="submit"]:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

/* ==================== Links ==================== */
.login-pf a {
    color: var(--createos-cyan) !important;
    text-decoration: none !important;
}

.login-pf a:hover {
    color: var(--createos-pink) !important;
    text-decoration: underline !important;
}

/* Form options (forgot password, etc) */
.login-pf #kc-form-options,
.login-pf .kc-form-options {
    margin-top: 16px !important;
    text-align: center !important;
}

/* ==================== Checkbox ==================== */
.login-pf .checkbox label {
    color: var(--createos-text-secondary) !important;
    font-size: 0.875rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.login-pf input[type="checkbox"] {
    accent-color: var(--createos-pink) !important;
}

/* ==================== Social Login Section - No HR ==================== */
#kc-social-providers,
.kc-social-section,
.kc-social-links {
    margin-top: 32px !important;
    padding-top: 0 !important;
    border: none !important;
    width: 100% !important;
}

/* "Or sign in with" text - VISIBLE */
#kc-social-providers h2,
#kc-social-providers h4,
.kc-social-section h2,
.kc-social-section-header {
    color: var(--createos-text-secondary) !important;
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    text-align: center !important;
    margin-bottom: 16px !important;
    text-transform: none !important;
}

/* Social providers list */
#kc-social-providers ul,
.kc-social-links {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

/* ==================== Google Button - Override PatternFly completely ==================== */
#kc-social-providers a,
#kc-social-providers a.pf-c-button,
#kc-social-providers a.pf-c-button.pf-m-control,
#kc-social-providers .pf-c-button.pf-m-control.pf-m-block,
a.kc-social-item,
#social-google {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 16px 24px !important;
    background: var(--createos-gradient) !important;
    border: none !important;
    border-width: 0 !important;
    border-color: transparent !important;
    border-radius: 8px !important;
    color: white !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    box-shadow: 0 4px 20px rgba(233, 71, 134, 0.3) !important;
    outline: none !important;
    outline-width: 0 !important;
    --pf-c-button--m-control--BorderColor: transparent !important;
    --pf-c-button--BorderWidth: 0 !important;
}

#kc-social-providers a:hover,
#kc-social-providers a:focus,
#social-google:hover,
#social-google:focus {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 28px rgba(233, 71, 134, 0.4) !important;
    border: none !important;
    outline: none !important;
}

/* Kill the ::after pseudo-element border */
#kc-social-providers a::after,
#kc-social-providers a::before,
#social-google::after,
#social-google::before,
.pf-c-button::after,
.pf-c-button::before,
.pf-c-button.pf-m-control::after,
.pf-c-button.pf-m-control::before,
a.kc-social-item::after,
a.kc-social-item::before {
    display: none !important;
    content: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    opacity: 0 !important;
}

/* Google icon */
#kc-social-providers i,
.kc-social-provider-logo {
    color: white !important;
}

/* ==================== Alert Messages ==================== */
.login-pf .alert {
    border-radius: 12px !important;
    padding: 16px !important;
    margin-bottom: 20px !important;
    border: none !important;
}

.login-pf .alert-error,
.login-pf .alert-danger {
    background: rgba(239, 68, 68, 0.12) !important;
    border-left: 3px solid #ef4444 !important;
    color: #fca5a5 !important;
}

.login-pf .alert-warning {
    background: rgba(245, 158, 11, 0.12) !important;
    border-left: 3px solid #f59e0b !important;
    color: #fcd34d !important;
}

.login-pf .alert-success {
    background: rgba(34, 197, 94, 0.12) !important;
    border-left: 3px solid #22c55e !important;
    color: #86efac !important;
}

.login-pf .alert-info {
    background: rgba(59, 130, 246, 0.12) !important;
    border-left: 3px solid #3b82f6 !important;
    color: #93c5fd !important;
}

/* ==================== Responsive ==================== */
@media (max-width: 520px) {
    .login-pf-page .card-pf,
    .card-pf {
        padding: 32px 24px !important;
        margin: 16px !important;
        max-width: calc(100% - 32px) !important;
    }

    .login-pf-page .card-pf::before {
        height: 80px !important;
        margin-bottom: 24px !important;
    }
}

/* ==================== Animation ==================== */
.login-pf-page .card-pf {
    animation: fadeSlideIn 0.4s ease-out !important;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Misc Cleanup ==================== */
.login-pf .col-xs-12,
.login-pf .col-sm-12 {
    width: 100% !important;
    padding: 0 !important;
    float: none !important;
}

.login-pf .row {
    margin: 0 !important;
}

/* Hide any remaining Keycloak text */
.pf-c-brand,
.login-pf-brand {
    display: none !important;
}

/* ==================== AGGRESSIVELY HIDE ALL HR ELEMENTS ==================== */
hr,
.login-pf hr,
.card-pf hr,
#kc-social-providers hr,
#kc-social-providers > hr,
.kc-social-section hr,
.kc-social-section > hr,
.kc-social-gray hr,
div hr,
form hr,
* > hr {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-width: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
}
