/* DOKI Keycloak Theme - Login */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f8f9fa;
    color: #1a1a1a;
}

/* Hide default Keycloak elements */
#kc-header,
#kc-header-wrapper,
.kc-logo-text {
    display: none !important;
}

/* Split Layout Container */
#kc-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

#kc-container-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Left Side - Form */
#kc-content {
    width: 45%;
    min-width: 400px;
    max-width: 520px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 2;
}

#kc-content-wrapper {
    width: 100%;
    max-width: 360px;
}

/* Logo */
.doki-logo {
    margin-bottom: 24px;
}

.doki-logo img {
    height: 160px;
    width: auto;
    object-fit: contain;
    display: block;
    margin-left: -8px;
}

/* Title */
#kc-page-title,
.doki-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.doki-description {
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 32px;
    line-height: 1.5;
}

/* Form Styles */
#kc-form {
    width: 100%;
}

.form-group,
#kc-form-login .form-group {
    margin-bottom: 20px;
}

.form-group label,
#kc-form-login label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #374151;
}

.form-group input,
#kc-form-login input[type="text"],
#kc-form-login input[type="password"],
#kc-form-login input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus,
#kc-form-login input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Form Options Row */
#kc-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.checkbox-label,
#kc-form-options .checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
}

#kc-form-options input[type="checkbox"],
.checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

#kc-form-options .checkbox {
    display: flex;
    align-items: center;
}

/* Forgot Password Link */
#kc-form-options a,
.forgot-link {
    font-size: 13px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

#kc-form-options a:hover,
.forgot-link:hover {
    text-decoration: underline;
}

/* Submit Button */
#kc-form-buttons,
.form-buttons {
    margin-top: 8px;
}

#kc-login,
.btn-primary,
input[type="submit"],
button[type="submit"] {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(to right, #6366f1 0%, #8b5cf6 50%, #9333ea 100%);
    color: white;
    border: none;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

#kc-login:hover,
.btn-primary:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
    background: linear-gradient(to right, #4f46e5 0%, #7c3aed 50%, #7e22ce 100%);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

#kc-login:active,
.btn-primary:active,
input[type="submit"]:active,
button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

/* Secondary Button */
.btn-secondary,
button.btn-default {
    width: 100%;
    padding: 12px 24px;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover,
button.btn-default:hover {
    background: #f9fafb;
}

/* Footer - Registration Link */
#kc-registration,
.login-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

#kc-registration a,
.login-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    margin-left: 6px;
}

#kc-registration a:hover,
.login-footer a:hover {
    text-decoration: underline;
}

/* Right Side - Brand Panel */
.doki-brand-side {
    flex: 1;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.doki-brand-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.doki-panel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* Error Messages */
.alert,
.kc-feedback-text,
#kc-error-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error,
.pf-m-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-warning,
.pf-m-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #d97706;
}

.alert-success,
.pf-m-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.alert-info,
.pf-m-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
}

/* Info Box */
#kc-info,
.kc-info-message {
    margin-top: 24px;
    padding: 16px;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 14px;
    color: #4b5563;
}

/* Social Login Buttons */
#kc-social-providers {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

#kc-social-providers ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#kc-social-providers li {
    margin-bottom: 12px;
}

#kc-social-providers a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 24px;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
}

#kc-social-providers a:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Responsive */
@media (max-width: 900px) {
    #kc-container,
    #kc-container-wrapper {
        flex-direction: column;
    }

    #kc-content {
        width: 100%;
        min-width: unset;
        max-width: unset;
        padding: 32px 24px;
        order: 2;
    }

    .doki-brand-side {
        order: 1;
        min-height: 250px;
    }

    .doki-logo img {
        height: 100px;
    }
}

/* Hide unnecessary Keycloak elements */
.login-pf-page,
.card-pf {
    background: transparent !important;
    box-shadow: none !important;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
