/* Login Professional Styles - Nyx Industrial Automation Platform */

/* Import technical font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* Global box-sizing */
* {
    box-sizing: border-box;
}

:root {
    /* Industrial color palette */
    --industrial-blue: #0ea5e9;
    --steel-gray: #475569;
    --safety-orange: #f97316;
    --dark-slate: #0f172a;
    --grid-silver: #94a3b8;
    --success-green: #10b981;
    --warning-yellow: #eab308;
    --surface-dark: #1e293b;
    
    /* Gradients */
    --industrial-gradient: linear-gradient(135deg, var(--dark-slate) 0%, var(--surface-dark) 100%);
    --tech-gradient: linear-gradient(135deg, var(--industrial-blue) 0%, #0284c7 100%);
}

/* Reset body and html styles for login page */
html, body.login-page {
    margin: 0;
    padding: 0;
    height: 100%;
    min-height: 100vh;
}

/* Main container */
.login-container {
    display: flex;
    min-height: 100vh;
    height: 100vh;
    position: relative;
    background: var(--dark-slate);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow: hidden;
}

/* Static background pattern */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

/* Left Panel - Branding */
.branding-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    text-align: center;
    background: 
        var(--industrial-gradient),
        repeating-linear-gradient(
            0deg,
            rgba(14, 165, 233, 0.03),
            rgba(14, 165, 233, 0.03) 1px,
            transparent 1px,
            transparent 30px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(14, 165, 233, 0.03),
            rgba(14, 165, 233, 0.03) 1px,
            transparent 1px,
            transparent 30px
        );
}

.branding-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.branding-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(14, 165, 233, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.logo-container {
    position: relative;
    z-index: 1;
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.8s ease-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-container img {
    max-width: 220px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.logo-container img:hover {
    transform: scale(1.02);
}

.app-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 3px;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease-out 0.2s both;
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    text-align: center;
    width: 100%;
}

.brand-separator {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--industrial-blue), transparent);
    margin: 1.5rem auto;
    animation: fadeIn 0.8s ease-out 0.3s both;
}

.system-name {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 2px;
    color: white;
    text-shadow: 0 5px 15px rgba(14, 165, 233, 0.3);
    animation: fadeInUp 0.8s ease-out 0.35s both;
    font-family: 'Inter', sans-serif;
    text-align: center;
}

.app-subtitle {
    font-size: 1rem;
    color: var(--grid-silver);
    margin: 0.5rem 0 3rem 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
    font-family: 'JetBrains Mono', monospace;
    text-align: center;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.features-list li {
    color: rgba(255, 255, 255, 0.95);
    padding: 0.75rem 0;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.features-list li::before {
    content: '▸';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(14, 165, 233, 0.2);
    border: 1px solid rgba(14, 165, 233, 0.4);
    border-radius: 4px;
    margin-right: 1rem;
    font-weight: bold;
    color: var(--industrial-blue);
}

.company-footer {
    position: absolute;
    bottom: 2rem;
    left: 3rem;
    right: 3rem;
    text-align: center;
    color: var(--grid-silver);
    font-size: 0.9rem;
    animation: fadeIn 1s ease-out 0.8s both;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.company-footer p {
    margin: 0;
    word-wrap: break-word;
    hyphens: auto;
}

/* Right Panel - Login Form */
.login-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: white;
    position: relative;
}

.login-form-container {
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.8s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 2rem;
    color: var(--dark-slate);
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
}

.login-header p {
    color: #64748b;
    margin: 0;
}

/* Form Styles */
.login-form {
    space-y: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #475569;
    font-weight: 500;
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    transition: color 0.3s ease;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    color: var(--nyx-dark);
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--industrial-blue);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.form-input:focus + .input-icon {
    color: var(--industrial-blue);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--industrial-blue);
}

/* Remember me */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    cursor: pointer;
}

.checkbox-wrapper label {
    margin: 0;
    cursor: pointer;
    color: #64748b;
    font-size: 0.95rem;
}

.forgot-link {
    color: var(--industrial-blue);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--safety-orange);
}

/* Submit button */
.submit-button {
    width: 100%;
    padding: 1rem;
    background: var(--tech-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Inter', sans-serif;
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: width 0.3s ease;
}

.submit-button:hover::before {
    width: 100%;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.3);
    background: linear-gradient(135deg, #0284c7 0%, var(--industrial-blue) 100%);
}

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

.submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
}

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

/* Error messages */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    animation: shake 0.5s ease;
}

.error-message svg {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success message */
.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

/* Security indicator */
.security-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
    color: #64748b;
    font-size: 0.9rem;
}

.security-indicator svg {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    color: var(--success-green);
}

