/* AlphaCorr Login Theme — matches portal branding */

:root {
    --ac-brand: #961c1f;
    --ac-brand-light: #b82528;
    --ac-brand-bg: #fef2f2;
    --ac-gray-700: #374151;
    --ac-gray-500: #6b7280;
    --ac-gray-300: #d1d5db;
    --ac-gray-200: #e5e7eb;
    --ac-gray-50: #f9fafb;
    --ac-white: #ffffff;
    --ac-radius: 6px;
    --ac-radius-lg: 10px;

    /* Override PatternFly v5 brand colors */
    --pf-v5-global--primary-color--100: #961c1f !important;
    --pf-v5-global--primary-color--200: #b82528 !important;
    --pf-v5-global--link--Color: #961c1f !important;
    --pf-v5-global--link--Color--hover: #b82528 !important;
    --pf-v5-global--active-color--100: #961c1f !important;
    --pf-global--primary-color--100: #961c1f !important;
    --pf-global--primary-color--200: #b82528 !important;
    --pf-global--link--Color: #961c1f !important;
    --pf-global--link--Color--hover: #b82528 !important;
    --pf-global--active-color--100: #961c1f !important;
}

/* Background — dark gradient */
body.login-pf {
    background: #1a0a0b !important;
    background: linear-gradient(135deg, #1a0a0b 0%, #2a1012 50%, #3d1518 100%) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif !important;
}

/* Header — ALPHACORR branding */
#kc-header-wrapper {
    font-weight: 700 !important;
    text-transform: none !important;
    font-size: 1.75rem !important;
    letter-spacing: 0.04em !important;
    color: var(--ac-white) !important;
    /* text-transform: removed — display realm name as-is */
    padding-bottom: 8px !important;
}

/* Card top accent bar — brand blue */
.pf-v5-c-login__main-header,
.pf-c-login__main-header {
    border-top-color: var(--ac-brand) !important;
}

/* Card styling */
.pf-v5-c-login__main,
.pf-c-login__main {
    border-radius: var(--ac-radius-lg) !important;
    overflow: hidden !important;
}

/* Catch-all: any PF5 primary button on the login page */
.pf-v5-c-login .pf-v5-c-button.pf-m-primary,
.pf-v5-c-login .pf-c-button.pf-m-primary,
.pf-v5-c-login input[type="submit"] {
    background-color: var(--ac-brand) !important;
    border-color: var(--ac-brand) !important;
    border-radius: var(--ac-radius) !important;
    font-weight: 600 !important;
}
.pf-v5-c-login .pf-v5-c-button.pf-m-primary:hover,
.pf-v5-c-login .pf-c-button.pf-m-primary:hover,
.pf-v5-c-login input[type="submit"]:hover {
    background-color: var(--ac-brand-light) !important;
    border-color: var(--ac-brand-light) !important;
}

/* Submit button only — not social buttons */
#kc-login input[type="submit"],
#kc-reset-password-form input[type="submit"],
#kc-register-form input[type="submit"],
.pf-v5-c-login__main-footer-band .pf-v5-c-button.pf-m-primary,
#kc-form-buttons .pf-v5-c-button.pf-m-primary,
#kc-form-buttons .pf-c-button.pf-m-primary {
    background-color: var(--ac-brand) !important;
    border-color: var(--ac-brand) !important;
    border-radius: var(--ac-radius) !important;
    font-weight: 600 !important;
    padding: 10px 20px !important;
    font-size: 0.925rem !important;
    transition: background 0.15s !important;
}

#kc-login input[type="submit"]:hover,
#kc-reset-password-form input[type="submit"]:hover,
#kc-register-form input[type="submit"]:hover,
#kc-form-buttons .pf-v5-c-button.pf-m-primary:hover,
#kc-form-buttons .pf-c-button.pf-m-primary:hover {
    background-color: var(--ac-brand-light) !important;
    border-color: var(--ac-brand-light) !important;
}

