/* Login Page Styles - Vercel/Geist Light Theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* Allow vertical scrolling so nothing is clipped when Windows text-size /
       display scaling is above 100% (Chromium treats that as page zoom). */
    overflow-x: hidden;
    overflow-y: auto;
}

.login-container {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    display: flex;
    /* "safe center" centers when the content fits but falls back to the start
       edge when it's taller than the viewport, so the logo/top never get cut
       off - a plain "center" would clip the top and make it unscrollable.
       The first declaration is a fallback for engines without the safe kw. */
    align-items: center;
    align-items: safe center;
    justify-content: center;
    overflow-y: auto;
    padding: 24px 0;
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fafafa;
    z-index: 1;
}

.login-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('Photos/loading screen background.png') center/cover;
    opacity: 0.05;
}

.login-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.login-logo-container {
    text-align: center;
    /* Shrinks with zoom so the logo + form still fit together. */
    margin-bottom: clamp(16px, 4vh, 40px);
}

.login-logo {
    /* Cap to the container width so a zoomed logo can't overflow sideways. */
    width: min(300px, 70%);
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
}

.login-box {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: clamp(24px, 4vh, 40px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    animation: slideUp 0.5s ease-out;
}

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

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 32px;
    color: #171717;
    margin-bottom: 8px;
    font-weight: 600;
}

.login-header p {
    color: #737373;
    font-size: 16px;
}

.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #171717;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group label i {
    color: #525252;
    width: 16px;
}

.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #171717;
}

.form-group input:focus {
    outline: none;
    border-color: #171717;
    box-shadow: 0 0 0 1px #171717;
}

.password-input-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a3a3a3;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #171717;
}

.remember-me {
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #171717;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
    animation: shake 0.5s ease;
}

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

.login-btn {
    width: 100%;
    padding: 14px;
    background: #171717;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.login-btn:hover:not(:disabled) {
    background: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Login Divider */
.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #a3a3a3;
    font-size: 14px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e5e5;
}

.login-divider span {
    padding: 0 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Launch Software Button */
.launch-btn {
    width: 100%;
    padding: 16px;
    background: #ffffff;
    color: #171717;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
}

.launch-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #171717;
}

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

.launch-btn i {
    font-size: 20px;
    color: #171717;
}

.launch-btn span {
    font-size: 16px;
}

.launch-btn small {
    font-size: 12px;
    font-weight: 400;
    color: #a3a3a3;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: #737373;
    font-size: 14px;
}

/* Software Selection Modal */
.software-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.software-modal-content {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 40px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    animation: slideUp 0.3s ease;
    position: relative;
}

.software-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.software-modal-header h2 {
    font-size: 28px;
    color: #171717;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #a3a3a3;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #171717;
}

.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.software-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e5e5e5;
    position: relative;
    overflow: hidden;
}

.software-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fafafa;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.software-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: #171717;
}

.software-card:hover::before {
    opacity: 0.5;
}

.software-card.admin-card {
    background: #171717;
    border: 1px solid #171717;
}

.software-card.admin-card i {
    color: #ffffff;
}

.software-card.admin-card h3 {
    color: white;
}

.software-card.admin-card p {
    color: rgba(255,255,255,0.6);
}

.software-card.admin-card:hover {
    border-color: #000000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.software-card.office-card {
    background: #fafafa;
    border: 1px solid #e5e5e5;
}

.software-card.office-card i {
    color: #171717;
}

.software-card.office-card h3 {
    color: #171717;
}

.software-card.office-card p {
    color: #737373;
}

.software-card.office-card:hover {
    border-color: #171717;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.software-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.software-card.disabled::after {
    content: '🔒';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
}

.software-card.disabled:hover {
    transform: none;
    box-shadow: none;
}

.software-card i {
    font-size: 48px;
    color: #171717;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.software-card.disabled i {
    color: #a3a3a3;
}

.software-card h3 {
    font-size: 20px;
    color: #171717;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    font-weight: 600;
}

.software-card.disabled h3 {
    color: #737373;
}

.software-card p {
    font-size: 14px;
    color: #737373;
    position: relative;
    z-index: 1;
}

.software-card.disabled p {
    color: #a3a3a3;
}

/* No Software Message */
.no-software-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #737373;
}

.no-software-message i {
    font-size: 64px;
    color: #d4d4d4;
    margin-bottom: 20px;
}

