/* =============================================
   KAI BOOKING ROOM - AUTH STYLES
   Split Screen Login Design with KAI Branding
   ============================================= */

/* CSS Variables */
:root {
    --kai-navy: #1a365d;
    --kai-navy-dark: #0f2540;
    --kai-orange: #f97316;
    --kai-orange-light: #fb923c;
    --kai-orange-dark: #ea580c;
    --kai-white: #ffffff;
    --kai-gray-100: #f3f4f6;
    --kai-gray-200: #e5e7eb;
    --kai-gray-300: #d1d5db;
    --kai-gray-400: #9ca3af;
    --kai-gray-500: #6b7280;
    --kai-gray-600: #4b5563;
    --kai-gray-700: #374151;
    --kai-gray-800: #1f2937;
    --kai-gray-900: #111827;
    --kai-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --kai-shadow-lg: 0 35px 60px -12px rgba(0, 0, 0, 0.35);
    --kai-gradient: linear-gradient(135deg, var(--kai-navy) 0%, var(--kai-navy-dark) 100%);
    --kai-gradient-orange: linear-gradient(135deg, var(--kai-orange) 0%, var(--kai-orange-dark) 100%);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Auth Page Body - Split Screen */
.auth-page {
    min-height: 100vh;
    display: flex;
    font-family: 'Figtree', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--kai-gray-100);
    overflow: hidden;
}

/* ============================
   LEFT SIDE - Branding Panel
   ============================ */
.auth-branding {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    background: var(--kai-gradient);
}

/* Background Image Layer */
.auth-branding::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/images/kai-background.png') center center / cover no-repeat;
    opacity: 0.4;
    z-index: 0;
}

/* Gradient Overlay */
.auth-branding::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(26, 54, 93, 0.92) 0%,
        rgba(15, 37, 64, 0.85) 50%,
        rgba(26, 54, 93, 0.88) 100%
    );
    z-index: 1;
}

/* Branding Content */
.auth-branding-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 480px;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo */
.auth-logo {
    display: inline-block;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.auth-logo:hover {
    transform: scale(1.05);
}

.auth-logo img {
    width: 180px;
    height: auto;
    filter: drop-shadow(0 15px 40px rgba(249, 115, 22, 0.4));
}

/* Branding Title */
.auth-branding-title {
    color: var(--kai-white);
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.auth-branding-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.125rem;
    margin: 0 0 2.5rem 0;
    font-weight: 400;
}

/* Feature List */
.auth-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.auth-feature:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(5px);
}

.auth-feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kai-gradient-orange);
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.auth-feature-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Floating Elements */
.floating-elements {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}

.floating-elements::before,
.floating-elements::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.floating-elements::before {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.15) 0%, transparent 70%);
    top: -100px;
    right: -50px;
    animation-delay: 0s;
}

.floating-elements::after {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.1) 0%, transparent 70%);
    bottom: -50px;
    left: -50px;
    animation-delay: -10s;
}

/* Railway Track Decoration */
.auth-track-decoration {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        var(--kai-orange) 0px,
        var(--kai-orange) 30px,
        transparent 30px,
        transparent 60px
    );
    z-index: 10;
}

/* ============================
   RIGHT SIDE - Form Panel
   ============================ */
.auth-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    background: var(--kai-white);
    overflow-y: auto;
}

/* Form Container */
.auth-form-container {
    width: 100%;
    max-width: 420px;
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile Logo (hidden on desktop) */
.auth-mobile-logo {
    display: none;
    text-align: center;
    margin-bottom: 2rem;
}

.auth-mobile-logo img {
    width: 100px;
    height: auto;
}

.auth-mobile-logo h2 {
    font-size: 1.25rem;
    color: var(--kai-navy);
    margin: 1rem 0 0.25rem 0;
    font-weight: 700;
}

.auth-mobile-logo p {
    font-size: 0.8rem;
    color: var(--kai-gray-500);
    margin: 0;
}

/* Form Card Title */
.auth-card-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--kai-navy);
    margin: 0 0 0.5rem 0;
}

.auth-card-subtitle {
    font-size: 1rem;
    color: var(--kai-gray-500);
    margin: 0 0 2rem 0;
}

/* Form Groups */
.auth-form-group {
    margin-bottom: 1.5rem;
}

.auth-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--kai-gray-700);
    margin-bottom: 0.5rem;
}

.auth-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: var(--kai-gray-800);
    background-color: var(--kai-gray-100);
    border: 2px solid transparent;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    outline: none;
}

