/* Idealog Keycloak Login Theme - Based on company.eventpad-frontend */

/* CSS Variables - matching Tailwind CSS 4.0 color palette */
:root {
    --background: hsl(210 40% 96.1%);
    --foreground: hsl(222.2 84% 4.9%);
    --card: hsl(0 0% 100%);
    --card-foreground: hsl(222.2 84% 4.9%);
    --primary: hsl(221.2 83.2% 53.3%);
    --primary-foreground: hsl(210 40% 98%);
    --muted: hsl(210 40% 96.1%);
    --muted-foreground: hsl(215.4 16.3% 46.9%);
    --border: hsl(214.3 31.8% 91.4%);
    --input: hsl(214.3 31.8% 91.4%);
    --destructive: hsl(0 84.2% 60.2%);
    --radius: 0.5rem;
    --ring: hsl(221.2 83.2% 53.3%);
}

/* Base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    background-color: var(--background);
    color: var(--foreground);
    margin: 0;
    padding: 0;
}

/* Login container - PatternFly v5 overrides */
#kc-header-wrapper,
.kc-logo-text,
.pf-v5-c-login__header,
.pf-v5-c-login__footer {
    display: none;
}

/* Full page centering */
.pf-v5-c-login {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background-color: var(--background);
}

.pf-v5-c-login__container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: none;
}

.pf-v5-c-login__main {
    width: 100%;
    max-width: 24rem;
    margin: 0 auto;
    display: block;
    grid-template-columns: none;
    background-color: var(--card);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    padding: 1.5rem;
}

.pf-v5-c-login__main-body {
    padding: 0;
}

.pf-v5-c-login__main-header {
    display: none;
}

/* Card styling - remove duplicate styles from #kc-form-wrapper */
#kc-form-wrapper {
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.login-pf-page .card-pf {
    background-color: var(--card);
    border: none;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

/* Notice Banner */
.notice-banner {
    background-color: hsl(48 96% 95%);
    border: 1px solid hsl(48 96% 70%);
    border-radius: var(--radius);
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.75rem;
}

.notice-banner p {
    margin: 0 0 0.25rem 0;
    font-size: 0.6875rem;
    line-height: 1.5;
    color: var(--foreground);
}

.notice-banner .notice-title {
    font-weight: 700;
    color: hsl(0 72% 40%);
    font-size: 0.75rem;
    margin-bottom: 0.375rem;
}

.notice-banner ul {
    list-style: disc;
    margin: 0.25rem 0;
    padding-left: 1.25em;
    font-size: 0.6875rem;
}

.notice-banner ul li {
    margin-bottom: 0;
    line-height: 1.5;
    color: var(--foreground);
}

.notice-banner a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: 0.6875rem;
}

.notice-banner a:hover {
    color: hsl(221.2 83.2% 48%);
}

.notice-banner .notice-signature {
    text-align: right;
    margin-top: 0.375rem;
    margin-bottom: 0;
}

/* Title - match production (24px / text-2xl, font-semibold / 600) */
/* Use !important to override PatternFly h1 styles */
.login-title,
h1.login-title,
.pf-v5-c-login__main h1,
#kc-form-wrapper h1 {
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    line-height: 2rem !important;
    color: var(--card-foreground);
    margin: 0 0 1.5rem 0;
    text-align: left;
}

.company-title {
    display: block;
}

/* Form groups - match production gap-6 (24px) */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

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

/* Labels */
.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(var(--foreground), 0.9);
    margin-bottom: 0.5rem;
}

/* Input fields - match production (14px) */
.form-input {
    display: flex;
    height: 2.25rem;
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid var(--input);
    background-color: transparent;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--foreground);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Placeholder - match production: rgb(148, 163, 184) / slate-400 */
.form-input::placeholder {
    color: rgb(148, 163, 184);
}

.form-input[aria-invalid="true"] {
    border-color: var(--destructive);
}

/* Error message */
.error-message {
    display: block;
    font-size: 0.875rem;
    color: var(--destructive);
    margin-top: 0.25rem;
}

/* Checkbox */
.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    cursor: pointer;
}

.checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
}

/* Form options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Hide empty form-options */
.form-options:empty {
    display: none;
    margin: 0;
}

/* Primary button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.btn-primary:hover {
    background-color: hsl(221.2 83.2% 48%);
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
    height: 2.25rem;
    padding: 0.5rem 1rem;
    margin-top: 0;
}

/* Links section */
.login-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
}

.link-text {
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--foreground);
    margin: 0;
}

.link {
    color: hsl(217.2 91.2% 59.8%);
    text-decoration: underline;
    text-underline-offset: 4px;
    font-size: 0.875rem;
    transition: color 0.15s ease-in-out;
}

.link:hover {
    color: hsl(217.2 91.2% 50%);
}

/* Service info section */
.service-info {
    margin-top: 1.5rem;
    text-align: center;
}

.separator {
    height: 1px;
    background-color: var(--border);
    margin: 1.5rem 0;
}

.service-notice {
    font-size: 0.75rem;
    line-height: 1rem;
    color: var(--muted-foreground);
    margin: 0 0 1rem 0;
}

.service-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: nowrap;
}

.logo-supenavi {
    height: 30px;
    width: auto;
}

.logo-kbs {
    height: 48px;
    width: auto;
}

/* Alert messages (success, error, warning, info) */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background-color: hsl(0 84.2% 95%);
    border: 1px solid hsl(0 84.2% 80%);
    color: var(--destructive);
}

.alert-warning {
    background-color: hsl(48 96% 95%);
    border: 1px solid hsl(48 96% 70%);
    color: hsl(48 96% 30%);
}

.alert-success {
    background-color: hsl(142 76% 95%);
    border: 1px solid hsl(142 76% 70%);
    color: hsl(142 76% 30%);
}

.alert-info {
    background-color: hsl(199 89% 95%);
    border: 1px solid hsl(199 89% 70%);
    color: hsl(199 89% 30%);
}

/* Hide Keycloak default elements */
#kc-locale,
.kc-social-section,
.kc-social-provider-name {
    display: none;
}

/* Social login (if enabled later) */
.kc-social-links {
    margin-top: 1rem;
}

.kc-social-item {
    margin-bottom: 0.5rem;
}

.kc-social-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--card);
    color: var(--foreground);
    font-size: 0.875rem;
    text-decoration: none;
    transition: background-color 0.15s ease-in-out;
}

.kc-social-item a:hover {
    background-color: var(--muted);
}

/* Responsive adjustments */
@media (min-width: 768px) {
    #kc-content {
        padding: 2.5rem;
    }
}

/* Override Keycloak v2 theme styles */
.login-pf body {
    background-color: var(--background);
}

.login-pf .container {
    padding: 0;
    max-width: none;
}

.login-pf-page .login-pf-brand {
    margin-top: 0;
}

.card-pf {
    margin: 0 auto;
    padding: 0;
}

/* Ensure proper centering */
#kc-header {
    display: none;
}

.login-pf-page .card-pf {
    max-width: 24rem;
    margin: 0 auto;
}

/* Info page (logout complete, logout confirm) */
.info-page {
    text-align: center;
}

.info-page .login-title {
    text-align: center !important;
}

.info-message {
    margin-bottom: 1.5rem;
}

.info-text {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin: 0;
    line-height: 1.5;
}

.info-actions {
    margin-bottom: 0;
}

.info-actions .btn-block {
    display: inline-flex;
    text-decoration: none;
}