/* Links */
#kc-content a,
#kc-info a,
.pf-c-button.pf-m-link,
.pf-v5-c-button.pf-m-link {
    color: var(--ac-brand) !important;
    text-decoration: none !important;
}

#kc-content a:hover,
#kc-info a:hover {
    color: var(--ac-brand-light) !important;
}

/* Social login buttons — compact, clean */
#kc-social-providers .pf-v5-c-button,
#kc-social-providers .pf-c-button {
    border-radius: var(--ac-radius) !important;
    border: 1px solid var(--ac-gray-300) !important;
    background: var(--ac-white) !important;
    color: var(--ac-gray-700) !important;
    font-weight: 500 !important;
    transition: border-color 0.15s, background 0.15s !important;
}

#kc-social-providers .pf-v5-c-button:hover,
#kc-social-providers .pf-c-button:hover {
    border-color: var(--ac-brand) !important;
    background: var(--ac-brand-bg) !important;
    color: var(--ac-brand) !important;
}

/* Constrain social button icons */
#kc-social-providers .pf-v5-c-button svg,
#kc-social-providers .pf-c-button svg {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
}

/* "Or sign in with" text */
#kc-social-providers h2 {
    color: var(--ac-gray-500) !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
}

/* Form inputs */
.pf-v5-c-form-control,
.pf-c-form-control {
    border-radius: var(--ac-radius) !important;
}

/* "Forgot Password?" link */
#kc-form-options a {
    color: var(--ac-brand) !important;
    font-size: 0.875rem !important;
}

/* Register link */
#kc-registration a {
    color: var(--ac-brand) !important;
    font-weight: 600 !important;
}

/* Back to Home link */
#kc-header-wrapper + a {
    color: rgba(255,255,255,0.6) !important;
    font-size: 0.875rem !important;
    text-decoration: none !important;
    display: inline-block !important;
    margin-top: 4px !important;
}

#kc-header-wrapper + a:hover {
    color: rgba(255,255,255,0.9) !important;
}

/* ---- Auth method selection cards ---- */

.ac-auth-choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ac-auth-choice-form {
    margin: 0;
}

.ac-auth-choice {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    gap: 16px;
}

.ac-auth-choice:hover {
    border-color: #961c1f;
    box-shadow: 0 0 0 3px rgba(150, 28, 31, 0.1);
}

.ac-auth-choice-icon {
    flex-shrink: 0;
    color: #961c1f;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #fef2f2;
    border-radius: 10px;
}

.ac-auth-choice-text {
    flex: 1;
    min-width: 0;
}

.ac-auth-choice-title {
    font-weight: 600;
    font-size: 1rem;
    color: #111827;
    margin-bottom: 2px;
}

.ac-auth-choice-desc {
    font-size: 0.85rem;
    color: #6b7280;
}

.ac-auth-choice-arrow {
    flex-shrink: 0;
    color: #9ca3af;
}

.ac-auth-choice:hover .ac-auth-choice-arrow {
    color: #961c1f;
}

/* ---- Passwordless option buttons on login page ---- */

.ac-passwordless-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 0;
}

.ac-passwordless-options form {
    margin: 0;
}

.ac-alt-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: #374151;
    transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.ac-alt-btn:hover {
    border-color: #961c1f;
    color: #961c1f;
    box-shadow: 0 0 0 3px rgba(150, 28, 31, 0.08);
}

.ac-alt-btn svg {
    flex-shrink: 0;
}

/* ---- "or" divider ---- */

.ac-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    gap: 16px;
}

.ac-divider::before,
.ac-divider::after {
    content: ;
    flex: 1;
    height: 1px;
    background: #d1d5db;
}

.ac-divider span {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* ---- Hide "Try another way" — redundant with inline passwordless options ---- */
#kc-select-try-another-way-form,
#try-another-way {
    display: none !important;
}

/* ---- Hide name fields on registration (collected later via profile gating) ---- */
#kc-register-form .pf-v5-c-form__group:has(input[name=firstName]),
#kc-register-form .pf-v5-c-form__group:has(input[name=lastName]) {
    display: none !important;
}