.auth-input::placeholder {
    color: var(--kai-gray-400);
}

.auth-input:hover {
    background-color: var(--kai-gray-200);
}

.auth-input:focus {
    background-color: var(--kai-white);
    border-color: var(--kai-orange);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
}

/* Password Input with Toggle */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper .auth-input {
    padding-right: 2.75rem !important; /* Space for eye icon on far right */
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--kai-gray-400);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--kai-orange);
}

.password-toggle:hover {
    color: var(--kai-orange);
    transform: translateY(-50%) scale(1.05);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

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

.auth-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--kai-orange);
    cursor: pointer;
    border-radius: 0.25rem;
}

.auth-checkbox-label {
    font-size: 0.875rem;
    color: var(--kai-gray-600);
    cursor: pointer;
    user-select: none;
}

/* Form Actions */
.auth-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Links */
.auth-link {
    font-size: 0.875rem;
    color: var(--kai-orange);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auth-link:hover {
    color: var(--kai-orange-dark);
    text-decoration: underline;
}

/* Primary Button */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--kai-white);
    background: var(--kai-gradient-orange);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 140px;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.auth-btn:hover {
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-btn-full {
    width: 100%;
}

/* Secondary Button */
.auth-btn-secondary {
    background: transparent;
    color: var(--kai-navy);
    border: 2px solid var(--kai-navy);
    box-shadow: none;
}

.auth-btn-secondary:hover {
    background: var(--kai-navy);
    color: var(--kai-white);
    box-shadow: 0 4px 15px rgba(26, 54, 93, 0.3);
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--kai-gray-300);
}

.auth-divider span {
    font-size: 0.75rem;
    color: var(--kai-gray-400);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Footer Links */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--kai-gray-200);
}

.auth-footer-text {
    font-size: 0.875rem;
    color: var(--kai-gray-500);
}

.auth-footer-text a {
    color: var(--kai-orange);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.auth-footer-text a:hover {
    color: var(--kai-orange-dark);
    text-decoration: underline;
}

/* Error Messages */
.auth-error {
    color: #dc2626;
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.auth-error::before {
    content: '⚠';
    font-size: 0.875rem;
}

/* Success Messages */
.auth-success {
    background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%);
    color: #166534;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #bbf7d0;
}

.auth-success::before {
    content: '✓';
    font-weight: bold;
}

/* Session Status */
.auth-status {
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    color: #1e40af;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    border: 1px solid #bfdbfe;
}

/* Icons in inputs */
.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--kai-gray-400);
    pointer-events: none;
    transition: color 0.3s ease;
}

.input-icon-wrapper .auth-input {
    padding-left: 2.75rem;
}

.input-icon-wrapper:focus-within .input-icon {
    color: var(--kai-orange);
}

/* Loading Spinner */
.auth-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--kai-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Copyright Footer */
.auth-copyright {
    margin-top: 2rem;
    color: var(--kai-gray-400);
    font-size: 0.75rem;
    text-align: center;
}

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

/* Tablet and below */
@media (max-width: 1024px) {
    .auth-branding-title {
        font-size: 2rem;
    }
    
    .auth-logo img {
        width: 150px;
    }
    
    .auth-features {
        gap: 0.75rem;
    }
}

