/* Artigor ERP Login Stylesheet
   - Inspired by the premium dark-mode dual-pane Stitch design
   - Implements a non-scrollable desktop layout and scrollable mobile fallback
   - Retains all branding elements, fonts, and animation states
*/

/* Custom Font Import */
@font-face {
    font-family: 'IncompleetaLightWhite';
    src: url('/assets/IncompleetaLight-white.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-dark: #0b0e17;
    --text-light: #f8fafc;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --primary-color: #ef2b2d;
    --primary-hover: #dc2626;
    --input-bg: #f8fafc;
    --focus-ring: rgba(239, 43, 45, 0.15);
    --border-radius: 12px;
    --box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Body Styling - Non-scrollable on Desktop */
html, body {
    height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    /* Subtle background grid matching Stitch mockup */
    background-image: 
        radial-gradient(at 50% 0%, rgba(30, 41, 59, 0.4) 0px, transparent 60%),
        radial-gradient(at 0% 100%, rgba(15, 23, 42, 0.3) 0px, transparent 50%);
    background-attachment: fixed;
    overflow: hidden;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
}

/* Header & Navigation */
.modern-header {
    flex-shrink: 0;
    width: 100%;
    z-index: 100;
    background: transparent;
    padding: 1rem 2rem;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    background: transparent !important;
    box-shadow: none !important;
}

.navbar-left {
    display: flex;
    align-items: center;
}

.navbar-logo {
    display: flex;
    align-items: center;
}

.logo-link {
    text-decoration: none;
    display: block;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.logo-3d {
    display: flex;
    align-items: baseline;
    font-weight: 800;
    font-size: 1.8rem;
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.logo-3d:hover {
    transform: rotateY(5deg) rotateX(2deg);
}

.logo-text {
    color: var(--text-light);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transform: translateZ(20px);
    transition: all 0.3s ease;
    font-family: 'IncompleetaLightWhite', 'Montserrat', sans-serif;
}

.logo-font {
    font-family: 'IncompleetaLightWhite', 'Montserrat', sans-serif;
    font-size: 2.2rem;
    letter-spacing: 0.04em;
    display: inline-block;
    line-height: 1;
    color: inherit;
}

.logo-3d:hover .logo-text {
    text-shadow: 3px 3px 8px rgba(239, 43, 45, 0.6);
    transform: translateZ(30px);
}

/* Careers Button (Top-Right) */
.navbar-right {
    display: flex;
    align-items: center;
}

.careers-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.careers-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    color: var(--text-light);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: hidden;
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Login Split Card */
.login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: flex;
    width: 100%;
    min-height: 580px;
    max-height: calc(100vh - 160px);
}

/* Left Decorative Panel (Dashboard Graphic) */
.card-left-decor {
    width: 50%;
    background-image: url('/img/erp_login_decor.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* Semi-transparent dark overlay to blend the dashboard graphic into the screen */
.card-left-decor::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.15) 0%, rgba(11, 14, 23, 0.3) 100%);
    pointer-events: none;
}

/* Right Authentication Panel */
.card-right {
    width: 50%;
    background: #ffffff;
    padding: 3.5rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--text-dark);
}

/* Login Header Typography */
.login-header {
    margin-bottom: 2rem;
    text-align: left;
}

.login-title {
    color: var(--text-dark);
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.5px;
}

.login-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* Form Fields */
.login-form {
    width: 100%;
}

.form-group-aligned {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-label-aligned {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.required-star {
    color: var(--primary-color);
    margin-left: 2px;
}

/* Input group wrapper containing icon and input */
.input-group-aligned {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.input-prefix-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: var(--transition);
}

.form-input-aligned {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background-color: var(--input-bg);
    color: var(--text-dark);
    transition: var(--transition);
}

.form-input-aligned.input-with-prefix {
    padding-left: 42px;
}

.form-input-aligned:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.form-input-aligned:focus + .input-prefix-icon {
    color: var(--primary-color);
}

.form-input-aligned::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Password Toggle Button */
.password-toggle-btn {
    position: absolute;
    right: 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.password-toggle-btn:hover {
    color: var(--text-dark);
}

/* Actions Row (Remember Me & Forgot Password) */
.form-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.remember-me-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-dark);
    user-select: none;
}

.remember-me-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
}

.forgot-password-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.forgot-password-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Primary Authenticate Button */
.login-btn-main {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(239, 43, 45, 0.2);
    transition: var(--transition);
}

.login-btn-main:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 43, 45, 0.35);
}

.login-btn-main:active {
    transform: translateY(1px);
}

/* Two-Factor Authentication (OTP) Transition */
.otp-section {
    width: 100%;
}

.otp-section hr {
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

/* Error States */
.form-input-aligned.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.error-message {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    text-align: left;
    display: none;
}

/* Loading Overlay Styles (Preserved for AngularJS) */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 14, 23, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* AngularJS Cloak Support */
[ng-cloak], .ng-cloak {
    display: none !important;
}

/* Micro-animations */
.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Responsive Breakpoints & Fallback Scrolling for Mobile */
@media (max-width: 900px) {
    html, body {
        height: auto;
        overflow: auto;
        overflow-y: auto;
    }

    .modern-header {
        padding: 1rem 1.5rem;
    }

    .main-content {
        height: auto;
        min-height: calc(100vh - 80px);
        padding: 1.5rem 1rem;
        overflow: visible;
    }

    .login-container {
        max-width: 500px;
    }

    .login-card {
        flex-direction: column;
        height: auto;
        max-height: none;
        min-height: auto;
    }

    .card-left-decor {
        display: none; /* Hide illustrative panel on small viewports */
    }

    .card-right {
        width: 100%;
        padding: 2.5rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .modern-header {
        padding: 0.75rem 1rem;
    }

    .logo-font {
        font-size: 1.8rem;
    }

    .careers-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .card-right {
        padding: 2rem 1.25rem;
    }

    .login-title {
        font-size: 1.75rem;
    }
}