/* Version info */
.version-info {
    text-align: center;
    margin-top: 1rem;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .login-container {
        flex-direction: column;
    }
    
    .branding-panel {
        padding: 2rem;
        min-height: 35vh;
        width: 100%;
    }
    
    .app-title {
        font-size: 3rem;
    }
    
    .features-list {
        display: none;
    }
    
    .login-panel {
        min-height: 65vh;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    html, body.login-page {
        height: 100vh;
        overflow: hidden;
    }
    
    .login-container {
        display: flex;
        flex-direction: column;
        height: 100vh;
    }
    
    .login-container::before,
    .branding-panel::before {
        display: none;
    }
    
    .branding-panel {
        flex: 0 0 auto;
        min-height: 40vh;
        max-height: 45vh;
        padding: 2rem 1.5rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }
    
    .login-panel {
        flex: 1;
        padding: 2rem 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow-y: auto;
        background: white;
    }
    
    .login-form-container {
        width: 100%;
        max-width: 400px;
        padding: 0;
    }
    
    .logo-container img:hover {
        transform: none;
    }
    
    .company-footer {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        margin-top: auto;
        padding-top: 1rem;
        font-size: 0.8rem;
    }
    
    .features-list {
        display: none;
    }
}

@media (max-width: 640px) {
    .branding-panel {
        min-height: 35vh;
        max-height: 40vh;
        padding: 1.5rem 1rem;
    }
    
    .logo-container {
        margin-bottom: 0.5rem;
    }
    
    .logo-container img {
        max-width: 110px;
        height: auto;
    }
    
    .app-title {
        font-size: 2rem;
        margin-bottom: 0.3rem;
    }
    
    .brand-separator {
        height: 2px;
        width: 40px;
        margin: 0.4rem 0;
    }
    
    .system-name {
        font-size: 1.5rem;
        margin: 0.3rem 0;
    }
    
    .app-subtitle {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .company-footer {
        font-size: 0.75rem;
        padding-top: 0.75rem;
    }
    
    .login-panel {
        padding: 1.5rem 1rem;
    }
    
    .login-form-container {
        max-width: 100%;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
    
    .login-header p {
        font-size: 0.875rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-input {
        height: 44px;
        font-size: 0.95rem;
    }
    
    .submit-button {
        height: 46px;
        font-size: 0.95rem;
    }
    
    .security-indicator {
        margin-top: 1rem;
        font-size: 0.8rem;
    }
    
    .version-info {
        font-size: 0.75rem;
        margin-top: 1rem;
}

@media (max-width: 480px) {
    .branding-panel {
        min-height: 33vh;
        max-height: 38vh;
        padding: 1.25rem 0.75rem;
    }
    
    .logo-container img {
        max-width: 100px;
    }
    
    .app-title {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }
    
    .brand-separator {
        width: 35px;
        margin: 0.3rem 0;
    }
    
    .system-name {
        font-size: 1.3rem;
        margin: 0.25rem 0;
    }
    
    .app-subtitle {
        font-size: 0.7rem;
        margin-bottom: 0.4rem;
    }
    
    .company-footer {
        font-size: 0.7rem;
        padding-top: 0.5rem;
    }
    
    .login-panel {
        padding: 1.25rem 0.75rem;
    }
    
    .login-header h2 {
        font-size: 1.3rem;
    }
    
    .form-input {
        padding: 0.625rem 0.75rem 0.625rem 2.5rem;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .submit-button {
        padding: 0.75rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 375px) {
    .branding-panel {
        min-height: 30vh;
        max-height: 35vh;
        padding: 1rem 0.5rem;
    }
    
    .logo-container img {
        max-width: 90px;
    }
    
    .app-title {
        font-size: 1.5rem;
    }
    
    .brand-separator {
        width: 30px;
        height: 1px;
    }
    
    .system-name {
        font-size: 1.2rem;
    }
    
    .app-subtitle {
        font-size: 0.65rem;
    }
    
    .company-footer {
        font-size: 0.65rem;
    }
    
    .login-panel {
        padding: 1rem 0.5rem;
    }
    
    .login-header h2 {
        font-size: 1.2rem;
    }
    
    .login-header p {
        font-size: 0.8rem;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .login-panel {
        background: #1e293b;
        color: white;
    }
    
    .login-header h2 {
        color: white;
    }
    
    .login-header p {
        color: #94a3b8;
    }
    
    .form-group label {
        color: #cbd5e1;
    }
    
    .form-input {
        background: #334155;
        border-color: #475569;
        color: white;
    }
    
    .form-input:focus {
        border-color: var(--industrial-blue);
        box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
    }
}