/* Mobile - Premium Navy Theme */
@media (max-width: 768px) {
    .auth-page {
        flex-direction: column;
        background: var(--kai-navy);
        min-height: 100vh;
        position: relative;
        z-index: 1;
    }

    /* Background Image & Overlay for Mobile */
    .auth-page::before {
        content: '';
        position: absolute;
        inset: 0;
        background: url('/images/kai-background.png') center center / cover no-repeat;
        opacity: 0.2;
        z-index: -1;
    }

    .auth-page::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(26, 54, 93, 0.95) 0%, rgba(15, 37, 64, 0.9) 100%);
        z-index: -1;
    }
    
    .auth-branding {
        display: none;
    }
    
    .auth-form-panel {
        flex: 1;
        padding: 0;
        justify-content: center;
        background: transparent;
        display: flex;
        align-items: center;
    }
    
    .auth-form-container {
        max-width: 100%;
        width: 100%;
        padding: 2rem;
        background: transparent;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 100vh;
    }
    
    .auth-mobile-logo {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin-bottom: 3rem;
        width: 100%;
    }
    
    .auth-mobile-logo h2 {
        color: var(--kai-white);
        font-size: 1.75rem; /* Bold & Big */
        margin: 0 0 2rem 0;
        font-weight: 900; /* Extra Bold */
        letter-spacing: 0.05em;
        text-transform: uppercase;
        text-shadow: 0 4px 15px rgba(0,0,0,0.5);
        text-align: center;
        line-height: 1.2;
    }

    .logo-wrapper {
        background: rgba(255, 255, 255, 0.1);
        padding: 1.5rem;
        border-radius: 2rem;
        backdrop-filter: blur(10px);
        box-shadow: 0 15px 35px rgba(0,0,0,0.2);
        border: 1px solid rgba(255, 255, 255, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 140px;
        height: 140px;
    }
    
    .auth-mobile-logo img {
        width: 100%;
        height: auto;
        filter: drop-shadow(0 5px 15px rgba(0,0,0,0.1));
    }
    
    /* Hide the redundant "Selamat Datang" card titles on mobile */
    .auth-card-title,
    .auth-card-subtitle {
        display: none !important;
    }
    
    /* Form Group Glassmorphism */
    .auth-form-group {
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-radius: 1.25rem;
        padding: 1.25rem;
        margin-bottom: 1.25rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.3s ease;
    }

    .auth-form-group:focus-within {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(249, 115, 22, 0.5);
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }
    
    .auth-label {
        color: rgba(255, 255, 255, 0.8);
        font-weight: 700;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        margin-bottom: 0.75rem;
        display: block;
    }
    
    .auth-input {
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid transparent;
        border-radius: 0.875rem;
        padding: 0.875rem 1rem;
        font-size: 1rem;
        color: var(--kai-navy);
        font-weight: 500;
        transition: all 0.3s ease;
    }
    
    .auth-input:focus {
        background: var(--kai-white);
        box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2);
    }
    
    /* Remove icons on mobile */
    .input-icon-wrapper .auth-input {
        padding-left: 1rem;
    }
    
    .input-icon {
        display: none;
    }
    
    .password-toggle {
        right: 0.5rem;
        color: var(--kai-navy);
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        opacity: 0.6;
    }

    .password-input-wrapper .auth-input {
        padding-right: 2.75rem !important;
    }
    
    .auth-checkbox-wrapper {
        padding: 0.5rem 0.25rem;
    }
    
    .auth-checkbox-label {
        color: rgba(255, 255, 255, 0.8);
        font-weight: 500;
    }
    
    .auth-form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 1.25rem;
        margin-top: 2rem;
    }
    
    .auth-btn {
        width: 100%;
        padding: 1.125rem 2rem;
        font-size: 1.125rem;
        border-radius: 1.25rem;
        background: var(--kai-gradient-orange);
        box-shadow: 0 10px 30px rgba(234, 88, 12, 0.4);
        font-weight: 700;
        border: none;
    }
    
    .auth-btn:active {
        transform: none;
    }
    
    .auth-link {
        text-align: center;
        color: rgba(255, 255, 255, 0.7);
        font-weight: 600;
        font-size: 0.9375rem;
    }
    
    .auth-link:hover {
        color: var(--kai-white);
    }
    
    .auth-error {
        color: #fca5a5;
        background: rgba(239, 68, 68, 0.1);
        padding: 0.625rem 1rem;
        border-radius: 0.75rem;
        margin-top: 0.75rem;
        font-size: 0.8125rem;
        font-weight: 500;
        border: 1px solid rgba(239, 68, 68, 0.2);
    }
    
    .auth-copyright {
        color: rgba(255, 255, 255, 0.4);
        margin-top: 3rem;
        text-align: center;
        font-size: 0.75rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .auth-form-container {
        padding: 1rem;
    }
    
    .auth-card-title {
        font-size: 1.5rem;
    }
    
    .auth-mobile-logo img {
        width: 80px;
    }
    
    .auth-input {
        padding: 0.875rem;
        font-size: 0.9375rem;
    }
    
    .input-icon-wrapper .auth-input {
        padding-left: 1rem;
    }
}

/* =============================================
   DEFINITIVE MOBILE POSITIONING FIX
   Forces the eye icon to the far right
   ============================================= */
.password-input-group {
    position: relative !important;
    width: 100% !important;
    display: block !important;
}

.password-input-group .auth-input {
    padding-right: 3rem !important;
    width: 100% !important;
}

.password-input-group .password-toggle {
    position: absolute !important;
    right: 12px !important;
    left: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 100 !important;
    cursor: pointer !important;
}

/* Mobile Specific Override */
@media (max-width: 768px) {
    .password-input-group .password-toggle {
        right: 8px !important;
        opacity: 0.8 !important;
    }
}