.no-software-message h3 {
    font-size: 20px;
    color: #171717;
    margin-bottom: 12px;
}

.no-software-message p {
    font-size: 14px;
    margin-bottom: 8px;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
    margin-top: 20px;
}

.user-info p {
    color: #737373;
    font-size: 14px;
}

.user-info p span {
    font-weight: 600;
    color: #171717;
}

.logout-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    text-align: center;
    color: #171717;
}

.loading-spinner i {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.loading-spinner p {
    font-size: 18px;
    font-weight: 500;
}

/* Debug Panel Styles */
.debug-panel {
    background: #fafafa;
    color: #171717;
    border-radius: 8px;
    margin-top: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e5e5;
}

.debug-header {
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    border-bottom: 1px solid #e5e5e5;
}

.debug-content {
    padding: 12px;
    line-height: 1.6;
}

.debug-content .log {
    margin: 4px 0;
    padding: 4px 0;
    border-bottom: 1px solid #f5f5f5;
}

.debug-content .log.error {
    color: #dc2626;
}

.debug-content .log.success {
    color: #16a34a;
}

.debug-content .log.info {
    color: #2563eb;
}

.debug-content .log.warn {
    color: #ca8a04;
}

/* Show Debug Panel Button */
.show-debug-btn {
    background: #f5f5f5;
    color: #171717;
    border: 1px solid #e5e5e5;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
    float: right;
}

.show-debug-btn:hover {
    background: #e5e5e5;
}

/* ============================================
   CONNECTION STATUS BANNER
   ============================================ */
.connection-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    padding: 10px 16px;
    text-align: center;
}

.connection-banner.offline {
    background: #dc2626;
    color: white;
}

.connection-banner.online {
    background: #16a34a;
    color: white;
}

.connection-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   SESSION KICK MODAL
   ============================================ */
.session-kick-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.session-kick-content {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    animation: slideUp 0.3s ease;
}

.session-kick-icon {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.session-kick-icon > i:first-child {
    font-size: 64px;
    color: #171717;
}

.session-kick-icon .session-warning {
    position: absolute;
    bottom: -5px;
    right: -10px;
    font-size: 28px;
    color: #dc2626;
    background: white;
    border-radius: 50%;
}

.session-kick-content h2 {
    font-size: 28px;
    color: #171717;
    margin-bottom: 12px;
    font-weight: 600;
}

.session-kick-content > p {
    color: #737373;
    font-size: 16px;
    margin-bottom: 20px;
}

.existing-session-info {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.existing-session-info .device-info,
.existing-session-info .session-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #525252;
    font-size: 14px;
}

.existing-session-info .device-info {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 500;
}

.existing-session-info i {
    color: #171717;
}

.warning-text {
    color: #dc2626 !important;
    font-weight: 500;
    background: #fef2f2;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px !important;
}

.session-kick-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.session-kick-actions .btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-kick-actions .btn-secondary {
    background: #f5f5f5;
    color: #171717;
    border: 1px solid #e5e5e5;
}

.session-kick-actions .btn-secondary:hover {
    background: #e5e5e5;
}

.session-kick-actions .btn-primary.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
}

.session-kick-actions .btn-primary.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* ============================================
   OFFLINE MODE NOTICE
   ============================================ */
.offline-mode-notice {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.offline-notice-content {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    animation: slideUp 0.3s ease;
}

.offline-icon {
    width: 80px;
    height: 80px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.offline-icon i {
    font-size: 36px;
    color: #dc2626;
}

.offline-notice-content h2 {
    font-size: 28px;
    color: #171717;
    margin-bottom: 12px;
    font-weight: 600;
}

.offline-notice-content p {
    color: #737373;
    font-size: 16px;
    margin-bottom: 12px;
}

.offline-note {
    color: #a3a3a3 !important;
    font-size: 14px !important;
    font-style: italic;
}

.offline-notice-content .btn-primary {
    margin-top: 20px;
    padding: 14px 32px;
    background: #171717;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.offline-notice-content .btn-primary:hover {
    background: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .login-box {
        padding: 30px 20px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .software-modal-content {
        padding: 30px 20px;
    }
    
    .software-grid {
        grid-template-columns: 1fr;
    }
    
    .user-info {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .session-kick-content,
    .offline-notice-content {
        padding: 30px 20px;
    }
    
    .session-kick-actions {
        flex-direction: column;
    }
    
    .session-kick-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
