/*
 * qRaptor Keycloak Theme
 * Matches FIGMA_REFERENCES/qRaptorDesign login page
 * Color Palette: #1c2227 (bg), #1dc690 (accent), #eaeae0 (text)
 */

/* ========================================
   GLOBAL STYLES & RESET
   ======================================== */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #1c2227;
    color: #eaeae0;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Hide default Keycloak header */
#kc-header,
#kc-header-wrapper {
    display: none;
}

/* ========================================
   SPLIT SCREEN LAYOUT (40/60)
   ======================================== */

.qraptor-login-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ========================================
   LEFT PANEL - FORM (40%)
   ======================================== */

.qraptor-form-panel {
    flex: 0 0 40%;
    background-color: #1c2227;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.qraptor-form-content {
    width: 100%;
    max-width: 400px;
}

/* Logo */
.qraptor-logo {
    display: flex;
    align-items: center;
    margin-bottom: 2.5rem;
}

.qraptor-logo img {
    height: 40px;
    width: auto;
}

/* Heading */
.qraptor-heading {
    margin-bottom: 2rem;
}

.qraptor-heading h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #eaeae0;
    margin: 0 0 0.5rem 0;
}

.qraptor-heading p {
    font-size: 0.9375rem;
    color: #8b92a7;
    margin: 0;
}

/* ========================================
   SOCIAL BUTTONS
   ======================================== */

.qraptor-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.qraptor-social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #eaeae0;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.qraptor-social-button:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Divider */
.qraptor-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #8b92a7;
    font-size: 0.875rem;
}

.qraptor-divider::before,
.qraptor-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.qraptor-divider span {
    padding: 0 1rem;
}

/* ========================================
   LOGIN FORM
   ======================================== */

.qraptor-login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.qraptor-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.qraptor-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #eaeae0;
}

.qraptor-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #eaeae0;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.qraptor-input::placeholder {
    color: #5a5f73;
}

.qraptor-input:focus {
    outline: none;
    border-color: #1dc690;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(29, 198, 144, 0.1);
}

.qraptor-input-error {
    border-color: #e74c3c;
}

.qraptor-error-message {
    font-size: 0.875rem;
    color: #e74c3c;
    margin-top: -0.25rem;
}

/* Form Options (Remember me + Forgot password) */
.qraptor-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -0.5rem;
}

.qraptor-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #8b92a7;
    cursor: pointer;
}

.qraptor-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1dc690;
    cursor: pointer;
}

.qraptor-forgot-link {
    font-size: 0.875rem;
    color: #1dc690;
    text-decoration: none;
    transition: color 0.2s ease;
}

.qraptor-forgot-link:hover {
    color: #17a071;
}

/* Submit Button */
.qraptor-submit-button {
    width: 100%;
    padding: 0.875rem 1rem;
    background: #1dc690;
    border: none;
    border-radius: 8px;
    color: #1c2227;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qraptor-submit-button:hover {
    background: #17a071;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 198, 144, 0.25);
}

.qraptor-submit-button:active {
    transform: translateY(0);
}

/* Signup Link */
.qraptor-signup-link {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9375rem;
    color: #8b92a7;
}

.qraptor-signup-link a {
    color: #1dc690;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.qraptor-signup-link a:hover {
    color: #17a071;
}

/* Legal Links (Privacy & Terms) */
.qraptor-legal-links {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
    color: #6b7280;
}

.qraptor-legal-links a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.qraptor-legal-links a:hover {
    color: #1dc690;
}

.qraptor-legal-separator {
    margin: 0 0.5rem;
    color: #4b5563;
}

/* ========================================
   RIGHT PANEL - HERO (60%)
   ======================================== */

.qraptor-hero-panel {
    flex: 0 0 60%;
    background: linear-gradient(135deg, #1c2227 0%, #2a3139 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
}

.qraptor-hero-content {
    max-width: 600px;
}

.qraptor-hero-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #eaeae0;
    margin: 0 0 1rem 0;
}

.qraptor-hero-content > p {
    font-size: 1.125rem;
    color: #8b92a7;
    line-height: 1.7;
    margin: 0 0 3rem 0;
}

/* Feature Grid */
.qraptor-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.qraptor-feature {
    display: flex;
    gap: 1rem;
}

.qraptor-feature-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(29, 198, 144, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1dc690;
}

.qraptor-feature h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #eaeae0;
    margin: 0 0 0.25rem 0;
}

.qraptor-feature p {
    font-size: 0.9375rem;
    color: #8b92a7;
    margin: 0;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .qraptor-login-container {
        flex-direction: column;
    }

    .qraptor-form-panel {
        flex: 1 1 auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .qraptor-hero-panel {
        flex: 1 1 auto;
        min-height: 50vh;
    }

    .qraptor-hero-content h2 {
        font-size: 2rem;
    }

    .qraptor-feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .qraptor-form-panel {
        padding: 1.5rem 1rem;
    }

    .qraptor-hero-panel {
        padding: 2rem 1rem;
    }

    .qraptor-heading h1 {
        font-size: 1.5rem;
    }

    .qraptor-hero-content h2 {
        font-size: 1.75rem;
    }

    .qraptor-feature-grid {
        gap: 1.5rem;
    }
}

/* ========================================
   KEYCLOAK-SPECIFIC OVERRIDES
   ======================================== */

/* Hide unwanted Keycloak elements */
#kc-locale,
#kc-registration,
#kc-info-wrapper {
    display: none !important;
}

/* Alert messages */
.alert {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    animation: slideDown 0.3s ease-out;
    max-width: 500px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.alert-error {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #e74c3c;
}

.alert-warning {
    background: rgba(243, 156, 18, 0.15);
    border: 1px solid rgba(243, 156, 18, 0.4);
    color: #f39c12;
}

.alert-success {
    background: rgba(29, 198, 144, 0.15);
    border: 1px solid rgba(29, 198, 144, 0.4);
    color: #1dc690;
}

.alert-info {
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.4);
    color: #3498db;
}

.alert span:first-child {
    font-size: 1.25rem;
    font-weight: 700;
}
