/* ═══════════════════════════════════════════════════════
   Stochdorphia Keycloak Theme — v2 (PatternFly 5)
   ═══════════════════════════════════════════════════════ */

/* ── Background ── */
html.login-pf {
    background: url("https://stochdorphia.de/assets/images/haus.jpg") center /
        cover no-repeat;
    position: relative;
    min-height: 100vh;
}

html.login-pf::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 0;
}

.login-pf body {
    background: transparent !important;
    position: relative;
    z-index: 1;
}

/* ── Login container ── */
.pf-v5-c-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.pf-v5-c-login__container {
    grid-template-columns: minmax(320px, 450px) !important;
    grid-template-areas:
        "header"
        "main" !important;
    justify-items: center !important;
    gap: 1.5rem;
    width: 100%;
    max-width: 450px;
}

/* ── Header / Brand ── */
.pf-v5-c-login__header {
    width: 100%;
    text-align: center;
}

#kc-header-wrapper,
.pf-v5-c-login__header .pf-v5-c-brand {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    color: #fff !important;
    text-align: center;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.05em;
    display: block;
    width: 100%;
    max-width: none !important;
    background: linear-gradient(
        135deg,
        #fff 30%,
        rgba(255, 255, 255, 0.7) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin: 0 auto;
}

/* Hide the default logo image if present */
.kc-logo-text {
    background: none !important;
    height: auto !important;
    width: auto !important;
    max-width: none !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

.kc-logo-text span {
    display: inline !important;
}

/* ── Main card ── */
.pf-v5-c-login__main {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 100%;
}

/* Remove default card borders / backgrounds */
.pf-v5-c-login__main::before,
.pf-v5-c-login__main::after {
    display: none !important;
}

/* ── Card header ── */
.pf-v5-c-login__main-header {
    grid-template-columns: 1fr !important;
    text-align: center;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

#kc-page-title,
.pf-v5-c-login__main-header .pf-v5-c-title {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    text-align: center;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* ── Card body ── */
.pf-v5-c-login__main-body {
    padding: 1rem 2rem 1.5rem;
}

/* ── Form ── */
.pf-v5-c-form {
    gap: 1.25rem;
}

/* Labels */
.pf-v5-c-form__label,
.pf-v5-c-form__label-text {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Wrapper — keep transparent, no border */
.pf-v5-c-form-control {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

/* Remove default underline/border-bottom from PatternFly inputs */
.pf-v5-c-form-control::before,
.pf-v5-c-form-control::after {
    display: none !important;
}

/* Actual inputs */
.pf-v5-c-form-control input,
#username,
#password,
#password-new,
#password-confirm,
input[type="text"],
input[type="password"],
input[type="email"] {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
    color: #fff !important;
    padding: 0.75rem 1rem !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
}

.pf-v5-c-form-control input:focus,
#username:focus,
#password:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05) !important;
    outline: none !important;
}

/* Input group (password toggle wrapper) */
.pf-v5-c-input-group {
    background: transparent !important;
    border: none !important;
    gap: 0;
    --pf-v5-c-input-group__item--m-box--BorderLeftColor: transparent !important;
}

.pf-v5-c-input-group__item {
    border-left: none !important;
}

.pf-v5-c-input-group .pf-v5-c-form-control input {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: none !important;
}

/* Password toggle button */
.pf-v5-c-input-group__item button,
[data-password-toggle],
.pf-v5-c-button.pf-m-control {
    background: transparent !important;
    border: none !important;
    border-left: none !important;
    border-right: none !important;
    border-radius: 0 12px 12px 0 !important;
    color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: none !important;
}

.pf-v5-c-input-group__item button::before,
.pf-v5-c-input-group__item button::after,
.pf-v5-c-button.pf-m-control::before,
.pf-v5-c-button.pf-m-control::after {
    display: none !important;
    border: none !important;
    content: none !important;
}

.pf-v5-c-input-group__item button:hover,
[data-password-toggle]:hover,
.pf-v5-c-button.pf-m-control:hover {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Icons inside inputs (like user icon) */
.pf-v5-c-form-control__icon,
.pf-v5-c-form-control .fa,
.pf-v5-c-form-control .fas,
.pf-v5-c-form-control svg {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* ── Buttons ── */
#kc-login,
.pf-v5-c-button.pf-m-primary {
    background: linear-gradient(135deg, #4a90d9, #357abd) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 0.85rem 2rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff !important;
    width: 100% !important;
    cursor: pointer;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(74, 144, 217, 0.3);
    margin-top: 0.5rem;
}

#kc-login:hover,
.pf-v5-c-button.pf-m-primary:hover {
    background: linear-gradient(135deg, #5a9fe9, #4a90d9) !important;
    box-shadow: 0 6px 20px rgba(74, 144, 217, 0.4);
    transform: translateY(-1px);
}

/* Secondary buttons */
.pf-v5-c-button.pf-m-secondary {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    color: #fff !important;
}

.pf-v5-c-button.pf-m-secondary:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

/* ── Checkbox ── */
.pf-v5-c-check__input {
    accent-color: #4a90d9;
}

.pf-v5-c-check__label {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.85rem !important;
}

/* ── Links ── */
a,
.pf-v5-c-login__main-body a,
.pf-v5-c-login__main-footer a {
    color: rgba(255, 255, 255, 0.6) !important;
    transition: color 0.2s ease;
}

a:hover,
.pf-v5-c-login__main-body a:hover,
.pf-v5-c-login__main-footer a:hover {
    color: #fff !important;
}

/* ── Alerts / Errors ── */
.pf-v5-c-alert {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff !important;
}

.pf-v5-c-alert__title,
.pf-v5-c-alert__icon {
    color: #fff !important;
}

.pf-v5-c-form__helper-text,
.pf-v5-c-form__helper-text .pf-v5-c-helper-text__item,
#input-error {
    color: #ff6b6b !important;
    font-size: 0.85rem;
}

/* ── Registration / Footer ── */
.pf-v5-c-login__main-footer {
    text-align: center;
}

.pf-v5-c-login__main-footer-links {
    justify-content: center;
}

#kc-registration-container {
    text-align: center;
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.5);
}

#kc-registration-container a {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
}

/* ── Social providers ── */
#kc-social-providers a,
.pf-v5-c-login__main-footer .pf-v5-c-button {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
    padding: 0.75rem !important;
    color: #fff !important;
    transition: all 0.3s ease;
}

#kc-social-providers a:hover,
.pf-v5-c-login__main-footer .pf-v5-c-button:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

/* ── Info / Instruction text ── */
.instruction {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.9rem;
    text-align: center;
}

/* ── OTP / Recovery codes ── */
#kc-recovery-codes-list {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* ── Smooth entrance animation ── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pf-v5-c-login__container > * {
    animation: fadeIn 0.6s ease-out;
}
